summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-14 15:08:49 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-14 15:08:49 +0100
commit3b5ab021196038299418a56521d25ef3256c280f (patch)
tree33e08fca9cdac5c29cf84cb5f852b40a4fe2efb0 /test
parentbasic/unit-file: when loading linked unit files, use link source as "fragment... (diff)
downloadsystemd-3b5ab021196038299418a56521d25ef3256c280f.tar.xz
systemd-3b5ab021196038299418a56521d25ef3256c280f.zip
TEST-15-DROPINS: add test for linked units
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-15.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh
index b872a24c20..bf6a5c7a87 100755
--- a/test/units/testsuite-15.sh
+++ b/test/units/testsuite-15.sh
@@ -124,6 +124,32 @@ EOF
clear_services test15-a test15-b test15-c
}
+test_linked_units () {
+ echo "Testing linked units..."
+ echo "*** test linked unit (same basename)"
+
+ create_service test15-a
+ mv /etc/systemd/system/test15-a.service /
+ ln -s /test15-a.service /etc/systemd/system/
+ ln -s test15-a.service /etc/systemd/system/test15-b.service
+
+ check_ok test15-a Names test15-a.service
+ check_ok test15-a Names test15-b.service
+
+ echo "*** test linked unit (cross basename)"
+
+ mv /test15-a.service /test15-a@.scope
+ ln -fs /test15-a@.scope /etc/systemd/system/test15-a.service
+ systemctl daemon-reload
+
+ check_ok test15-a Names test15-a.service
+ check_ok test15-a Names test15-b.service
+ check_ko test15-a Names test15-b@
+
+ rm /test15-a@.scope
+ clear_services test15-a test15-b
+}
+
test_hierarchical_dropins () {
echo "Testing hierarchical dropins..."
echo "*** test service.d/ top level drop-in"
@@ -465,6 +491,7 @@ test_invalid_dropins () {
}
test_basic_dropins
+test_linked_units
test_hierarchical_dropins
test_template_dropins
test_alias_dropins