summaryrefslogtreecommitdiffstats
path: root/tests/shell/helpers/nft-valgrind-wrapper.sh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-08 16:25:31 +0200
committerFlorian Westphal <fw@strlen.de>2023-09-09 16:32:52 +0200
commit01b63ac8c2f4d421ecfa62dc8e6403015a7ea34a (patch)
tree3ad2eaa561562208bab18895b80f9e3230beae55 /tests/shell/helpers/nft-valgrind-wrapper.sh
parent2503bf89b00b8bb0469af1a6e147841807c47af7 (diff)
tests/shell: set valgrind's "--vgdb-prefix=" to orignal TMPDIR
"test-wrapper.sh" sets TMPDIR="$NFT_TEST_TESTTMPDIR". That is useful, so that temporary files of the tests are placed inside the test result data. Sometimes tests miss to delete those files, which would result in piling up /tmp/tmp.XXXXXXXXXX files. By setting $TMPDIR, those files are clearly related to the test run that created them, and can be deleted together. However, valgrind likes to create files like "vgdb-pipe-from-vgdb-to-68-by-thom-on-???" inside $TMPDIR. These are pipes, so if you run `grep -R ^ /tmp/nft-test.latest` while the test is still running (to inspect the results), then the process hands reading from the pipe. Instead, tell valgrind to put those files in the original TMPDIR. For that purpose, export NFT_TEST_TMPDIR_ORIG from "run-tests.sh". Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/helpers/nft-valgrind-wrapper.sh')
-rwxr-xr-xtests/shell/helpers/nft-valgrind-wrapper.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/shell/helpers/nft-valgrind-wrapper.sh b/tests/shell/helpers/nft-valgrind-wrapper.sh
index ad8cc74b..6125dd0f 100755
--- a/tests/shell/helpers/nft-valgrind-wrapper.sh
+++ b/tests/shell/helpers/nft-valgrind-wrapper.sh
@@ -12,6 +12,7 @@ libtool \
--show-leak-kinds=all \
--num-callers=100 \
--error-exitcode=122 \
+ --vgdb-prefix="$NFT_TEST_TMPDIR_ORIG/vgdb-pipe-nft-test-$SUFFIX" \
$NFT_TEST_VALGRIND_OPTS \
"$NFT_REAL" \
"$@" \