diff options
author | Janne Heß <janne@hess.ooo> | 2023-09-13 16:56:01 +0200 |
---|---|---|
committer | Janne Heß <janne@hess.ooo> | 2023-09-13 16:56:01 +0200 |
commit | 211e2d738bbb9b19ce873203e8bc72c832072e15 (patch) | |
tree | 24b64b97e9032309d1a3ea8991c69c55c2b84b75 /nixos | |
parent | d1c1335908813fa659a02aa61222672b03b9239f (diff) | |
download | nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.tar nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.tar.gz nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.tar.bz2 nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.tar.lz nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.tar.xz nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.tar.zst nixlib-211e2d738bbb9b19ce873203e8bc72c832072e15.zip |
nixos/switchTest: Also test init interface version
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/switch-test.nix | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/tests/switch-test.nix b/nixos/tests/switch-test.nix index 7be0b4c7d3cc..ef50f93eee86 100644 --- a/nixos/tests/switch-test.nix +++ b/nixos/tests/switch-test.nix @@ -58,6 +58,10 @@ in { ''); specialisation = rec { + brokenInitInterface.configuration.config.system.extraSystemBuilderCmds = '' + echo "systemd 0" > $out/init-interface-version + ''; + simpleService.configuration = { systemd.services.test = { wantedBy = [ "multi-user.target" ]; @@ -646,7 +650,11 @@ in { # invalid action fails the script switch_to_specialisation("${machine}", "", action="broken-action", fail=True) # no action fails the script - "Usage:" in machine.fail("${machine}/bin/switch-to-configuration") + assert "Usage:" in machine.fail("${machine}/bin/switch-to-configuration 2>&1") + + with subtest("init interface version"): + # Do not try to switch to an invalid init interface version + assert "incompatible" in switch_to_specialisation("${machine}", "brokenInitInterface", fail=True) with subtest("services"): switch_to_specialisation("${machine}", "") |