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 | fa004c7270e8638fc9c52e2fce57b6fd22e47cd0 (patch) | |
tree | a5c2c213aec071b19b260ca8ffaf843b71a6ad36 | |
parent | fb7ca895d13d826461a509d7d7ad50f4a4462eb3 (diff) | |
download | openvswitch-fa004c7270e8638fc9c52e2fce57b6fd22e47cd0.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 ef8e2147b..bf22aee0f 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at @@ -6,8 +6,8 @@ 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/ ' } @@ -15,7 +15,7 @@ strip_xout () { sed ' s/mega_ufid:[-0-9a-f]* // 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/ @@ -26,7 +26,7 @@ strip_xout_keep_actions () { sed ' s/mega_ufid:[-0-9a-f]* // 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 @@ -51,7 +51,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,/ ']]) |