]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: set TMPDIR for tests in "test-wrapper.sh"
authorThomas Haller <thaller@redhat.com>
Wed, 6 Sep 2023 11:52:22 +0000 (13:52 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 7 Sep 2023 17:35:21 +0000 (19:35 +0200)
Various tests create additional temporary files. They really should just
use "$NFT_TEST_TESTTMPDIR" for that. However, they mostly use `mktemp`.

The scripts are supposed to cleanup those files afterwards. However,
often that does not work correctly and /tmp gets full of left over
temporary files.

Export "TMPDIR" so that they use the test-specific temporary directory.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/helpers/test-wrapper.sh

index e745df85a08dc17d754791b9abe94d5ba0cdebc6..43b3aa09ef260afc1d76622c2e7b985329fa90d5 100755 (executable)
@@ -11,6 +11,8 @@ TESTDIR="$(dirname "$TEST")"
 
 START_TIME="$(cut -d ' ' -f1 /proc/uptime)"
 
+export TMPDIR="$NFT_TEST_TESTTMPDIR"
+
 CLEANUP_UMOUNT_RUN_NETNS=n
 
 cleanup() {