Several of the ovn tests did not use the `--wait` flag to to wait for a
configuration change to propagate through the system. As a result,
these tests fail when `ovn-northd` is slow.

Fixed by adding `--wait=hv` or `--wait=sb` as appropriate.

Signed-off-by: Leonid Ryzhyk <[email protected]>
---
tests/ovn-northd.at |  8 ++++----
tests/ovn.at        | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 9588c76c9..62e58fd0e 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -204,7 +204,7 @@ AT_SKIP_IF([test $HAVE_PYTHON = no])
 ovn_start

 ovn-nbctl ls-add S1
-ovn-nbctl lsp-add S1 S1-vm1
+ovn-nbctl --wait=sb lsp-add S1 S1-vm1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-vm1` = xdown])

 ovn-sbctl chassis-add hv1 geneve 127.0.0.1
@@ -224,7 +224,7 @@ ovn-nbctl ls-add S1
 ovn-nbctl lsp-add S1 S1-R1
 ovn-nbctl lsp-set-type S1-R1 router
 ovn-nbctl lsp-set-addresses S1-R1 02:ac:10:01:00:01
-ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1
+ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])

 AT_CLEANUP
@@ -242,7 +242,7 @@ ovn-nbctl ls-add S1
 ovn-nbctl lsp-add S1 S1-R1
 ovn-nbctl lsp-set-type S1-R1 router
 ovn-nbctl lsp-set-addresses S1-R1 02:ac:10:01:00:01
-ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1
+ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1

 ovn-sbctl lsp-bind S1-R1 gw1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
@@ -263,7 +263,7 @@ ovn-nbctl ls-add S1
 ovn-nbctl lsp-add S1 S1-R1
 ovn-nbctl lsp-set-type S1-R1 router
 ovn-nbctl lsp-set-addresses S1-R1 router
-ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1
+ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])

 AT_CLEANUP
diff --git a/tests/ovn.at b/tests/ovn.at
index 592f491fd..34dba4edf 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1689,7 +1689,7 @@ for i in 1 2; do
         ovn-nbctl lsp-add lsw0 lp$i$j
         ip_addrs="192.168.0.$i$j"
         ovn-nbctl lsp-set-addresses lp$i$j "f0:00:00:00:00:$i$j $ip_addrs"
-        ovn-nbctl lsp-set-port-security lp$i$j f0:00:00:00:00:$i$j
+        ovn-nbctl --wait=hv lsp-set-port-security lp$i$j
f0:00:00:00:00:$i$j
     done
 done

@@ -7161,7 +7161,7 @@ ovn-nbctl acl-add lsw0 to-lport 1000 'tcp.dst==84'
allow-related
 ovn-nbctl --log acl-add lsw0 to-lport 1000 'tcp.dst==85' allow-related

 ovn-nbctl acl-add lsw0 to-lport 1000 'tcp.dst==86' reject
-ovn-nbctl --log --severity=alert --name=reject-flow acl-add lsw0 to-lport
1000 'tcp.dst==87' reject
+ovn-nbctl --wait=hv --log --severity=alert --name=reject-flow acl-add lsw0
to-lport 1000 'tcp.dst==87' reject

 ovn-sbctl dump-flows

@@ -7268,7 +7268,7 @@ ovn-nbctl --log --severity=alert --meter=http-rl2
--name=http-acl2 acl-add lsw0

 # Add an ACL that doesn't rate-limit logs.
 ovn-nbctl --log --severity=alert --name=http-acl3 acl-add lsw0 to-lport
1000 'tcp.dst==82' drop
-
+ovn-nbctl --wait=hv sync

 # For each ACL, send 100 packets.
 for i in `seq 1 100`; do
@@ -12058,7 +12058,7 @@ AT_CHECK([ovn-sbctl get Address_Set pg2_ip6
addresses],
          [0], [[["2001:db8:2::ff:fe00:2", "2001:db8:3::ff:fe00:3"]]
 ])

-ovn-nbctl set Logical_Switch ls1 \
+ovn-nbctl --wait=sb set Logical_Switch ls1 \
     other_config:subnet=10.11.0.0/24
other_config:ipv6_prefix="2001:db8:11::"

 dnl Check if updated address got propagated to the port group address sets
@@ -13370,7 +13370,7 @@ ovn-nbctl lsp-set-addresses sw1-p5 "unknown"
 ovn-nbctl list logical_switch_port

 # Now try to add duplicate addresses on a new port. These should all fail
-ovn-nbctl lsp-add sw1 sw1-p5
+ovn-nbctl --wait=sb lsp-add sw1 sw1-p5
 AT_CHECK([ovn-nbctl lsp-set-addresses sw1-p5 "00:00:00:00:00:04
10.0.0.1"], [1], [],
 [ovn-nbctl: Error on switch sw1: duplicate IPv4 address 10.0.0.1
 ])
@@ -13829,7 +13829,7 @@ AT_CHECK([ovn-nbctl get Logical-Switch-Port p0
dynamic_addresses], [0],
     ["0a:00:00:a8:01:03 192.168.1.2"
 ])

-ovn-nbctl lsp-set-addresses p0 router
+ovn-nbctl --wait=sb lsp-set-addresses p0 router

 ovn-nbctl get Logical-Switch-Port p0 dynamic_addresses
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to