summaryrefslogtreecommitdiff
path: root/test/TEST-15-DROPIN/test-dropin.sh
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2019-12-17 15:47:37 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-12-18 08:43:40 +0100
commit7a670b1dd981c645064f69faf85b04620aadbafb (patch)
tree1654f6597dcc2c0755121135a1f8f05748bb256b /test/TEST-15-DROPIN/test-dropin.sh
parent51692fab56efb0093bc74b02df7e30714f7d0fd7 (diff)
downloadsystemd-7a670b1dd981c645064f69faf85b04620aadbafb.tar.gz
shared/dropin: fix assert for invalid drop-in
Don't try to show top level drop-in for non-existent units or when trying to instantiate non-instantiated units: $ systemctl cat nonexistent@.service Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting. $ systemctl cat systemd-journald@.service Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.
Diffstat (limited to 'test/TEST-15-DROPIN/test-dropin.sh')
-rwxr-xr-xtest/TEST-15-DROPIN/test-dropin.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/TEST-15-DROPIN/test-dropin.sh b/test/TEST-15-DROPIN/test-dropin.sh
index fe424c1587..fd500c1a0b 100755
--- a/test/TEST-15-DROPIN/test-dropin.sh
+++ b/test/TEST-15-DROPIN/test-dropin.sh
@@ -419,9 +419,23 @@ EOF
clear_services a b
}
+test_invalid_dropins () {
+ echo "Testing invalid dropins..."
+ # Assertion failed on earlier versions, command exits unsuccessfully on later versions
+ systemctl cat nonexistent@.service || true
+ create_services a
+ systemctl daemon-reload
+ # Assertion failed on earlier versions, command exits unsuccessfully on later versions
+ systemctl cat a@.service || true
+ systemctl stop a
+ clear_services a
+ return 0
+}
+
test_basic_dropins
test_template_dropins
test_alias_dropins
test_masked_dropins
+test_invalid_dropins
touch /testok