1import ./make-test-python.nix ({ lib, ... }:
2{
3 name = "chrony-ptp";
4
5 meta = {
6 maintainers = with lib.maintainers; [ gkleen ];
7 };
8
9 nodes = {
10 qemuGuest = { lib, ... }: {
11 boot.kernelModules = [ "ptp_kvm" ];
12
13 services.chrony = {
14 enable = true;
15 extraConfig = ''
16 refclock PHC /dev/ptp_kvm poll 2 dpoll -2 offset 0 stratum 3
17 '';
18 };
19 };
20 };
21
22 testScript = ''
23 start_all()
24
25 qemuGuest.wait_for_unit('multi-user.target')
26 qemuGuest.succeed('systemctl is-active chronyd.service')
27 '';
28})