Skip to content

Commit

Permalink
tests: fixed "check meters update"
Browse files Browse the repository at this point in the history
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>
Acked-by: Ales Musil <amusil@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit 3869f2e)
  • Loading branch information
simonartxavier authored and dceara committed Jul 5, 2023
1 parent 74922b9 commit 15274d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/ovn.at
Expand Up @@ -30510,7 +30510,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
Expand All @@ -30524,7 +30524,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
Expand All @@ -30542,7 +30542,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
AT_CHECK([as hv1 ovs-ofctl -OOpenFlow15 dump-meters br-int | grep -q rate=100], [1])
Expand Down

0 comments on commit 15274d8

Please sign in to comment.