[ovs-dev] [PATCH ovn v2] vtep tests: Fix the failing test - ovn-controller-vtep - binding 1.

numans at ovn.org numans at ovn.org
Wed Dec 2 10:36:47 UTC 2020


From: Numan Siddique <numans at ovn.org>

The below check in the test - "ovn-controller-vtep - binding 1." is
failing intermittently after the commit [1].

Before the commit[1], the check was -
  ovn-sbctl --timeout=10 wait-until Port_Binding br-vtep_lswitch0_dup chassis!='[[]]'

And after this commit, the check is -
  check ovn-sbctl wait-until Port_Binding br-vtep_lswitch0_dup chassis!='[[]]'

The above check expects 'br-vtep_lswitch0_dup' to be
claimed by the chassis, but there is already a logical
port - 'br-vtep_lswitch0' which is claimed by the same
chassis.  Both these logical ports are set with the same
options, which means out of lports - 'br-vtep_lswitch0' and
'br-vtep_lswitch0_dup', only one will be claimed.

Looking into the code, the lport to be claimed is not
deterministic.  And that's why the test succeeds sometimes.
There are 2 possibilities
  - ovn-controller-vtep releases 'br-vtep_lswitch0' and claims
'br-vtep_lswitch0_dup' or
  - ovn-controller-vtep doesn't claim 'br-vtep_lswitch0_dup' at all
    (and doesn't release 'br-vtep_lswitch0').

This patch removes the above check as we can't be sure that
'br-vtep_lswitch0_dup' will be claimed all the time.  The
test will now ensure that only one is claimed.

[1] - 5fedcce6c3e0("tests: Remove explicit timeouts from most utility invocations.")
Signed-off-by: Numan Siddique <numans at ovn.org>
---

v1 -> v2
----
  * Fixed the issue properly.
  * Updated the commit message with more details.

 tests/ovn-controller-vtep.at | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
index 8b4c180b16..cb582811fb 100644
--- a/tests/ovn-controller-vtep.at
+++ b/tests/ovn-controller-vtep.at
@@ -203,7 +203,20 @@ ${chassis_uuid}
 
 # adds another logical switch port in ovn-nb database for lswitch0.
 OVN_NB_ADD_VTEP_PORT([br-test], [br-vtep_lswitch0_dup], [br-vtep], [lswitch0])
-check ovn-sbctl wait-until Port_Binding br-vtep_lswitch0_dup chassis!='[[]]'
+
+# confirms the warning log.
+OVS_WAIT_UNTIL([
+   test -n "$(grep 'has already been associated with logical port' ovn-controller-vtep.log)"
+])
+
+OVS_WAIT_UNTIL([
+   ls0_ch=$(fetch_column Port_Binding chassis logical_port=br-vtep_lswitch0)
+   ls0_dup_ch=$(fetch_column Port_Binding chassis logical_port=br-vtep_lswitch0_dup)
+   echo "ls0_ch = $ls0_ch"
+   echo "ls0_dup_ch = $ls0_dup_ch"
+   test "$ls0_ch" != "$ls0_dup_ch"
+])
+
 # it is not allowed to have more than one ovn-nb logical port for the same
 # vtep logical switch on a vtep gateway chassis, so should still see only
 # two port_binding entries bound.
@@ -214,10 +227,6 @@ AT_CHECK_UNQUOTED([ovn-sbctl --columns=chassis list Port_Binding | cut -d ':' -f
 ${chassis_uuid}
 ${chassis_uuid}
 ])
-# confirms the warning log.
-AT_CHECK([sed -n 's/^.*\(|WARN|.*\)$/\1/p' ovn-controller-vtep.log | sed 's/([[-_0-9a-z]][[-_0-9a-z]]*)/()/g' | uniq], [0], [dnl
-|WARN|logical switch (), on vtep gateway chassis () has already been associated with logical port (), ignore logical port ()
-])
 
 # deletes physical ports from vtep.
 AT_CHECK([ovs-vsctl del-port p0 -- del-port p1])
-- 
2.28.0



More information about the dev mailing list