Skip to contentSkip to conversation

tests: monitor: Hide temporary file names from error output

PATCH New Phil Sutter 1 participant 1 message Apr 8, 2022 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 tests: monitor: Hide temporary file names from error output

Make error output deterministic by passing input to nft via stdin. This way error messages will contain "/dev/stdin" instead of the temporary file name.

---
 tests/monitor/run-tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/monitor/run-tests.sh +2 -2
index ff00450b19c23..b5ca47d9838e4 100755
@@ -74,7 +74,7 @@ monitor_run_test() {
 		echo "command file:"
 		cat $command_file
 	}
-	$nft -f $command_file || {
+	$nft -f - <$command_file || {
 		err "nft command failed!"
 		rc=1
 	}
@@ -103,7 +103,7 @@ echo_run_test() {
 		echo "command file:"
 		cat $command_file
 	}
-	$nft -nn -e -f $command_file >$echo_output || {
+	$nft -nn -e -f - <$command_file >$echo_output || {
 		err "nft command failed!"
 		rc=1
 	}
Signature · 1 line
2.34.1