[ovs-dev] [PATCH 1/4] ovn: make ipam tests more reliable

nickcooper-zhangtonghao nickcooper-zhangtonghao at opencloud.tech
Wed Oct 5 11:20:42 UTC 2016


Fixes: 8639f9be("ovn-northd, tests: Adding IPAM to ovn-northd.")
The IPAM tests began to fail occasionally. Adding --wait=sb
to commands triggering address allocation eliminated these failures.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao at opencloud.tech>
---
 tests/ovn.at | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/ovn.at b/tests/ovn.at
index 2b193dd..73f1694 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -4543,8 +4543,8 @@ ovn_start
 # Add a port to a switch that does not have a subnet set, then set the
 # subnet which should result in an address being allocated for the port.
 ovn-nbctl ls-add sw0
-ovn-nbctl lsp-add sw0 p0 -- lsp-set-addresses p0 dynamic
-ovn-nbctl add Logical-Switch sw0 other_config subnet=192.168.1.0/24
+ovn-nbctl --wait=sb lsp-add sw0 p0 -- lsp-set-addresses p0 dynamic
+ovn-nbctl --wait=sb add Logical-Switch sw0 other_config subnet=192.168.1.0/24
 AT_CHECK([ovn-nbctl get Logical-Switch-Port p0 dynamic_addresses], [0],
     ["0a:00:00:00:00:01 192.168.1.2"
 ])
@@ -4584,7 +4584,7 @@ AT_CHECK([ovn-nbctl get Logical-Switch-Port p9 dynamic_addresses], [0],
 # Trying similar tests with a second switch. MAC addresses should be unique
 # across both switches but IP's only need to be unique within the same switch.
 ovn-nbctl ls-add sw1
-ovn-nbctl lsp-add sw1 p10 -- lsp-set-addresses p10 dynamic
+ovn-nbctl --wait=sb lsp-add sw1 p10 -- lsp-set-addresses p10 dynamic
 ovn-nbctl --wait=sb add Logical-Switch sw1 other_config subnet=192.168.1.0/24
 AT_CHECK([ovn-nbctl get Logical-Switch-Port p10 dynamic_addresses], [0],
      ["0a:00:00:00:00:0b 192.168.1.2"
@@ -4700,8 +4700,8 @@ ovn_start
 ovn-nbctl lr-add R1
 
 # Test for a ping using dynamically allocated addresses.
-ovn-nbctl ls-add foo -- add Logical_Switch foo other_config subnet=192.168.1.0/24
-ovn-nbctl ls-add alice -- add Logical_Switch alice other_config subnet=192.168.2.0/24
+ovn-nbctl --wait=sb ls-add foo -- add Logical_Switch foo other_config subnet=192.168.1.0/24
+ovn-nbctl --wait=sb ls-add alice -- add Logical_Switch alice other_config subnet=192.168.2.0/24
 
 # Connect foo to R1
 ovn-nbctl lrp-add R1 foo 00:00:00:01:02:03 192.168.1.1/24
@@ -4714,21 +4714,21 @@ ovn-nbctl lsp-add alice rp-alice -- set Logical_Switch_Port rp-alice type=router
           options:router-port=alice addresses=\"00:00:00:01:02:04\"
 
 # Create logical port foo1 in foo
-ovn-nbctl lsp-add foo foo1 \
+ovn-nbctl --wait=sb lsp-add foo foo1 \
 -- lsp-set-addresses foo1 "dynamic"
 AT_CHECK([ovn-nbctl get Logical-Switch-Port foo1 dynamic_addresses], [0],
      ["0a:00:00:00:00:01 192.168.1.2"
 ])
 
 # Create logical port alice1 in alice
-ovn-nbctl lsp-add alice alice1 \
+ovn-nbctl --wait=sb lsp-add alice alice1 \
 -- lsp-set-addresses alice1 "dynamic"
 AT_CHECK([ovn-nbctl get Logical-Switch-Port alice1 dynamic_addresses], [0],
      ["0a:00:00:00:00:02 192.168.2.2"
 ])
 
 # Create logical port foo2 in foo
-ovn-nbctl lsp-add foo foo2 \
+ovn-nbctl --wait=sb lsp-add foo foo2 \
 -- lsp-set-addresses foo2 "dynamic"
 AT_CHECK([ovn-nbctl get Logical-Switch-Port foo2 dynamic_addresses], [0],
      ["0a:00:00:00:00:03 192.168.1.3"
-- 
1.8.3.1






More information about the dev mailing list