]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: Fix regex collecting expected echo output
authorPhil Sutter <phil@nwl.cc>
Wed, 3 Sep 2025 13:23:12 +0000 (15:23 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 4 Sep 2025 15:07:18 +0000 (17:07 +0200)
No input triggered this bug, but the match would accept "insert" and
"replace" keywords anywhere in the line not just at the beginning as was
intended.

Fixes: b2506e5504fed ("tests: Merge monitor and echo test suites")
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/monitor/run-tests.sh

index 03091d17452121d0ff2a6ec30d6a9fedbaac768a..4cbdee587f47c40f10bf31f8b3b1cf8d3cd214df 100755 (executable)
@@ -52,7 +52,7 @@ echo_output_append() {
                grep '^\(add\|replace\|insert\)' $command_file >>$output_file
                return
        }
-       [[ "$*" =~ ^add|replace|insert ]] && echo "$*" >>$output_file
+       [[ "$*" =~ ^(add|replace|insert) ]] && echo "$*" >>$output_file
 }
 json_output_filter() { # (filename)
        # unify handle values