Mock NTP time

For device testing a client needed a solution to set devices reliably to a time in the future to trigger certificate renewal and similar processes.

We agreed that providing a mock time via a NTP service would be a good solution. One requirement was to have the NTP service run in a Docker container.

I explored the space of NTP services and if in one of those the time could be set freely but didn’t have any luck finding such a solution. What i found was that for some NTP services the local time could be used as time source. But as we wanted to run the NTP server in a Docker container changing the local time was not possible.

After considering different approaches i came up with the following solution:

I put it all together and put my solution for running a NTP service with fake time as Docker container on github.