Skip to contentSkip to conversation

tests: monitor: use correct $nft value in EXIT trap

PATCH Applied Štěpán Němec 2 participants 3 messages Jan 27, 2021 – Jan 28, 2021 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: monitor: use correct $nft value in EXIT trap

With double quotes, $nft was being expanded to the default value even in presence of the -H option.

---
 tests/monitor/run-tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/monitor/run-tests.sh +1 -1
index 5a736fc6..1fe613c7 100755
@@ -19,7 +19,7 @@ if [ ! -d $testdir ]; then
 	echo "Failed to create test directory" >&2
 	exit 1
 fi
-trap "rm -rf $testdir; $nft flush ruleset" EXIT
+trap 'rm -rf $testdir; $nft flush ruleset' EXIT
 
 command_file=$(mktemp -p $testdir)
 output_file=$(mktemp -p $testdir)
Signature · 1 line
2.29.2
#2 lore raw
Quoted 1 line · On Wed, 27 Jan 2021 23:51:34 +0100 Phil Sutter wrote:

Applied, thanks!

Thank you, and I apologize to everyone involved for the lack of proper tag prefix in the Subject; I only realized too late I should have added the "nft".

Signature · 1 line
Štěpán