My application checks /proc/sys/kernel/random/boot_id
and invokes some code to find out if this changed since last execution (stuff related to reading monotonic time). I'd like to test this behaviour in docker; however I can't find a way to set this:
/proc
filesystem cannot be re-mounted--sysctl
has a whitelist of kernel parameters that can be overridden;kernel.random.boot_id
is not amongst them- running
sysctl
as root in the container won't set it - I have not found any mention in manual page for
unshare
that would let me set this (contrary to the monotonic time that has its own namespace in cgroups)
I found mentions of kubectl --boot-id-file
flag but I haven't figured out how exactly this would be applied. Any further clues how I could mock this? (besides extreme options such as intercepting the syscall with ptrace, or LD_PRELOAD for the open call?)