]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests: shell: don't rely on writable test directory
authorFlorian Westphal <fw@strlen.de>
Tue, 22 Oct 2024 13:26:54 +0000 (15:26 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 29 Oct 2024 20:14:51 +0000 (21:14 +0100)
commit3c469ce4db19775a970064879a36daebde5ae668
tree49d4754aafa47658a330dac404395a543de3a70e
parent68d2de3ca6c6eb18f5b32f7b4324a85c9c6c358e
tests: shell: don't rely on writable test directory

Running shell tests from a virtme-ng instance with ro mapped test dir
hangs due to runaway 'awk' reading from stdin instead of the intended
$tmpfile (variable is empty), so add quotes where needed.

0002relative_0 wants to check relative includes. It tries to create a
temporary file in the current directory, which fails as thats readonly
inside the virtme vm instance.

[ -w ! $foo ... did not catch this due to missing "".
Add quotes and return the skip retval so the test gets flagged as skipped.

0013input_descriptors_included_files_0 and 0020include_chain_0 are
switched to normal tmpfiles, there is nothing in the test that needs
relative includes.

Also, get rid of some error tests for subsequent mktemp calls for
scripts that already called 'set -e'.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/include/0002relative_0
tests/shell/testcases/include/0013input_descriptors_included_files_0
tests/shell/testcases/include/0020include_chain_0