···
69
+
addedMount.configuration.virtualisation.fileSystems."/test" = {
74
+
addedMountOptsModified.configuration = {
75
+
imports = [ addedMount.configuration ];
76
+
virtualisation.fileSystems."/test".options = [ "x-test" ];
79
+
addedMountDevModified.configuration = {
80
+
imports = [ addedMountOptsModified.configuration ];
81
+
virtualisation.fileSystems."/test".device = lib.mkForce "ramfs";
84
+
storeMountModified.configuration = {
85
+
virtualisation.fileSystems."/".device = lib.mkForce "auto";
simpleService.configuration = {
systemd.services.test = {
wantedBy = [ "multi-user.target" ];
···
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")
694
+
with subtest("fstab mounts"):
695
+
switch_to_specialisation("${machine}", "")
697
+
out = switch_to_specialisation("${machine}", "addedMount")
698
+
assert_lacks(out, "stopping the following units:")
699
+
assert_lacks(out, "NOT restarting the following changed units:")
700
+
assert_lacks(out, "\nrestarting the following units:")
701
+
assert_lacks(out, "\nstarting the following units:")
702
+
assert_contains(out, "the following new units were started: test.mount\n")
703
+
# modify the mountpoint's options
704
+
out = switch_to_specialisation("${machine}", "addedMountOptsModified")
705
+
assert_lacks(out, "stopping the following units:")
706
+
assert_lacks(out, "NOT restarting the following changed units:")
707
+
assert_contains(out, "reloading the following units: test.mount\n")
708
+
assert_lacks(out, "\nrestarting the following units:")
709
+
assert_lacks(out, "\nstarting the following units:")
710
+
assert_lacks(out, "the following new units were started:")
711
+
# modify the device
712
+
out = switch_to_specialisation("${machine}", "addedMountDevModified")
713
+
assert_lacks(out, "stopping the following units:")
714
+
assert_lacks(out, "NOT restarting the following changed units:")
715
+
assert_lacks(out, "reloading the following units:")
716
+
assert_contains(out, "\nrestarting the following units: test.mount\n")
717
+
assert_lacks(out, "\nstarting the following units:")
718
+
assert_lacks(out, "the following new units were started:")
720
+
out = switch_to_specialisation("${machine}", "addedMount")
721
+
assert_lacks(out, "stopping the following units:")
722
+
assert_lacks(out, "NOT restarting the following changed units:")
723
+
assert_lacks(out, "reloading the following units:")
724
+
assert_contains(out, "\nrestarting the following units: test.mount\n")
725
+
assert_lacks(out, "\nstarting the following units:")
726
+
assert_lacks(out, "the following new units were started:")
728
+
out = switch_to_specialisation("${machine}", "")
729
+
assert_contains(out, "stopping the following units: test.mount\n")
730
+
assert_lacks(out, "NOT restarting the following changed units:")
731
+
assert_contains(out, "reloading the following units: dbus.service\n")
732
+
assert_lacks(out, "\nrestarting the following units:")
733
+
assert_lacks(out, "\nstarting the following units:")
734
+
assert_lacks(out, "the following new units were started:")
735
+
# change something about the / mount
736
+
out = switch_to_specialisation("${machine}", "storeMountModified")
737
+
assert_lacks(out, "stopping the following units:")
738
+
assert_contains(out, "NOT restarting the following changed units: -.mount")
739
+
assert_contains(out, "reloading the following units: dbus.service\n")
740
+
assert_lacks(out, "\nrestarting the following units:")
741
+
assert_lacks(out, "\nstarting the following units:")
742
+
assert_lacks(out, "the following new units were started:")
with subtest("services"):
switch_to_specialisation("${machine}", "")