summaryrefslogtreecommitdiffstats
path: root/nixos/tests/ntpd.nix
blob: e961cb7614a7da36bb7dd030d301d0df3ff4c175 (plain)
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
{ 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')
    # ntp user must be able to create drift files
    machine.succeed('su -s /bin/sh -c "touch /var/lib/ntp/ntp.drift" ntp')
  '';
}