diff mbox

[ovs-dev,3/7] ovn: Fix some races in IPAM connectivity test.

Message ID 1475717212-27467-3-git-send-email-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff Oct. 6, 2016, 1:26 a.m. UTC
It can take a way for dynamic addresses to propagate through ovn-northd,
so wait for it to happen.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 tests/ovn.at | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Gurucharan Shetty Oct. 7, 2016, 2:27 p.m. UTC | #1
On 5 October 2016 at 18:26, Ben Pfaff <blp@ovn.org> wrote:

> It can take a way for dynamic addresses to propagate through ovn-northd,
> so wait for it to happen.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---
>  tests/ovn.at | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 4214a00..9baa1df 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -4724,23 +4724,18 @@ ovn-nbctl lsp-add alice rp-alice -- set
> Logical_Switch_Port rp-alice type=router
>  # Create logical port foo1 in foo
>  ovn-nbctl 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"
> -])
> +AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port foo1
> dynamic_addresses='"0a:00:00:00:00:01 192.168.1.2"'], [0])
>
>  # Create logical port alice1 in alice
>  ovn-nbctl 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"
> -])
> +AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port alice1
> dynamic_addresses='"0a:00:00:00:00:02 192.168.2.2"'])
>
>  # Create logical port foo2 in foo
>  ovn-nbctl 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"
> -])
> +sleep 1
>

Why a sleep 1?


> +AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port foo2
> dynamic_addresses='"0a:00:00:00:00:03 192.168.1.3"'])
>
>  # Create a hypervisor and create OVS ports corresponding to logical ports.
>  net_add n1
>
Acked-by: Gurucharan Shetty <guru@ovn.org>


> --
> 2.1.3
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
Ben Pfaff Oct. 7, 2016, 3:33 p.m. UTC | #2
On Fri, Oct 07, 2016 at 07:27:54AM -0700, Guru Shetty wrote:
> On 5 October 2016 at 18:26, Ben Pfaff <blp@ovn.org> wrote:
> 
> > It can take a way for dynamic addresses to propagate through ovn-northd,
> > so wait for it to happen.
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> > ---
> >  tests/ovn.at | 13 ++++---------
> >  1 file changed, 4 insertions(+), 9 deletions(-)
> >
> > diff --git a/tests/ovn.at b/tests/ovn.at
> > index 4214a00..9baa1df 100644
> > --- a/tests/ovn.at
> > +++ b/tests/ovn.at
> > @@ -4724,23 +4724,18 @@ ovn-nbctl lsp-add alice rp-alice -- set
> > Logical_Switch_Port rp-alice type=router
> >  # Create logical port foo1 in foo
> >  ovn-nbctl 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"
> > -])
> > +AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port foo1
> > dynamic_addresses='"0a:00:00:00:00:01 192.168.1.2"'], [0])
> >
> >  # Create logical port alice1 in alice
> >  ovn-nbctl 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"
> > -])
> > +AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port alice1
> > dynamic_addresses='"0a:00:00:00:00:02 192.168.2.2"'])
> >
> >  # Create logical port foo2 in foo
> >  ovn-nbctl 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"
> > -])
> > +sleep 1
> >
> 
> Why a sleep 1?

I think that must have crept in as I was experimenting.  It should not
be necessary.  I've removed it now.

> 
> > +AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port foo2
> > dynamic_addresses='"0a:00:00:00:00:03 192.168.1.3"'])
> >
> >  # Create a hypervisor and create OVS ports corresponding to logical ports.
> >  net_add n1
> >
> Acked-by: Gurucharan Shetty <guru@ovn.org>

Thanks!
diff mbox

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index 4214a00..9baa1df 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -4724,23 +4724,18 @@  ovn-nbctl lsp-add alice rp-alice -- set Logical_Switch_Port rp-alice type=router
 # Create logical port foo1 in foo
 ovn-nbctl 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"
-])
+AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port foo1 dynamic_addresses='"0a:00:00:00:00:01 192.168.1.2"'], [0])
 
 # Create logical port alice1 in alice
 ovn-nbctl 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"
-])
+AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port alice1 dynamic_addresses='"0a:00:00:00:00:02 192.168.2.2"'])
 
 # Create logical port foo2 in foo
 ovn-nbctl 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"
-])
+sleep 1
+AT_CHECK([ovn-nbctl --timeout=10 wait-until Logical-Switch-Port foo2 dynamic_addresses='"0a:00:00:00:00:03 192.168.1.3"'])
 
 # Create a hypervisor and create OVS ports corresponding to logical ports.
 net_add n1