summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2023-09-13 17:04:54 +0200
committerJanne Heß <janne@hess.ooo>2023-09-13 17:04:54 +0200
commite0717ce857afab4a72a1d2b1e69d91e482b3370d (patch)
tree7aae1c4946d19c627af7103fca09e580646b68be
parent211e2d738bbb9b19ce873203e8bc72c832072e15 (diff)
downloadnixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar
nixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.gz
nixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.bz2
nixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.lz
nixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.xz
nixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.tar.zst
nixpkgs-e0717ce857afab4a72a1d2b1e69d91e482b3370d.zip
nixos/switchTest: Also test systemd restarts
-rw-r--r--nixos/tests/switch-test.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/tests/switch-test.nix b/nixos/tests/switch-test.nix
index ef50f93eee8..1ecf00d158c 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