nixpkgs/nixos/tests/chrony.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
849 B
Nix
Raw Normal View History

2023-08-10 03:02:33 +03:00
import ./make-test-python.nix ({ lib, ... }:
{
name = "chrony";
meta = {
maintainers = with lib.maintainers; [ fpletz ];
};
nodes = {
machine = {
2023-08-10 03:02:33 +03:00
services.chrony.enable = true;
specialisation.hardened.configuration = {
services.chrony.enableMemoryLocking = true;
environment.memoryAllocator.provider = "graphene-hardened";
# dhcpcd privsep is incompatible with graphene-hardened
networking.useNetworkd = true;
};
2023-08-10 03:02:33 +03:00
};
};
testScript = ''
machine.start()
machine.wait_for_unit('multi-user.target')
machine.succeed('systemctl is-active chronyd.service')
machine.succeed('/run/booted-system/specialisation/hardened/bin/switch-to-configuration test')
machine.succeed('systemctl restart chronyd.service')
machine.wait_for_unit('chronyd.service')
2023-08-10 03:02:33 +03:00
'';
})