summaryrefslogtreecommitdiffstats
path: root/test/test-functions
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/test-functions11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test-functions b/test/test-functions
index c8bf96d65a..e815ce1c58 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