diff mbox series

[ovs-dev,08/13] tests: fixed "check meters update"

Message ID 20230627093043.1465206-9-xsimonar@redhat.com
State Accepted
Headers show
Series Fixes Multiple Unit Tests | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_ovn-kubernetes success github build: passed
ovsrobot/github-robot-_Build_and_Test fail github build: failed

Commit Message

Xavier Simonart June 27, 2023, 9:30 a.m. UTC
grep -q exit immediately with zero status if any match is found.
Hence, when executing "ovs-ofctl dump-flows br-int | grep -q meter_id=1",
ovs-ofctl might fail (with error "write to stdout failed") due to the broken pipe.

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
---
 tests/ovn.at | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index aed150563..9f6ba940b 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -33770,7 +33770,7 @@  ovn-nbctl --wait=hv ls-copp-add copp0 sw0
 check ovn-nbctl --wait=hv sync
 
 AT_CHECK([as hv1 ovs-ofctl -OOpenFlow15 dump-meters br-int | grep -q rate=10], [0])
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep -q meter_id=1], [0])
+AT_CHECK([as hv1 ovs-ofctl dump-flows br-int 2>&1 | grep -q meter_id=1], [0])
 
 # Update existing meter
 check ovn-nbctl --may-exist meter-add meter0 drop 20 pktps
@@ -33784,7 +33784,7 @@  check ovn-nbctl --log --severity=alert --meter=meter1 \
                 --name=dns acl-add sw0 to-lport 1000 'udp.dst == 53' drop
 check ovn-nbctl --wait=hv sync
 AT_CHECK([as hv1 ovs-ofctl -OOpenFlow15 dump-meters br-int | grep -q rate=30], [0])
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep -q meter_id=2], [0])
+AT_CHECK([as hv1 ovs-ofctl dump-flows br-int 2>&1 | grep -q meter_id=2], [0])
 
 # Remove meter0
 check ovn-nbctl meter-del meter0
@@ -33802,7 +33802,7 @@  check ovn-nbctl --log --severity=alert --meter=meter2 \
 check ovn-nbctl meter-add meter2 drop 100 pktps
 check ovn-nbctl --wait=hv sync
 AT_CHECK([as hv1 ovs-ofctl -OOpenFlow15 dump-meters br-int | grep -q rate=100], [0])
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep -q meter_id=1], [0])
+AT_CHECK([as hv1 ovs-ofctl dump-flows br-int 2>&1 | grep -q meter_id=1], [0])
 
 check ovn-nbctl meter-del meter2
 check ovn-nbctl --wait=hv sync