From: Yu Watanabe Date: Sat, 28 Oct 2017 06:35:19 +0000 (+0900) Subject: test: add test for ReadOnlyPaths= with RuntimeDirectory= X-Git-Tag: v236~258^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23fd04e92d8b260e8ba326f6e62ccf7a4076ff44;p=thirdparty%2Fsystemd.git test: add test for ReadOnlyPaths= with RuntimeDirectory= --- diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 7905b5db9db..0468d11fe89 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -225,6 +225,7 @@ static void test_exec_readonlypaths(Manager *m) { test(m, "exec-readonlypaths.service", 0, CLD_EXITED); test(m, "exec-readonlypaths-mount-propagation.service", 0, CLD_EXITED); + test(m, "exec-readonlypaths-with-bindpaths.service", 0, CLD_EXITED); } static void test_exec_readwritepaths(Manager *m) { diff --git a/test/meson.build b/test/meson.build index 5e98ec6e50c..bc37946bab0 100644 --- a/test/meson.build +++ b/test/meson.build @@ -81,6 +81,7 @@ test_data_files = ''' test-execute/exec-protectkernelmodules-yes-mount-propagation.service test-execute/exec-read-only-path-succeed.service test-execute/exec-readonlypaths-mount-propagation.service + test-execute/exec-readonlypaths-with-bindpaths.service test-execute/exec-readonlypaths.service test-execute/exec-readwritepaths-mount-propagation.service test-execute/exec-restrict-namespaces-mnt-blacklist.service diff --git a/test/test-execute/exec-readonlypaths-with-bindpaths.service b/test/test-execute/exec-readonlypaths-with-bindpaths.service new file mode 100644 index 00000000000..ea9211395db --- /dev/null +++ b/test/test-execute/exec-readonlypaths-with-bindpaths.service @@ -0,0 +1,9 @@ +[Unit] +Description=Test for ReadOnlyPaths= + +[Service] +ReadOnlyPaths=/etc -/i-dont-exist /usr +# From 6c47cd7d3bf35c8158a0737f34fe2c5dc95e72d6, RuntimeDirectory= implies BindPaths=. +RuntimeDirectory=foo +ExecStart=/bin/sh -x -c 'test ! -w /etc && test ! -w /usr && test ! -e /i-dont-exist && test -w /var' +Type=oneshot