]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests/shell: export NFT_TEST_BASEDIR and NFT_TEST_TMPDIR for tests
authorThomas Haller <thaller@redhat.com>
Wed, 6 Sep 2023 11:52:07 +0000 (13:52 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 7 Sep 2023 17:35:20 +0000 (19:35 +0200)
commit5da2ad76337d8709f4ae842a37fde400fa5ad5ce
tree534f524b1760c1b9dbe02273dec6ab2f7e30730c
parentefca71b22f9e4b51ea5620eeeab84e52d3410f38
tests/shell: export NFT_TEST_BASEDIR and NFT_TEST_TMPDIR for tests

Let the test wrapper prepare and export two environment variables for
the test:

- "$NFT_TEST_BASEDIR" is just the top directory where the test scripts
  lie.

- "$NFT_TEST_TMPDIR" is a `mktemp` directory created by "run-tests.sh"
  and removed at the end. Tests may use that to leave data there.
  This directory will be used for various things, like the "nft" wrapper
  in valgrind mode, the results of the tests and possibly as cache for
  feature detection.

The "$NFT_TEST_TMPDIR" was already used before with the "VALGRIND=y"
mode. It's only renamed and got an extended purpose.

Also drop the unnecessary first detection of "$DIFF" and the "$SRC_NFT"
variable.

Also, note that the mktemp creates the temporary directory under /tmp.
Which is commonly a tempfs. The user can override that by exporting
TMPDIR.

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