]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: Extend debug output a bit
authorPhil Sutter <phil@nwl.cc>
Wed, 3 Sep 2025 13:46:45 +0000 (15:46 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 4 Sep 2025 15:07:18 +0000 (17:07 +0200)
Dump echo output and output file, surrounded by markers to highlight
empty files and extra newlines.

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

index 38c20adb1dc616a1188fb85206d1e4f433e6b178..b09b72ae034cb0e2b2dec41920ecdea1eaf1867f 100755 (executable)
@@ -101,8 +101,9 @@ echo_run_test() {
        local rc=0
 
        $debug && {
-               echo "command file:"
+               echo ">>> command file"
                cat $command_file
+               echo "<<< command file"
        }
        $nft $echo_args -f - <$command_file >$echo_output || {
                err "nft command failed!"
@@ -122,6 +123,15 @@ echo_run_test() {
                done >$output_file
                [ $i -gt 0 ] && echo "" >>$output_file
        fi
+       $debug && {
+               echo ">>> output file"
+               cat $output_file
+               echo "<<< output file"
+               echo ">>> echo output"
+               cat $echo_output
+               echo "<<< echo output"
+       }
+
        mydiff -q $echo_output $output_file >/dev/null 2>&1
        if [[ $rc == 0 && $? != 0 ]]; then
                err "echo output differs!"