From: Frantisek Sumsal Date: Sun, 18 Jun 2023 21:08:24 +0000 (+0200) Subject: test: extend the DynamicUser=yes coverage workaround to a couple more services X-Git-Tag: v254-rc1~176^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52db3601bdb2bd667aa6e96f17b14889a8363cce;p=thirdparty%2Fsystemd.git test: extend the DynamicUser=yes coverage workaround to a couple more services --- diff --git a/test/test-functions b/test/test-functions index 0a5a67f7d16..99e11fc2cad 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"