depot/third_party/nixpkgs/nixos/tests/chrony.nix
Default email ae2dc6aea6 Project import generated by Copybara.
GitOrigin-RevId: 4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0
2024-10-11 07:15:48 +02:00

28 lines
746 B
Nix

import ./make-test-python.nix ({ lib, ... }:
{
name = "chrony";
meta = {
maintainers = with lib.maintainers; [ fpletz ];
};
nodes = {
machine = {
services.chrony.enable = true;
specialisation.hardened.configuration = {
services.chrony.enableMemoryLocking = true;
environment.memoryAllocator.provider = "graphene-hardened";
};
};
};
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')
'';
})