nixos/switchTest: Also test systemd restarts
This commit is contained in:
@@ -62,6 +62,10 @@ in {
|
|||||||
echo "systemd 0" > $out/init-interface-version
|
echo "systemd 0" > $out/init-interface-version
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
modifiedSystemConf.configuration.systemd.extraConfig = ''
|
||||||
|
# Hello world!
|
||||||
|
'';
|
||||||
|
|
||||||
simpleService.configuration = {
|
simpleService.configuration = {
|
||||||
systemd.services.test = {
|
systemd.services.test = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
@@ -656,6 +660,11 @@ in {
|
|||||||
# Do not try to switch to an invalid init interface version
|
# Do not try to switch to an invalid init interface version
|
||||||
assert "incompatible" in switch_to_specialisation("${machine}", "brokenInitInterface", fail=True)
|
assert "incompatible" in switch_to_specialisation("${machine}", "brokenInitInterface", fail=True)
|
||||||
|
|
||||||
|
with subtest("systemd restarts"):
|
||||||
|
# systemd is restarted when its system.conf changes
|
||||||
|
out = switch_to_specialisation("${machine}", "modifiedSystemConf")
|
||||||
|
assert_contains(out, "restarting systemd...")
|
||||||
|
|
||||||
with subtest("services"):
|
with subtest("services"):
|
||||||
switch_to_specialisation("${machine}", "")
|
switch_to_specialisation("${machine}", "")
|
||||||
# Nothing happens when nothing is changed
|
# Nothing happens when nothing is changed
|
||||||
|
|||||||
Reference in New Issue
Block a user