From 9c1474a97da3d7f0d71c61c85e0a8fc77c9577a7 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 3 Sep 2025 15:46:45 +0200 Subject: [PATCH] tests: monitor: Extend debug output a bit Dump echo output and output file, surrounded by markers to highlight empty files and extra newlines. Signed-off-by: Phil Sutter --- tests/monitor/run-tests.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/monitor/run-tests.sh b/tests/monitor/run-tests.sh index 38c20adb..b09b72ae 100755 --- a/tests/monitor/run-tests.sh +++ b/tests/monitor/run-tests.sh @@ -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!" -- 2.47.3