]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-02-UNITTESTS: Pass asan environment to units if it is available
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 May 2024 17:40:35 +0000 (19:40 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 30 May 2024 10:47:45 +0000 (12:47 +0200)
Some tests (e.g. test-udev.py) might trigger one of our NSS modules
which means LD_PRELOAD has to be configured properly.

test/units/TEST-02-UNITTESTS.sh

index aac55ea17ceab0cbe73409f838de1d22206b6267..63924251300d2c37f13c1e06ccb4698f85500c53 100755 (executable)
@@ -55,7 +55,13 @@ run_test() {
             ;;
     esac
 
-    systemd-run --quiet --property Delegate=1 --property "Environment=$environment" --unit="$name" --wait "$test" && ret=0 || ret=$?
+    systemd-run \
+        --quiet \
+        --property Delegate=1 \
+        --property EnvironmentFile=-/usr/lib/systemd/systemd-asan-env \
+        --property "Environment=$environment" \
+        --unit="$name" \
+        --wait "$test" && ret=0 || ret=$?
 
     exec {LOCK_FD}> /lock
     flock --exclusive ${LOCK_FD}