Skip to content

Commit

Permalink
tests: Use stricter IP match for FORMAT_CT.
Browse files Browse the repository at this point in the history
The match used in FORMAT_CT matched on "dst=$1". The problem is that
if you passed in an IP address like "10.0.0.1", then this could match on
"10.0.0.1" and "10.0.0.100" for instance. This can allow for unexpected
entries to show up in the output, causing test failures.

With this change, the match is changed to "dst=$1,", which ensures an
exact match on the IP address passed in.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Ales Musil <amusil@redhat.com>
  • Loading branch information
putnopvut committed May 19, 2023
1 parent 939f054 commit 0c023fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/system-common-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ m4_define([STRIP_MONITOR_CSUM], [grep "csum:" | sed 's/csum:.*/csum: <skip>/'])
# and limit the output to the rows containing 'ip-addr'.
#
m4_define([FORMAT_CT],
[[grep -F "dst=$1" | sed -e 's/port=[0-9]*/port=<cleared>/g' -e 's/id=[0-9]*/id=<cleared>/g' -e 's/state=[0-9_A-Z]*/state=<cleared>/g' | sort | uniq]])
[[grep -F "dst=$1," | sed -e 's/port=[0-9]*/port=<cleared>/g' -e 's/id=[0-9]*/id=<cleared>/g' -e 's/state=[0-9_A-Z]*/state=<cleared>/g' | sort | uniq]])

# NETNS_DAEMONIZE([namespace], [command], [pidfile])
#
Expand Down

0 comments on commit 0c023fa

Please sign in to comment.