[ovs-dev] [PATCH v2] ovn: Update the test case for localnet port.
Han Zhou
zhouhan at gmail.com
Thu Mar 17 05:33:11 UTC 2016
Localnet port is now able to connect vif ports on different HVs.
Change the test case accordingly.
Signed-off-by: Han Zhou <zhouhan at gmail.com>
---
Notes:
v1->v2:
Update according to Russell's comment: add test for connectivity
between 2 lswitches on same physical network
tests/ovn.at | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
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
--
2.1.0
More information about the dev
mailing list