about summary refs log tree commit diff
path: root/nixos/tests/chrony-ptp.nix
diff options
context:
space:
mode:
authorGregor Kleen <20089782+gkleen@users.noreply.github.com>2023-01-15 14:06:58 +0100
committerAustin Seipp <aseipp@pobox.com>2023-01-31 10:08:32 -0600
commitb355be2d91cc63d723793791657561e23f7703d8 (patch)
treef3784d54bc6c299ad99de9582338f48751333db0 /nixos/tests/chrony-ptp.nix
parent48ecda096288c2d1a7c9eb5cca1cedc54afd7223 (diff)
chrony: add nixos test for ptp_kvm
Diffstat (limited to 'nixos/tests/chrony-ptp.nix')
-rw-r--r--nixos/tests/chrony-ptp.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/chrony-ptp.nix b/nixos/tests/chrony-ptp.nix
new file mode 100644
index 0000000000000..c5904645fc4eb
--- /dev/null
+++ b/nixos/tests/chrony-ptp.nix
@@ -0,0 +1,24 @@
+import ./make-test-python.nix ({ lib, ... }:
+{
+  name = "chrony-ptp";
+
+  nodes = {
+    qemuGuest = { lib, ... }: {
+      boot.kernelModules = [ "ptp_kvm" ];
+
+      services.chrony = {
+        enable = true;
+        extraConfig = ''
+          refclock PHC /dev/ptp_kvm poll 2 dpoll -2 offset 0 stratum 3
+        '';
+      };
+    };
+  };
+
+  testScript = ''
+    start_all()
+
+    qemuGuest.wait_for_unit('multi-user.target')
+    qemuGuest.succeed('systemctl is-active chronyd.service')
+  '';
+})