summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-05-13 22:26:05 +0200
committerThomas Haller <thaller@redhat.com>2020-05-14 12:03:24 +0200
commit42d45299f97d90a1a8a0309e54a72df72527980a (patch)
tree929fd007a7ac7105ac1a33c9028990ffa3be6b8f
parent0a030da6c25100e6e272b8db5b2fd9601f5fc0e6 (diff)
downloadNetworkManager-42d45299f97d90a1a8a0309e54a72df72527980a.tar.gz
tests/sanitizer: make ASAN/LSAN/UBSAN options configurable in "tools/run-nm-test.sh"
Also add a suppressions file for LSAN.
-rw-r--r--Makefile.am1
-rw-r--r--lsan.suppressions0
-rwxr-xr-xtools/run-nm-test.sh13
3 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 35564aa5c5..1a2456afc6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5097,6 +5097,7 @@ EXTRA_DIST += \
src/ppp/nm-ppp-plugin.ver \
Makefile.glib \
autogen.sh \
+ lsan.suppressions \
valgrind.suppressions \
meson.build \
meson_options.txt \
diff --git a/lsan.suppressions b/lsan.suppressions
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lsan.suppressions
diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh
index 16d9d8a7ab..02fced0164 100755
--- a/tools/run-nm-test.sh
+++ b/tools/run-nm-test.sh
@@ -228,6 +228,19 @@ if [[ -n "$BUILDDIR" ]]; then
fi
fi
+export ASAN_OPTIONS="$NM_TEST_ASAN_OPTIONS"
+export LSAN_OPTIONS="$NM_TEST_LSAN_OPTIONS"
+export UBSAN_OPTIONS="$NM_TEST_UBSAN_OPTIONS"
+if [ -z "${NM_TEST_ASAN_OPTIONS+x}" ]; then
+ ASAN_OPTIONS="fast_unwind_on_malloc=false detect_leaks=1"
+fi
+if [ -z "${NM_TEST_LSAN_OPTIONS+x}" ]; then
+ LSAN_OPTIONS="suppressions=$SCRIPT_PATH/../lsan.suppressions"
+fi
+if [ -z "${NM_TEST_UBSAN_OPTIONS+x}" ]; then
+ UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1"
+fi
+
if ! _is_true "$NMTST_USE_VALGRIND" 0; then
export NM_TEST_UNDER_VALGRIND=0
exec "${NMTST_DBUS_RUN_SESSION[@]}" \