]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system manager
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 15 May 2023 08:06:18 +0000 (10:06 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 15 May 2023 08:06:54 +0000 (10:06 +0200)
To make additional coverage-related tweaks slightly easier.

test/test-functions

index 2a733d8b8f42153e6202e38fe21ffd8f4f66d07a..1bf9f2d54f89d38f7a15ee75a504e5c51dfbd4cd 100644 (file)
@@ -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