Provide an implementation for systemd-tmpfiles.

Co-authored-by: aanderse <aaron@fosslib.net>
Co-authored-by: jfroche <jfroche@pyxel.be>
This commit is contained in:
r-vdp 2023-10-12 11:13:08 +02:00
parent 549bc38339
commit e51a1d3ed0
No known key found for this signature in database
6 changed files with 88 additions and 3 deletions

View file

@ -132,6 +132,8 @@ forEachUbuntuImage
node1.succeed("grep -F 'launch_the_rockets = true' /etc/foo.conf")
node1.fail("grep -F 'launch_the_rockets = false' /etc/foo.conf")
node1.succeed("test -d /var/tmp/system-manager")
${system-manager.lib.activateProfileSnippet { node = "node1"; profile = newConfig; }}
node1.succeed("systemctl status new-service.service")
node1.fail("systemctl status service-9.service")
@ -140,6 +142,9 @@ forEachUbuntuImage
node1.fail("cat /etc/systemd/system/nginx.service")
node1.succeed("cat /etc/foo_new")
node1.succeed("test -d /var/tmp/system-manager")
node1.succeed("touch /var/tmp/system-manager/foo1")
# Simulate a reboot, to check that the services defined with
# system-manager start correctly after a reboot.
# TODO: can we find an easy way to really reboot the VM and not
@ -159,6 +164,7 @@ forEachUbuntuImage
${system-manager.lib.deactivateProfileSnippet { node = "node1"; profile = newConfig; }}
node1.fail("systemctl status new-service.service")
node1.fail("cat /etc/foo_new")
#node1.fail("test -f /var/tmp/system-manager/foo1")
'';
})
];
@ -197,10 +203,17 @@ forEachUbuntuImage
node1.wait_for_unit("default.target")
${system-manager.lib.activateProfileSnippet { node = "node1"; }}
${system-manager.lib.prepopulateProfileSnippet { node = "node1"; }}
node1.systemctl("daemon-reload")
node1.systemctl("start default.target")
# Simulate a reboot, to check that the services defined with
# system-manager start correctly after a reboot.
# TODO: can we find an easy way to really reboot the VM and not
# loose the root FS state?
node1.systemctl("isolate rescue.target")
# We need to send a return character to dismiss the rescue-mode prompt
node1.send_key("ret")
node1.systemctl("isolate default.target")
node1.wait_for_unit("system-manager.target")
node1.succeed("systemctl status service-9.service")