]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Add failing test to show service.d global drop-in does not get overridden by more...
authorGreg "GothAck" Miell <greg@gothack.ninja>
Fri, 27 Dec 2019 14:36:49 +0000 (14:36 +0000)
committerGreg "GothAck" Miell <greg@gothack.ninja>
Fri, 27 Dec 2019 14:53:32 +0000 (14:53 +0000)
test/TEST-15-DROPIN/test-dropin.sh

index fd500c1a0be885264e41ae6b9a5bc81a773ec866..f80c9df1076a80c3535d24baf3b97980f639a316 100755 (executable)
@@ -117,6 +117,30 @@ EOF
     clear_services a b c
 }
 
+test_hierarchical_dropins () {
+    echo "Testing hierarchical dropins..."
+    echo "*** test service.d/ top level drop-in"
+    create_services a-b-c
+    check_ko a-b-c ExecCondition "/bin/echo service.d"
+    check_ko a-b-c ExecCondition "/bin/echo a-.service.d"
+    check_ko a-b-c ExecCondition "/bin/echo a-b-.service.d"
+    check_ko a-b-c ExecCondition "/bin/echo a-b-c.service.d"
+
+    for dropin in service.d a-.service.d a-b-.service.d a-b-c.service.d; do
+        mkdir -p /usr/lib/systemd/system/$dropin
+        echo "
+[Service]
+ExecCondition=/bin/echo $dropin
+        " > /usr/lib/systemd/system/$dropin/override.conf
+        check_ok a-b-c ExecCondition "/bin/echo $dropin"
+    done
+    for dropin in service.d a-.service.d a-b-.service.d a-b-c.service.d; do
+        rm -rf /usr/lib/systemd/system/$dropin
+    done
+
+    clear_services a-b-c
+}
+
 test_template_dropins () {
     echo "Testing template dropins..."
 
@@ -433,6 +457,7 @@ test_invalid_dropins () {
 }
 
 test_basic_dropins
+test_hierarchical_dropins
 test_template_dropins
 test_alias_dropins
 test_masked_dropins