From 19c40f0e11f39b8a5abb0eeb53415932474e00ae Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sat, 19 Oct 2024 14:26:27 -0400 Subject: [PATCH] nixos/tests/ntpd: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/ntpd.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 nixos/tests/ntpd.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 8ddcc779ea90..f153f9f8e0f0 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -714,6 +714,7 @@ in { nsd = handleTest ./nsd.nix {}; ntfy-sh = handleTest ./ntfy-sh.nix {}; ntfy-sh-migration = handleTest ./ntfy-sh-migration.nix {}; + ntpd = handleTest ./ntpd.nix {}; ntpd-rs = handleTest ./ntpd-rs.nix {}; nvidia-container-toolkit = runTest ./nvidia-container-toolkit.nix; nvmetcfg = handleTest ./nvmetcfg.nix {}; diff --git a/nixos/tests/ntpd.nix b/nixos/tests/ntpd.nix new file mode 100644 index 000000000000..1864044b64d4 --- /dev/null +++ b/nixos/tests/ntpd.nix @@ -0,0 +1,25 @@ +import ./make-test-python.nix ( + { lib, ... }: + { + name = "ntpd"; + + meta = { + maintainers = with lib.maintainers; [ pyrox0 ]; + }; + + nodes.machine = { + services.ntp = { + enable = true; + }; + }; + + testScript = '' + start_all() + + 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') + ''; + } +)