about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/chrony-ptp.nix
blob: b2634a8cfc5c6ff416f713f2ed9b12922fb16e08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import ./make-test-python.nix ({ lib, ... }:
{
  name = "chrony-ptp";

  meta = {
    maintainers = with lib.maintainers; [ gkleen ];
  };

  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')
  '';
})