diff mbox

[ovs-dev] ovn: Update the test case for localnet port.

Message ID 1457913183-1435-1-git-send-email-zhouhan@gmail.com
State Not Applicable
Headers show

Commit Message

Han Zhou March 13, 2016, 11:53 p.m. UTC
Localnet port is now able to connect vif ports on different HVs.
Change the test case accordingly.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
---
 tests/ovn.at | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

Comments

Russell Bryant March 16, 2016, 6:29 a.m. UTC | #1
On Sun, Mar 13, 2016 at 4:53 PM, Han Zhou <zhouhan@gmail.com> wrote:

> Localnet port is now able to connect vif ports on different HVs.
> Change the test case accordingly.
>
> Signed-off-by: Han Zhou <zhouhan@gmail.com>
>

I wonder if we should still test the old model, as well.  We still want
multiple localnet-enabled logical switches configured for the same network
to have connectivity.  What do you think?
Han Zhou March 16, 2016, 6:21 p.m. UTC | #2
On Tue, Mar 15, 2016 at 11:29 PM, Russell Bryant <russell@ovn.org> wrote:

>
>
> On Sun, Mar 13, 2016 at 4:53 PM, Han Zhou <zhouhan@gmail.com> wrote:
>
>> Localnet port is now able to connect vif ports on different HVs.
>> Change the test case accordingly.
>>
>> Signed-off-by: Han Zhou <zhouhan@gmail.com>
>>
>
> I wonder if we should still test the old model, as well.  We still want
> multiple localnet-enabled logical switches configured for the same network
> to have connectivity.  What do you think?
>
> --
> Russell Bryant
>

Good point. Yes, I will add an extra lswitch to test the connection between
2 bridged lswitches on same physical network.
diff mbox

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index 5cb7d8b..ed84717 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -795,9 +795,25 @@  AT_KEYWORDS([ovn-localnet])
 AT_SKIP_IF([test $HAVE_PYTHON = no])
 ovn_start
 
-# We model each logical port connectivity to a locally attached
-# physical network with its own logical switch.  One port is
-# for the VIF, and the other port is a special 'localnet' port.
+# In this test cases we create two lswitches, both connected to same
+# physical network (through br-phys on each HV), one untagged and one
+# tagged with VLAN 101. Each lswitch has 4 VIF ports across 2 HVs, and
+# a localnet port is created for each lswitch to connect VIF ports
+# across HVs.
+
+for i in 1 2; do
+    lswitch_name=ls$i
+    ovn-nbctl lswitch-add $lswitch_name
+    ln_port_name=ln$i
+    if test $i -eq 1; then
+        ovn-nbctl lport-add $lswitch_name $ln_port_name
+    else
+        ovn-nbctl lport-add $lswitch_name $ln_port_name "" 101
+    fi
+    ovn-nbctl lport-set-addresses $ln_port_name unknown
+    ovn-nbctl lport-set-type $ln_port_name localnet
+    ovn-nbctl lport-set-options $ln_port_name network_name=phys
+done
 
 net_add n1
 for i in 1 2; do
@@ -814,20 +830,12 @@  for i in 1 2; do
                                   options:rxq_pcap=hv$i/vif$i$j-rx.pcap \
                                   ofport-request=$i$j
 
-        lswitch_name=phys-lp$i$j
         lport_name=lp$i$j
-        ln_port_name=phys-ln-$i$j
-
-        ovn-nbctl lswitch-add $lswitch_name
-
         if test $j -le 2; then
-            ovn-nbctl lport-add $lswitch_name $ln_port_name
+            lswitch_name=ls1
         else
-            ovn-nbctl lport-add $lswitch_name $ln_port_name "" 101
+            lswitch_name=ls2
         fi
-        ovn-nbctl lport-set-addresses $ln_port_name unknown
-        ovn-nbctl lport-set-type $ln_port_name localnet
-        ovn-nbctl lport-set-options $ln_port_name network_name=phys
 
         ovn-nbctl lport-add $lswitch_name $lport_name
         ovn-nbctl lport-set-addresses $lport_name f0:00:00:00:00:$i$j