]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: pass on ASAN/UBSAN options to several tests 3797/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Mon, 12 Apr 2021 01:41:27 +0000 (01:41 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Mon, 12 Apr 2021 02:21:07 +0000 (02:21 +0000)
to make it easier to run them under ASan/UBSan.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
src/tests/lxc-test-apparmor-mount
src/tests/lxc-test-unpriv
src/tests/lxc-test-usernic.in
src/tests/lxc-test-usernsexec

index d21c948223ff1be240c5297eee469ce30c065611..5b720d096fa5bd1d26d263c39edf4343e65cea86 100755 (executable)
@@ -48,7 +48,8 @@ FAIL() {
 run_cmd() {
        sudo -i -u $TUSER \
            env http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} \
-               XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) $*
+               XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) ASAN_OPTIONS=${ASAN_OPTIONS:-} \
+               UBSAN_OPTIONS=${UBSAN_OPTIONS:-} $*
 }
 
 DONE=0
index 3615b83417144ee3d1d4de40f35ea2f1c5e31d70..eff54ed14e86f44a1713f7536dc65cc260d673d0 100755 (executable)
@@ -94,7 +94,8 @@ cleanup() {
 run_cmd() {
        sudo -i -u $TUSER \
            env http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} \
-               XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) $*
+               XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) ASAN_OPTIONS=${ASAN_OPTIONS:-} \
+               UBSAN_OPTIONS=${UBSAN_OPTIONS:-} $*
 }
 
 # create a test user
index 3e35008c6a8fc83f19d50557c17fbda808fefd96..3fb4e9e5e4fbc8ec9da6cd22834cff90502ae483 100755 (executable)
@@ -60,7 +60,8 @@ cleanup() {
 run_cmd() {
        sudo -i -u usernic-user \
            env http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} \
-               XDG_RUNTIME_DIR=/run/user/$(id -u usernic-user) $*
+               XDG_RUNTIME_DIR=/run/user/$(id -u usernic-user) ASAN_OPTIONS=${ASAN_OPTIONS:-} \
+               UBSAN_OPTIONS=${UBSAN_OPTIONS:-} $*
 }
 
 ARCH=i386
index 0ee48b353734aa6738230fdd2f8959ed38dc33c2..d1fc81a58b1a8873a587c58ec6fb0d0dd78a0f4c 100755 (executable)
@@ -292,7 +292,7 @@ setup_and_run() {
     fi
 
     debug 0 "as $asuser executing ${MYPATH} ${pt_args[*]}"
-    sudo -Hu "$asuser" "${MYPATH}" "${pt_args[@]}"
+    sudo -Hu "$asuser" ASAN_OPTIONS=${ASAN_OPTIONS:-} UBSAN_OPTIONS=${UBSAN_OPTIONS:-} "${MYPATH}" "${pt_args[@]}"
 }
 
 USERNSEXEC=${USERNSEXEC:-lxc-usernsexec}