summaryrefslogtreecommitdiffstats
path: root/tests/shell/helpers/nft-valgrind-wrapper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/helpers/nft-valgrind-wrapper.sh')
-rwxr-xr-xtests/shell/helpers/nft-valgrind-wrapper.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/shell/helpers/nft-valgrind-wrapper.sh b/tests/shell/helpers/nft-valgrind-wrapper.sh
index 9da50d4d..ad8cc74b 100755
--- a/tests/shell/helpers/nft-valgrind-wrapper.sh
+++ b/tests/shell/helpers/nft-valgrind-wrapper.sh
@@ -1,6 +1,6 @@
#!/bin/bash -e
-SUFFIX="$(date '+%Y%m%d-%H%M%S.%6N')"
+SUFFIX="$(date "+%Y%m%d-%H%M%S.%6N.$$")"
rc=0
libtool \
@@ -10,8 +10,21 @@ libtool \
--trace-children=yes \
--leak-check=full \
--show-leak-kinds=all \
+ --num-callers=100 \
+ --error-exitcode=122 \
+ $NFT_TEST_VALGRIND_OPTS \
"$NFT_REAL" \
"$@" \
|| rc=$?
+if [ "$rc" -eq 122 ] ; then
+ shopt -s nullglob
+ FILES=( "$NFT_TEST_TESTTMPDIR/valgrind.$SUFFIX."*".log" )
+ shopt -u nullglob
+ (
+ printf '%s\n' "args: $*"
+ printf '%s\n' "${FILES[*]}"
+ ) >> "$NFT_TEST_TESTTMPDIR/rc-failed-valgrind"
+fi
+
exit $rc