diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-10-23 21:20:37 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-10-23 21:27:20 +0200 |
commit | 035af7adfe1e9c5cdef46101777a4dc9dc3d01ac (patch) | |
tree | 3c1133786e7e8b3c013351bbaa5735d40f72e90b | |
parent | 096a154acc1c574eed1fd964fbe21f20674576b6 (diff) | |
download | systemd-035af7adfe1e9c5cdef46101777a4dc9dc3d01ac.tar.gz |
test: disable ProtectHome= when collecting coverage as well
Depending on the location of the original build dir, either ProtectHome=
or ProtectSystem= may get in the way when creating the gcov metadata
files.
Follow-up to:
* 02d7e73013a92c5580023e4e548d19adbc254dbe
* 6c9efba67715cd1ced170ac46c04d47934ad276a
-rw-r--r-- | test/test-functions | 6 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/test/test-functions b/test/test-functions index 98b60d17f8..5dc773cbbc 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1117,11 +1117,11 @@ install_systemd() { mkdir "$initdir/etc/systemd/system/user@.service.d/" echo -e "[Service]\nPassEnvironment=SYSTEMD_UNIT_PATH\n" >"$initdir/etc/systemd/system/user@.service.d/override.conf" - # When built with gcov, disable ProtectSystem= in the test images, since - # it prevents gcov to write the coverage reports (*.gcda files) + # When built with gcov, disable ProtectSystem= and ProtectHome in the test + # images, since it prevents gcov to write the coverage reports (*.gcda files) if get_bool "$IS_BUILT_WITH_COVERAGE"; then mkdir -p "$initdir/etc/systemd/system/service.d/" - echo -e "[Service]\nProtectSystem=no\n" >"$initdir/etc/systemd/system/service.d/override.conf" + echo -e "[Service]\nProtectSystem=no\nProtectHome=no\n" >"$initdir/etc/systemd/system/service.d/override.conf" fi } diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index aa81017072..a5b26b102f 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -307,7 +307,10 @@ def setUpModule(): if use_valgrind or asan_options or lsan_options or ubsan_options: drop_in += ['MemoryDenyWriteExecute=no'] if with_coverage: - drop_in += ['ProtectSystem=no'] + drop_in += [ + 'ProtectSystem=no', + 'ProtectHome=no', + ] os.makedirs('/run/systemd/system/systemd-networkd.service.d', exist_ok=True) with open('/run/systemd/system/systemd-networkd.service.d/00-override.conf', mode='w') as f: @@ -335,7 +338,10 @@ def setUpModule(): if use_valgrind or asan_options or lsan_options or ubsan_options: drop_in += ['MemoryDenyWriteExecute=no'] if with_coverage: - drop_in += ['ProtectSystem=no'] + drop_in += [ + 'ProtectSystem=no', + 'ProtectHome=no', + ] os.makedirs('/run/systemd/system/systemd-resolved.service.d', exist_ok=True) with open('/run/systemd/system/systemd-resolved.service.d/00-override.conf', mode='w') as f: |