mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 21:25:30 +03:00
nixos/switch-test: add test for multi-line unit values
This commit is contained in:
parent
74a5f77274
commit
f6fed8b831
1 changed files with 17 additions and 1 deletions
|
@ -260,6 +260,15 @@ in {
|
||||||
systemd.services."escaped\\x2ddash".serviceConfig.X-Test = "test";
|
systemd.services."escaped\\x2ddash".serviceConfig.X-Test = "test";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
unitWithMultilineValue.configuration = {
|
||||||
|
systemd.services.test.serviceConfig.ExecStart = ''
|
||||||
|
${pkgs.coreutils}/bin/true \
|
||||||
|
# ignored
|
||||||
|
; ignored
|
||||||
|
blah blah
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
unitStartingWithDash.configuration = {
|
unitStartingWithDash.configuration = {
|
||||||
systemd.services."-" = {
|
systemd.services."-" = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -874,9 +883,16 @@ in {
|
||||||
machine.succeed("! test -e /run/current-system/dry-activate")
|
machine.succeed("! test -e /run/current-system/dry-activate")
|
||||||
machine.succeed("! test -e /run/current-system/bin/switch-to-configuration")
|
machine.succeed("! test -e /run/current-system/bin/switch-to-configuration")
|
||||||
|
|
||||||
|
# Ensure units with multiline values work
|
||||||
|
out = switch_to_specialisation("${machine}", "unitWithMultilineValue")
|
||||||
|
assert_lacks(out, "NOT restarting the following changed units:")
|
||||||
|
assert_lacks(out, "reloading the following units:")
|
||||||
|
assert_lacks(out, "restarting the following units:")
|
||||||
|
assert_lacks(out, "the following new units were started:")
|
||||||
|
assert_contains(out, "starting the following units: test.service")
|
||||||
|
|
||||||
# Ensure \ works in unit names
|
# Ensure \ works in unit names
|
||||||
out = switch_to_specialisation("${machine}", "unitWithBackslash")
|
out = switch_to_specialisation("${machine}", "unitWithBackslash")
|
||||||
assert_contains(out, "stopping the following units: test.service\n")
|
|
||||||
assert_lacks(out, "NOT restarting the following changed units:")
|
assert_lacks(out, "NOT restarting the following changed units:")
|
||||||
assert_lacks(out, "reloading the following units:")
|
assert_lacks(out, "reloading the following units:")
|
||||||
assert_lacks(out, "\nrestarting the following units:")
|
assert_lacks(out, "\nrestarting the following units:")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue