diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-07-15 09:29:01 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-07-15 09:29:01 +0200 |
commit | 821dba740e7240d9df3a56072700cdc6b0f2471f (patch) | |
tree | c1b8cbed4a0824a60b8aa638a74d4fc0f2405cc7 /nixos/tests/systemd.nix | |
parent | ac94f1ab7edf19d9de695042f1a804871d81725a (diff) | |
parent | 5788f7173e9dadaa8b2053fd6bb9406a7a5912e4 (diff) |
Merge branch 'staging-next' into staging
Diffstat (limited to 'nixos/tests/systemd.nix')
-rw-r--r-- | nixos/tests/systemd.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix index 24949c4a9f662..a653932fb37c7 100644 --- a/nixos/tests/systemd.nix +++ b/nixos/tests/systemd.nix @@ -50,6 +50,13 @@ import ./make-test-python.nix ({ pkgs, ... }: { fi ''; }; + + systemd.watchdog = { + device = "/dev/watchdog"; + runtimeTime = "30s"; + rebootTime = "10min"; + kexecTime = "5min"; + }; }; testScript = '' @@ -122,5 +129,20 @@ import ./make-test-python.nix ({ pkgs, ... }: { retcode, output = machine.execute("systemctl status testservice1.service") assert retcode in [0, 3] # https://bugs.freedesktop.org/show_bug.cgi?id=77507 assert "CPU:" in output + + # Test systemd is configured to manage a watchdog + with subtest("systemd manages hardware watchdog"): + machine.wait_for_unit("multi-user.target") + + # It seems that the device's path doesn't appear in 'systemctl show' so + # check it separately. + assert "WatchdogDevice=/dev/watchdog" in machine.succeed( + "cat /etc/systemd/system.conf" + ) + + output = machine.succeed("systemctl show | grep Watchdog") + assert "RuntimeWatchdogUSec=30s" in output + assert "RebootWatchdogUSec=10m" in output + assert "KExecWatchdogUSec=5m" in output ''; }) |