From 786f6d81f7b70dd313711bcb9e285ecea516eadd Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 15 May 2023 10:06:18 +0200 Subject: [PATCH] test: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system manager To make additional coverage-related tweaks slightly easier. --- test/test-functions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test-functions b/test/test-functions index 2a733d8b8f..1bf9f2d54f 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1256,6 +1256,11 @@ install_systemd() { # the systemd-nspawn@.service unit. cp "$initdir/usr/lib/systemd/system/systemd-nspawn@.service" "$initdir/etc/systemd/system/systemd-nspawn@.service" sed -ri "s/^ExecStart=.+$/& --bind=${BUILD_DIR//\//\\\/}/" "$initdir/etc/systemd/system/systemd-nspawn@.service" + # Pass the $BUILD_DIR as $COVERAGE_BUILD_DIR env variable to the system + # manager, similarly to what we do with $ASAN_RT_PATH during sanitized + # builds + mkdir -p "$initdir/etc/systemd/system.conf.d/" + echo -ne "[Manager]\nDefaultEnvironment=COVERAGE_BUILD_DIR=$BUILD_DIR\n" >"$initdir/etc/systemd/system.conf.d/99-COVERAGE_BUILD_DIR.conf" fi # If we're built with -Dportabled=false, tests with systemd-analyze