···
systemd.services."escaped\\x2ddash".serviceConfig.X-Test = "test";
217
+
unitStartingWithDash.configuration = {
218
+
systemd.services."-" = {
219
+
wantedBy = [ "multi-user.target" ];
222
+
RemainAfterExit = true;
223
+
ExecStart = "${pkgs.coreutils}/bin/true";
228
+
unitStartingWithDashModified.configuration = {
229
+
imports = [ unitStartingWithDash.configuration ];
230
+
systemd.services."-" = {
231
+
reloadIfChanged = true;
232
+
serviceConfig.ExecReload = "${pkgs.coreutils}/bin/true";
unitWithRequirement.configuration = {
systemd.services.required-service = {
wantedBy = [ "multi-user.target" ];
···
assert_contains(out, "\nstarting the following units: escaped\\x2ddash.service\n")
assert_lacks(out, "the following new units were started:")
659
+
# Ensure units can start with a dash
660
+
out = switch_to_specialisation("${machine}", "unitStartingWithDash")
661
+
assert_contains(out, "stopping the following units: escaped\\x2ddash.service\n")
662
+
assert_lacks(out, "NOT restarting the following changed units:")
663
+
assert_lacks(out, "reloading the following units:")
664
+
assert_lacks(out, "\nrestarting the following units:")
665
+
assert_lacks(out, "\nstarting the following units:")
666
+
assert_contains(out, "the following new units were started: -.service\n")
668
+
# The regression only occurs when reloading units
669
+
out = switch_to_specialisation("${machine}", "unitStartingWithDashModified")
670
+
assert_lacks(out, "stopping the following units:")
671
+
assert_lacks(out, "NOT restarting the following changed units:")
672
+
assert_contains(out, "reloading the following units: -.service")
673
+
assert_lacks(out, "\nrestarting the following units:")
674
+
assert_lacks(out, "\nstarting the following units:")
675
+
assert_lacks(out, "the following new units were started:")
# Ensure units that require changed units are properly reloaded
out = switch_to_specialisation("${machine}", "unitWithRequirement")
642
-
assert_contains(out, "stopping the following units: escaped\\x2ddash.service\n")
679
+
assert_contains(out, "stopping the following units: -.service\n")
assert_lacks(out, "NOT restarting the following changed units:")
assert_lacks(out, "reloading the following units:")
assert_lacks(out, "\nrestarting the following units:")