summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-09-08 10:08:20 -0700
committerBen Pfaff <blp@ovn.org>2016-10-07 08:30:54 -0700
commit093aa761fac5703f091b8250585cf6f68343aa80 (patch)
tree264e08967cfcb5b186e02f391dd2f4a5932d0a49 /tests
parent62f0430e903ad29bdde17bd8e8aa814198fac890 (diff)
downloadopenvswitch-093aa761fac5703f091b8250585cf6f68343aa80.tar.gz
ovn: Fix races in MAC_Binding deletion test.
The test assumed that ovn-northd could delete the MAC_Binding rows instantly, but it may take a while. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/ovn.at9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/ovn.at b/tests/ovn.at
index 8be774ed6..b2553c1ec 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -5115,15 +5115,14 @@ dp_uuid=`ovn-sbctl find datapath | grep uuid | cut -f2 -d ":" | cut -f2 -d " "`
ovn-sbctl create MAC_Binding ip=10.0.0.1 datapath=$dp_uuid logical_port=lp0 mac="mac1"
ovn-sbctl create MAC_Binding ip=10.0.0.1 datapath=$dp_uuid logical_port=lp1 mac="mac2"
ovn-sbctl find MAC_Binding
-#Delete port lp0
+# Delete port lp0 and check that its MAC_Binding is deleted.
ovn-nbctl lsp-del lp0
ovn-sbctl find MAC_Binding
-AT_CHECK([ovn-sbctl find MAC_Binding logical_port=lp0], [0], [])
-#Delete ls0. This will verify that the mac_bindings are cleaned up when a
-#datapath is deleted without explicitly removing the the logical ports
+OVS_WAIT_UNTIL([test `ovn-sbctl find MAC_Binding logical_port=lp0 | wc -l` = 0])
+# Delete logical switch ls0 and check that its MAC_Binding is deleted.
ovn-nbctl ls-del ls0
ovn-sbctl find MAC_Binding
-AT_CHECK([ovn-sbctl find MAC_Binding], [0], [])
+OVS_WAIT_UNTIL([test `ovn-sbctl find MAC_Binding | wc -l` = 0])
OVN_CLEANUP([hv1])