summaryrefslogtreecommitdiffstats
path: root/test/test-functions
diff options
context:
space:
mode:
authorFrantisek Sumsal <fsumsal@redhat.com>2023-06-18 23:08:24 +0200
committerFrantisek Sumsal <fsumsal@redhat.com>2023-06-18 23:08:24 +0200
commit52db3601bdb2bd667aa6e96f17b14889a8363cce (patch)
tree36378014ff3f7a1cda196bc617f536ce5b38d342 /test/test-functions
parentMerge pull request #28060 from mrc0mmand/remote-journal-tests (diff)
downloadsystemd-52db3601bdb2bd667aa6e96f17b14889a8363cce.tar.xz
systemd-52db3601bdb2bd667aa6e96f17b14889a8363cce.zip
test: extend the DynamicUser=yes coverage workaround to a couple more services
Diffstat (limited to '')
-rw-r--r--test/test-functions14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/test-functions b/test/test-functions
index 0a5a67f7d1..99e11fc2ca 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -1316,12 +1316,14 @@ install_systemd() {
if get_bool "$IS_BUILT_WITH_COVERAGE"; then
mkdir -p "$initdir/etc/systemd/system/service.d/"
echo -ne "[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 using DynamicUser=yes. Do this
- # only for services with test- prefix, as setting this system-wide
- # has many undesirable side-effects, as it creates its own namespace.
- mkdir -p "$initdir/etc/systemd/system/test-.service.d/"
- echo -ne "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/system/test-.service.d/99-gcov-rwpaths-override.conf"
+ # Similarly, set ReadWritePaths= to the $BUILD_DIR in the test image to make the coverage work with
+ # units using DynamicUser=yes. Do this only for services with test- prefix and a couple of
+ # known-to-use DynamicUser=yes services, as setting this system-wide has many undesirable
+ # side-effects, as it creates its own namespace.
+ for service in test- systemd-journal-{gatewayd,upload}; do
+ mkdir -p "$initdir/etc/systemd/system/$service.service.d/"
+ echo -ne "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/system/$service.service.d/99-gcov-rwpaths-override.conf"
+ done
# Ditto, but for the user daemon
mkdir -p "$initdir/etc/systemd/user/test-.service.d/"
echo -ne "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/user/test-.service.d/99-gcov-rwpaths-override.conf"