]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: Hide temporary file names from error output
authorPhil Sutter <phil@nwl.cc>
Wed, 6 Apr 2022 13:41:03 +0000 (15:41 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 8 Apr 2022 14:21:20 +0000 (16:21 +0200)
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.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/monitor/run-tests.sh

index ff00450b19c231562424d4375fd906b739fa6add..b5ca47d9838e49cf1203c01e0b290238c83c7469 100755 (executable)
@@ -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
        }