diff options
author | Janne Heß <janne@hess.ooo> | 2023-09-13 17:04:54 +0200 |
---|---|---|
committer | Janne Heß <janne@hess.ooo> | 2023-09-13 17:04:54 +0200 |
commit | e0717ce857afab4a72a1d2b1e69d91e482b3370d (patch) | |
tree | 7aae1c4946d19c627af7103fca09e580646b68be /nixos | |
parent | 211e2d738bbb9b19ce873203e8bc72c832072e15 (diff) | |
download | nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.gz nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.bz2 nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.lz nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.xz nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.zst nixlib-e0717ce857afab4a72a1d2b1e69d91e482b3370d.zip |
nixos/switchTest: Also test systemd restarts
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/switch-test.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/tests/switch-test.nix b/nixos/tests/switch-test.nix index ef50f93eee86..1ecf00d158cc 100644 --- a/nixos/tests/switch-test.nix +++ b/nixos/tests/switch-test.nix @@ -62,6 +62,10 @@ in { echo "systemd 0" > $out/init-interface-version ''; + modifiedSystemConf.configuration.systemd.extraConfig = '' + # Hello world! + ''; + simpleService.configuration = { systemd.services.test = { wantedBy = [ "multi-user.target" ]; @@ -656,6 +660,11 @@ in { # Do not try to switch to an invalid init interface version assert "incompatible" in switch_to_specialisation("${machine}", "brokenInitInterface", fail=True) + with subtest("systemd restarts"): + # systemd is restarted when its system.conf changes + out = switch_to_specialisation("${machine}", "modifiedSystemConf") + assert_contains(out, "restarting systemd...") + with subtest("services"): switch_to_specialisation("${machine}", "") # Nothing happens when nothing is changed |