diff mbox series

[nft,v5,19/19] tests/shell: set TMPDIR for tests in "test-wrapper.sh"

Message ID 20230906120109.1773860-20-thaller@redhat.com
State Accepted, archived
Delegated to: Florian Westphal
Headers show
Series [nft,v5,01/19] tests/shell: rework command line parsing in "run-tests.sh" | expand

Commit Message

Thomas Haller Sept. 6, 2023, 11:52 a.m. UTC
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>
---
 tests/shell/helpers/test-wrapper.sh | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/tests/shell/helpers/test-wrapper.sh b/tests/shell/helpers/test-wrapper.sh
index e745df85a08d..43b3aa09ef26 100755
--- a/tests/shell/helpers/test-wrapper.sh
+++ b/tests/shell/helpers/test-wrapper.sh
@@ -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() {