diff mbox series

[ovs-dev,v10,3/6] tests: Wait for updates in "check BFD config propagation to BFD" test.

Message ID 20210218011221.1354839-4-blp@ovn.org
State Superseded
Headers show
Series Add DDlog implementation of ovn-northd | expand

Commit Message

Ben Pfaff Feb. 18, 2021, 1:12 a.m. UTC
Otherwise this test is racy because it assumes that northd finishes
its updates between the ovn-nbctl changes and the subsequent checks.

Also, simplify some series of "check_column" into single
"check_row_count" calls (that then become "wait_row_count").

Signed-off-by: Ben Pfaff <blp@ovn.org>
 tests/ovn-northd.at | 44 ++++++++++++++------------------------------
 1 file changed, 14 insertions(+), 30 deletions(-)
diff mbox series


diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index e4fceff037a8..1a941efe9b5c 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -2463,55 +2463,39 @@  ovn-nbctl create bfd logical_port=r0-sw2 dst_ip= status=down min_tx=
 ovn-nbctl create bfd logical_port=r0-sw3 dst_ip= status=down
 ovn-nbctl create bfd logical_port=r0-sw4 dst_ip= status=down min_tx=0 detect_mult=0
-check_column 10 bfd detect_mult logical_port=r0-sw1
-check_column "" bfd dst_ip logical_port=r0-sw1
-check_column 250 bfd min_rx logical_port=r0-sw1
-check_column 250 bfd min_tx logical_port=r0-sw1
-check_column admin_down bfd status logical_port=r0-sw1
-check_column 20 bfd detect_mult logical_port=r0-sw2
-check_column "" bfd dst_ip logical_port=r0-sw2
-check_column 500 bfd min_rx logical_port=r0-sw2
-check_column 500 bfd min_tx logical_port=r0-sw2
-check_column admin_down bfd status logical_port=r0-sw2
-check_column 5 bfd detect_mult logical_port=r0-sw3
-check_column "" bfd dst_ip logical_port=r0-sw3
-check_column 1000 bfd min_rx logical_port=r0-sw3
-check_column 1000 bfd min_tx logical_port=r0-sw3
-check_column admin_down bfd status logical_port=r0-sw3
+wait_row_count bfd 1 logical_port=r0-sw1 detect_mult=10 dst_ip= \
+                     min_rx=250 min_tx=250 status=admin_down
+wait_row_count bfd 1 logical_port=r0-sw2 detect_mult=20 dst_ip= \
+                     min_rx=500 min_tx=500 status=admin_down
+wait_row_count bfd 1 logical_port=r0-sw3 detect_mult=5 dst_ip= \
+                     min_rx=1000 min_tx=1000 status=admin_down
 uuid=$(fetch_column nb:bfd _uuid logical_port=r0-sw1)
-check ovn-nbctl set bfd $uuid min_tx=1000
-check ovn-nbctl set bfd $uuid min_rx=1000
-check ovn-nbctl set bfd $uuid detect_mult=100
+check ovn-nbctl set bfd $uuid min_tx=1000 min_rx=1000 detect_mult=100
 uuid_2=$(fetch_column nb:bfd _uuid logical_port=r0-sw2)
 check ovn-nbctl clear bfd $uuid_2 min_rx
-check_column 1000 bfd min_rx logical_port=r0-sw2
-check_column 1000 bfd min_tx logical_port=r0-sw1
-check_column 1000 bfd min_rx logical_port=r0-sw1
-check_column 100 bfd detect_mult logical_port=r0-sw1
+wait_row_count bfd 1 logical_port=r0-sw2 min_rx=1000
+wait_row_count bfd 1 logical_port=r0-sw1 min_rx=1000 min_tx=1000 detect_mult=100
 check ovn-nbctl --bfd=$uuid lr-route-add r0
-check_column down bfd status logical_port=r0-sw1
+wait_column down bfd status logical_port=r0-sw1
 AT_CHECK([ovn-nbctl lr-route-list r0 | grep | grep -q bfd],[0])
 check ovn-nbctl --bfd lr-route-add r0
-check_column down bfd status logical_port=r0-sw2
+wait_column down bfd status logical_port=r0-sw2
 AT_CHECK([ovn-nbctl lr-route-list r0 | grep | grep -q bfd],[0])
 check ovn-nbctl --bfd lr-route-add r0 r0-sw5
-check_column down bfd status logical_port=r0-sw5
+wait_column down bfd status logical_port=r0-sw5
 AT_CHECK([ovn-nbctl lr-route-list r0 | grep | grep -q bfd],[0])
 route_uuid=$(fetch_column nb:logical_router_static_route _uuid ip_prefix="")
 check ovn-nbctl clear logical_router_static_route $route_uuid bfd
-check_column admin_down bfd status logical_port=r0-sw1
+wait_column admin_down bfd status logical_port=r0-sw1
 ovn-nbctl destroy bfd $uuid
-check_row_count bfd 3
+wait_row_count bfd 3