nixpkgs/nixos/tests/ntpd.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
539 B
Nix
Raw Normal View History

{ lib, ... }:
{
name = "ntpd";
2024-10-19 14:26:27 -04:00
meta = {
maintainers = with lib.maintainers; [ pyrox0 ];
};
2024-10-19 14:26:27 -04:00
nodes.machine = {
services.ntp = {
enable = true;
2024-10-19 14:26:27 -04:00
};
};
2024-10-19 14:26:27 -04:00
testScript = ''
start_all()
2024-10-19 14:26:27 -04:00
machine.wait_for_unit('ntpd.service')
machine.wait_for_console_text('Listen normally on 10 eth*')
machine.succeed('systemctl is-active ntpd.service')
machine.succeed('ntpq -p')
# ntp user must be able to create drift files
machine.succeed('su -s /bin/sh -c "touch /var/lib/ntp/ntp.drift" ntp')
'';
}