TEST-02-UNITTESTS: Pass asan environment to units if it is available

Some tests (e.g. test-udev.py) might trigger one of our NSS modules
which means LD_PRELOAD has to be configured properly.
This commit is contained in:
Daan De Meyer 2024-05-27 19:40:35 +02:00
parent aae2990907
commit 9029f20b35

View File

@ -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}