summaryrefslogtreecommitdiffstats
path: root/test/units
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-28 16:49:11 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-28 17:29:21 +0100
commitcf6562e4565c3055e1f387adadf2ff7fb0ce1688 (patch)
treeb2fd20c58d678195e13b185b9e523fe8ee2b5bf1 /test/units
parentunti-file: fix symlinked drop-in directory handling (diff)
downloadsystemd-cf6562e4565c3055e1f387adadf2ff7fb0ce1688.tar.xz
systemd-cf6562e4565c3055e1f387adadf2ff7fb0ce1688.zip
test: add testcases of symlinked drop-in directories
Diffstat (limited to 'test/units')
-rwxr-xr-xtest/units/testsuite-15.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh
index 56ac1f774f..0446e71c38 100755
--- a/test/units/testsuite-15.sh
+++ b/test/units/testsuite-15.sh
@@ -515,6 +515,25 @@ test_invalid_dropins () {
return 0
}
+test_symlink_dropin_directory () {
+ # For issue #21920.
+ echo "Testing symlink drop-in directory..."
+ create_services test15-a
+ rmdir /{etc,run,usr/lib}/systemd/system/test15-a.service.d
+ mkdir -p /tmp/testsuite-15-test15-a-dropin-directory
+ ln -s /tmp/testsuite-15-test15-a-dropin-directory /etc/systemd/system/test15-a.service.d
+ cat >/tmp/testsuite-15-test15-a-dropin-directory/override.conf <<EOF
+[Unit]
+Description=hogehoge
+EOF
+ ln -s /tmp/testsuite-15-test15-a-dropin-directory-nonexistent /run/systemd/system/test15-a.service.d
+ touch /tmp/testsuite-15-test15-a-dropin-directory-regular
+ ln -s /tmp/testsuite-15-test15-a-dropin-directory-regular /usr/lib/systemd/system/test15-a.service.d
+ check_ok test15-a Description hogehoge
+
+ clear_services test15-a
+}
+
test_basic_dropins
test_linked_units
test_template_alias
@@ -523,5 +542,6 @@ test_template_dropins
test_alias_dropins
test_masked_dropins
test_invalid_dropins
+test_symlink_dropin_directory
touch /testok