diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2022-10-06 21:37:24 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-10-25 23:26:07 +0200 |
commit | cd35f38ccaecfc9d54fc25863fe81c418d3d6c4c (patch) | |
tree | 2164ac2889580648b74cce4e1c9e1acb3bee6c9a | |
parent | 730ab63adb0030e70227fa684caf099e079a7ba6 (diff) | |
download | openvswitch-cd35f38ccaecfc9d54fc25863fe81c418d3d6c4c.tar.gz |
tests: Fix filtering of whole-second durations.
Current macros are unable to filter whole seconds, e.g. 'duration:6s'.
This is causing random test failures, most frequently in CirrusCI:
./dpif-netdev.at:370: ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers
--- -
+++ /tmp/cirrus-ci-build/tests/testsuite.dir/at-groups/990/stdout
@@ -1,5 +1,5 @@
OFPST_METER reply (OF1.3) (xid=0x2):
-meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands:
+meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:6s bands:
Fix sed matches to correctly handle that scenario.
Repeating the [0-9\.] twice because it is hard to write a shorter
portable version with sed.
Acked-by: Mike Pattrick <mkp@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | tests/dpif-netdev.at | 10 | ||||
-rw-r--r-- | tests/stp.at | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at index 1ec0054c5..a84cfa177 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at @@ -6,15 +6,15 @@ m4_divert_push([PREPARE_TESTS]) # that vary from one run to another (e.g., timing and bond actions). strip_timers () { sed ' - s/duration:[0-9]*\.[0-9]*/duration:0.0/ - s/used:[0-9]*\.[0-9]*/used:0.0/ + s/duration:[0-9\.][0-9\.]*/duration:0.0/ + s/used:[0-9\.][0-9\.]*/used:0.0/ ' } strip_xout () { sed ' s/ufid:[-0-9a-f]* // - s/used:[0-9]*\.[0-9]*/used:0.0/ + s/used:[0-9\.][0-9\.]*/used:0.0/ s/actions:.*/actions: <del>/ s/packets:[0-9]*/packets:0/ s/bytes:[0-9]*/bytes:0/ @@ -24,7 +24,7 @@ strip_xout () { strip_xout_keep_actions () { sed ' s/ufid:[-0-9a-f]* // - s/used:[0-9]*\.[0-9]*/used:0.0/ + s/used:[0-9\.][0-9\.]*/used:0.0/ s/packets:[0-9]*/packets:0/ s/bytes:[0-9]*/bytes:0/ ' | sort @@ -49,7 +49,7 @@ filter_hw_packet_netdev_dummy () { filter_flow_dump () { grep 'flow_dump ' | sed ' s/.*flow_dump // - s/used:[0-9]*\.[0-9]*/used:0.0/ + s/used:[0-9\.][0-9\.]*/used:0.0/ ' | sort | uniq } diff --git a/tests/stp.at b/tests/stp.at index 7ddacfc3a..69475843e 100644 --- a/tests/stp.at +++ b/tests/stp.at @@ -368,7 +368,7 @@ AT_CLEANUP # Strips out uninteresting parts of flow output, as well as parts # that vary from one run to another (e.g., timing and bond actions). m4_define([STRIP_USED], [[sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ + s/used:[0-9\.][0-9\.]*/used:0.0/ s/duration=[0-9.]*s*/duration=Xs/ s/idle_age=[0-9]*,/idle_age=X,/ ']]) |