diff options
author | Luca Boccassi <bluca@debian.org> | 2022-10-18 19:32:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 19:32:36 +0200 |
commit | 50675bb98f44b2db90d7899150a5355c75e6df68 (patch) | |
tree | f7bba3a63ff3ad11967bf8ce6a0e5f20f5d51867 | |
parent | 9ca1efbc4624efab1fb30acd79f7b84c53d18206 (diff) | |
parent | 70f0e75ef880e913e0f565766dfd0c7b21610f3c (diff) | |
download | systemd-50675bb98f44b2db90d7899150a5355c75e6df68.tar.gz |
Merge pull request #25050 from keszybz/transient-drop-ins-2
TEST-15: add one more variant of the test for drop-ins on transient services
-rw-r--r-- | TODO | 3 | ||||
-rwxr-xr-x | test/units/testsuite-15.sh | 48 |
2 files changed, 48 insertions, 3 deletions
@@ -554,9 +554,6 @@ Features: * add ability to set hostname with suffix derived from machine id at boot -* ask dracut to generate usr= on the kernel cmdline so that we don't need to - read /etc/fstab from the root fs from the initrd and do daemon-reload - * add PR_SET_DUMPABLE service setting * homed/userdb: maybe define a "companion" dir for home directories where apps diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh index 079c8b290e..3c3dbefa68 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/testsuite-15.sh @@ -317,6 +317,53 @@ test_transient_service_dropins () { /etc/systemd/system/a-b-.service.d/drop3.conf } +test_transient_slice_dropins () { + echo "Testing dropins for a transient slice..." + echo "*** test transient slice drop-ins" + + # FIXME: implement reloading of individual units. + # + # The settings here are loaded twice. For most settings it doesn't matter, + # but Documentation is not deduplicated, so we current get repeated entried + # which is a bug. + + mkdir -p /etc/systemd/system/slice.d + mkdir -p /etc/systemd/system/a-.slice.d + mkdir -p /etc/systemd/system/a-b-.slice.d + mkdir -p /etc/systemd/system/a-b-c.slice.d + + echo -e '[Unit]\nDocumentation=man:drop1' >/etc/systemd/system/slice.d/drop1.conf + echo -e '[Unit]\nDocumentation=man:drop2' >/etc/systemd/system/a-.slice.d/drop2.conf + echo -e '[Unit]\nDocumentation=man:drop3' >/etc/systemd/system/a-b-.slice.d/drop3.conf + echo -e '[Unit]\nDocumentation=man:drop4' >/etc/systemd/system/a-b-c.slice.d/drop4.conf + + # No fragment is required, so this works + systemctl cat a-b-c.slice + + busctl call \ + org.freedesktop.systemd1 \ + /org/freedesktop/systemd1 \ + org.freedesktop.systemd1.Manager \ + StartTransientUnit 'ssa(sv)a(sa(sv))' \ + 'a-b-c.slice' 'replace' \ + 1 \ + 'Documentation' as 1 'man:drop5' \ + 0 + + data=$(systemctl show -P Documentation a-b-c.slice) + test "$data" = "man:drop1 man:drop2 man:drop3 man:drop4 man:drop5 man:drop1 man:drop2 man:drop3 man:drop4" + + # Do a reload and check again + systemctl daemon-reload + data=$(systemctl show -P Documentation a-b-c.slice) + test "$data" = "man:drop5 man:drop1 man:drop2 man:drop3 man:drop4" + + clear_units a-b-c.slice + rm /etc/systemd/system/slice.d/drop1.conf \ + /etc/systemd/system/a-.slice.d/drop2.conf \ + /etc/systemd/system/a-b-.slice.d/drop3.conf +} + test_template_dropins () { echo "Testing template dropins..." @@ -657,6 +704,7 @@ test_template_alias test_hierarchical_service_dropins test_hierarchical_slice_dropins test_transient_service_dropins +test_transient_slice_dropins test_template_dropins test_alias_dropins test_masked_dropins |