summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-29 00:49:11 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-01-04 16:17:30 +0100
commit2a9efd85136e468f09d7fcccd494774f82ff005b (patch)
treeb491980132feb0c72ce631c1503136d7dcb847e2
parentf47d962bb1c6882dbb5c675a786e394ebb368d24 (diff)
downloadsystemd-2a9efd85136e468f09d7fcccd494774f82ff005b.tar.gz
test: add testcases of symlinked drop-in directories
(cherry picked from commit cf6562e4565c3055e1f387adadf2ff7fb0ce1688)
-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