mozilla-services / autograph-canary

An AWS lambda for checking Autograph signing is working correctly
0 stars 1 forks source link

teach container to time travel #31

Open g-k opened 3 years ago

g-k commented 3 years ago

Specifically, we'd like to run it in the future to detect pending expirations.

Something like the following should work:

timedatectl set-ntp no
timedatectl set-time YYYY-MM-DD
timedatectl set-time $(date -u -d '+60 day' '+%F')

https://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/

^ results in:

root@85daaeb79bd9:/function# timedatectl set-time $(date -u -d '+60 day' '+%F')
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

so that approach might not be possible in a container.

g-k commented 3 years ago

https://github.com/wolfcw/libfaketime is also an option