diff mbox

[ovs-dev,v2] ovn-controller-vtep: occasional failure in "binding 1" test case

Message ID 1468588505-12841-1-git-send-email-lrichard@redhat.com
State Accepted
Headers show

Commit Message

Lance Richardson July 15, 2016, 1:15 p.m. UTC
The ovn-controller-vtep "binding 1" test case fails occasionally
due to a race with the ovs-vtep daemon.  If ovs-vtep happens to
execute handle_physical() after "ovs-vsctl del-port p0", but before
the test script has executed "vtep-ctl del-port br-vtep p0", the
latter command will fail because ovs-vtep will have already deleted
p0 from the vtep db.

Eliminate this race while adding an additional check to verify that
ovs-vtep is working as expected by waiting for ovs-vtep to remove
entries for the deleted physical ports from the vtep db.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Suggested-by: Darrell Ball <dlu998@gmail.com>
---
 tests/ovn-controller-vtep.at | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Darrell Ball July 15, 2016, 5:29 p.m. UTC | #1
On Fri, Jul 15, 2016 at 6:15 AM, Lance Richardson <lrichard@redhat.com>
wrote:

> The ovn-controller-vtep "binding 1" test case fails occasionally
> due to a race with the ovs-vtep daemon.  If ovs-vtep happens to
> execute handle_physical() after "ovs-vsctl del-port p0", but before
> the test script has executed "vtep-ctl del-port br-vtep p0", the
> latter command will fail because ovs-vtep will have already deleted
> p0 from the vtep db.
>
> Eliminate this race while adding an additional check to verify that
> ovs-vtep is working as expected by waiting for ovs-vtep to remove
> entries for the deleted physical ports from the vtep db.
>
> Signed-off-by: Lance Richardson <lrichard@redhat.com>
> Suggested-by: Darrell Ball <dlu998@gmail.com>
> ---
>  tests/ovn-controller-vtep.at | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
> index c296f0e..c978137 100644
> --- a/tests/ovn-controller-vtep.at
> +++ b/tests/ovn-controller-vtep.at
> @@ -225,8 +225,9 @@ AT_CHECK([sed -n 's/^.*\(|WARN|.*\)$/\1/p'
> ovn-controller-vtep.log | sed 's/([[-
>
>  # deletes physical ports from vtep.
>  AT_CHECK([ovs-vsctl del-port p0 -- del-port p1])
> -AT_CHECK([vtep-ctl del-port br-vtep p0 -- del-port br-vtep p1])
>  OVS_WAIT_UNTIL([test -z "`ovn-sbctl list Chassis | grep --
> br-vtep_lswitch`"])
> +OVS_WAIT_UNTIL([test -z "`vtep-ctl list physical_port p0`"])
> +OVS_WAIT_UNTIL([test -z "`vtep-ctl list physical_port p1`"])
>  # should see empty chassis column in both binding entries.
>  AT_CHECK_UNQUOTED([ovn-sbctl --columns=chassis list Port_Binding | cut -d
> ':' -f2 | tr -d ' ' | sort], [0], [dnl
>
> --
> 2.5.5
>
>
Acked-by: Darrell Ball <dlu998@gmail.com>
Russell Bryant July 15, 2016, 5:41 p.m. UTC | #2
On Fri, Jul 15, 2016 at 1:29 PM, Darrell Ball <dlu998@gmail.com> wrote:

> On Fri, Jul 15, 2016 at 6:15 AM, Lance Richardson <lrichard@redhat.com>
> wrote:
>
> > The ovn-controller-vtep "binding 1" test case fails occasionally
> > due to a race with the ovs-vtep daemon.  If ovs-vtep happens to
> > execute handle_physical() after "ovs-vsctl del-port p0", but before
> > the test script has executed "vtep-ctl del-port br-vtep p0", the
> > latter command will fail because ovs-vtep will have already deleted
> > p0 from the vtep db.
> >
> > Eliminate this race while adding an additional check to verify that
> > ovs-vtep is working as expected by waiting for ovs-vtep to remove
> > entries for the deleted physical ports from the vtep db.
> >
> > Signed-off-by: Lance Richardson <lrichard@redhat.com>
> > Suggested-by: Darrell Ball <dlu998@gmail.com>
> > ---
> >  tests/ovn-controller-vtep.at | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
> > index c296f0e..c978137 100644
> > --- a/tests/ovn-controller-vtep.at
> > +++ b/tests/ovn-controller-vtep.at
> > @@ -225,8 +225,9 @@ AT_CHECK([sed -n 's/^.*\(|WARN|.*\)$/\1/p'
> > ovn-controller-vtep.log | sed 's/([[-
> >
> >  # deletes physical ports from vtep.
> >  AT_CHECK([ovs-vsctl del-port p0 -- del-port p1])
> > -AT_CHECK([vtep-ctl del-port br-vtep p0 -- del-port br-vtep p1])
> >  OVS_WAIT_UNTIL([test -z "`ovn-sbctl list Chassis | grep --
> > br-vtep_lswitch`"])
> > +OVS_WAIT_UNTIL([test -z "`vtep-ctl list physical_port p0`"])
> > +OVS_WAIT_UNTIL([test -z "`vtep-ctl list physical_port p1`"])
> >  # should see empty chassis column in both binding entries.
> >  AT_CHECK_UNQUOTED([ovn-sbctl --columns=chassis list Port_Binding | cut
> -d
> > ':' -f2 | tr -d ' ' | sort], [0], [dnl
> >
> > --
> > 2.5.5
> >
> >
> Acked-by: Darrell Ball <dlu998@gmail.com>


Thanks!  Applied to master.
diff mbox

Patch

diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
index c296f0e..c978137 100644
--- a/tests/ovn-controller-vtep.at
+++ b/tests/ovn-controller-vtep.at
@@ -225,8 +225,9 @@  AT_CHECK([sed -n 's/^.*\(|WARN|.*\)$/\1/p' ovn-controller-vtep.log | sed 's/([[-
 
 # deletes physical ports from vtep.
 AT_CHECK([ovs-vsctl del-port p0 -- del-port p1])
-AT_CHECK([vtep-ctl del-port br-vtep p0 -- del-port br-vtep p1])
 OVS_WAIT_UNTIL([test -z "`ovn-sbctl list Chassis | grep -- br-vtep_lswitch`"])
+OVS_WAIT_UNTIL([test -z "`vtep-ctl list physical_port p0`"])
+OVS_WAIT_UNTIL([test -z "`vtep-ctl list physical_port p1`"])
 # should see empty chassis column in both binding entries.
 AT_CHECK_UNQUOTED([ovn-sbctl --columns=chassis list Port_Binding | cut -d ':' -f2 | tr -d ' ' | sort], [0], [dnl