summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2023-09-13 17:11:32 +0200
committerJanne Heß <janne@hess.ooo>2023-09-13 17:11:32 +0200
commitc3e6412260dd30f82b715f976fff834fbeddae2f (patch)
treeccc0511e34fc374a1ce007b394bbc792d8604769
parente0717ce857afab4a72a1d2b1e69d91e482b3370d (diff)
downloadnixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.tar
nixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.tar.gz
nixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.tar.bz2
nixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.tar.lz
nixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.tar.xz
nixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.tar.zst
nixpkgs-c3e6412260dd30f82b715f976fff834fbeddae2f.zip
nixos/switchTest: Also test restarting from aborted switches
-rw-r--r--nixos/tests/switch-test.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/tests/switch-test.nix b/nixos/tests/switch-test.nix
index 1ecf00d158c..c0bf8f2518d 100644
--- a/nixos/tests/switch-test.nix
+++ b/nixos/tests/switch-test.nix
@@ -665,6 +665,13 @@ in {
         out = switch_to_specialisation("${machine}", "modifiedSystemConf")
         assert_contains(out, "restarting systemd...")
 
+    with subtest("continuing from an aborted switch"):
+        # An aborted switch will write into a file what it tried to start
+        # and a second switch should continue from this
+        machine.succeed("echo dbus.service > /run/nixos/start-list")
+        out = switch_to_specialisation("${machine}", "modifiedSystemConf")
+        assert_contains(out, "starting the following units: dbus.service\n")
+
     with subtest("services"):
         switch_to_specialisation("${machine}", "")
         # Nothing happens when nothing is changed