tests: Allow valgrind suppressions to be used

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>
This commit is contained in:
Jouni Malinen 2024-01-22 18:27:24 +02:00 committed by Jouni Malinen
parent 456bfec470
commit f873abd0d9

View file

@ -80,12 +80,17 @@ fi
if [ "$1" = "valgrind" ]; then if [ "$1" = "valgrind" ]; then
VALGRIND=y VALGRIND=y
VALGRIND_WPAS="valgrind --log-file=$LOGDIR/valgrind-wlan%d --leak-check=full" if [ -r "$DIR/valgrind.suppressions" ]; then
VALGRIND_HAPD="valgrind --log-file=$LOGDIR/valgrind-hostapd --leak-check=full" 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 $WPAS
chmod -f a+rx $HAPD chmod -f a+rx $HAPD
chmod -f a+rx $HAPD_AS 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 shift
else else
unset VALGRIND unset VALGRIND