test-execute: Load systemd-asan-env environment file if available

When DynamicUser= is enabled, we need LD_PRELOAD to be configured
correctly as the tests will load systemd's nss module which will complain
when built with sanitizers if the sanitizer libraries were not loaded
first.
This commit is contained in:
Daan De Meyer 2024-05-27 13:34:40 +02:00
parent 51e26d2366
commit f824a33a79
7 changed files with 7 additions and 0 deletions

View file

@ -8,3 +8,4 @@ Type=oneshot
AmbientCapabilities=CAP_CHOWN CAP_SETUID CAP_NET_RAW
DynamicUser=yes
PrivateUsers=yes
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env

View file

@ -10,3 +10,4 @@ Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve
RuntimeDirectoryPreserve=yes
DynamicUser=yes
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env

View file

@ -11,3 +11,4 @@ Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve
RuntimeDirectoryPreserve=yes
DynamicUser=yes
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env

View file

@ -10,3 +10,4 @@ ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve
DynamicUser=yes
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env

View file

@ -24,3 +24,4 @@ ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/t
Type=oneshot
DynamicUser=yes
StateDirectory=test-dynamicuser-migrate test-dynamicuser-migrate2/hoge
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env

View file

@ -83,3 +83,4 @@ ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/aaa:%S/aaa/bbb:%S/aaa/ccc:%S/
Type=oneshot
DynamicUser=yes
StateDirectory=waldo quux/pief aaa/bbb aaa aaa/ccc xxx/yyy:aaa/111 xxx:aaa/222 xxx/zzz:aaa/333 abc:d\:ef
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env

View file

@ -8,3 +8,4 @@ ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exi
Type=oneshot
DynamicUser=yes
SupplementaryGroups=1 2
EnvironmentFile=-/usr/lib/systemd/systemd-asan-env