]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Allow valgrind suppressions to be used
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 22 Jan 2024 16:27:24 +0000 (18:27 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Jan 2024 19:16:47 +0000 (21:16 +0200)
This makes valgrind reports somewhat cleaner when external libraries
have memory leaks that are not straighforward to fix. In addition,
increase the number of functions to include backtraces since the default
was not large enough to cover some cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/start.sh

index 79fc05f9bb678d5835f801af5cf02907b345f20b..dc550017080adfacaee58d8e5566d29e518e1570 100755 (executable)
@@ -80,12 +80,17 @@ fi
 
 if [ "$1" = "valgrind" ]; then
     VALGRIND=y
-    VALGRIND_WPAS="valgrind --log-file=$LOGDIR/valgrind-wlan%d --leak-check=full"
-    VALGRIND_HAPD="valgrind --log-file=$LOGDIR/valgrind-hostapd --leak-check=full"
+    if [ -r "$DIR/valgrind.suppressions" ]; then
+       VALGRIND_SUPP=" --gen-suppressions=all --suppressions=$DIR/valgrind.suppressions"
+    else
+       VALGRIND_SUPP=""
+    fi
+    VALGRIND_WPAS="valgrind --log-file=$LOGDIR/valgrind-wlan%d --leak-check=full --num-callers=20$VALGRIND_SUPP"
+    VALGRIND_HAPD="valgrind --log-file=$LOGDIR/valgrind-hostapd --leak-check=full --num-callers=20$VALGRIND_SUPP"
     chmod -f a+rx $WPAS
     chmod -f a+rx $HAPD
     chmod -f a+rx $HAPD_AS
-    HAPD_AS="valgrind --log-file=$LOGDIR/valgrind-auth-serv --leak-check=full $HAPD_AS"
+    HAPD_AS="valgrind --log-file=$LOGDIR/valgrind-auth-serv --leak-check=full --num-callers=20$VALGRIND_SUPP $HAPD_AS"
     shift
 else
     unset VALGRIND