From: Frantisek Sumsal Date: Wed, 16 Feb 2022 14:55:09 +0000 (+0100) Subject: test: set `ReadWritePaths=` only for units from TEST-20 X-Git-Tag: v251-rc1~268 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93c3b6989b17825850c3b41687b0955b6c32c53b;p=thirdparty%2Fsystemd.git test: set `ReadWritePaths=` only for units from TEST-20 as setting it system-wide has some undesirable side-effects. Follow-up to b6fc524. --- diff --git a/test/test-functions b/test/test-functions index c8bf96d65a2..e815ce1c585 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1168,11 +1168,16 @@ install_systemd() { # When built with gcov, disable ProtectSystem= and ProtectHome= in the test # images, since it prevents gcov to write the coverage reports (*.gcda - # files). Similarly, set ReadWritePaths= to the $BUIL_DIR in the test image - # to make the coverage work with units utilizing DynamicUser=yes. + # files) if get_bool "$IS_BUILT_WITH_COVERAGE"; then mkdir -p "$initdir/etc/systemd/system/service.d/" - echo -e "[Service]\nProtectSystem=no\nProtectHome=no\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/system/service.d/gcov-override.conf" + echo -e "[Service]\nProtectSystem=no\nProtectHome=no\n" >"$initdir/etc/systemd/system/service.d/99-gcov-override.conf" + # Similarly, set ReadWritePaths= to the $BUILD_DIR in the test image + # to make the coverage work with units utilizing DynamicUser=yes. Do + # this only for services from TEST-20, as setting this system-wide + # has many undesirable side-effects + mkdir -p "$initdir/etc/systemd/system/test20-.service.d/" + echo -e "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/system/test20-.service.d/99-gcov-rwpaths-override.conf" fi # If we're built with -Dportabled=false, tests with systemd-analyze