I get a warning in the OVS log that causes this test to fail.

It appears that when br0 is removed (in OVS_KMOD_VSWITCHD_STOP)
OVS gets a rtnetlink message (because br0 had an address in the
routing table), but route_table_parse() fails, because
if_indextoname() returns an error (the device is not there anymore).

Adding

AT_CHECK([ip addr del dev br0 "10.1.1.100/24"])

before OVS_KMOD_VSWITCHD_STOP solves the problem for me.
Could you add that? What do you think?

Also, I think that instead of creating the veth pair for
the tunnel underlay manually, we could use another OVS
bridge.  This has two advantages:

* The code is shorter
* Tunnelling in userspace requires an OVS bridge as
  underlay.

This is a summary of the changes I'm proposing:

diff --git a/tests/kmod-traffic.at b/tests/kmod-traffic.at
index 169078d..346d464 100644
--- a/tests/kmod-traffic.at
+++ b/tests/kmod-traffic.at
@@ -110,20 +110,18 @@ AT_SETUP([kmod - ping over vxlan tunnel])
 AT_SKIP_IF([! ip link help 2>&1 | grep vxlan >/dev/null])

 OVS_KMOD_VSWITCHD_START(
-   [set-fail-mode br0 standalone --])
+   [set-fail-mode br0 standalone --dnl
+    add-br br-ovs-p0])
 dnl Ensure that vport_* can be removed on exit.
 ON_EXIT([modprobe -r vport_vxlan])
 ON_EXIT([ovs-dpctl del-dp ovs-system])

 ADD_NAMESPACES(at_ns0)

+ADD_VETH(p0, at_ns0, br-ovs-p0, "172.31.1.1/24")
 dnl Set up underlay link from host into the namespace using veth pair.
-AT_CHECK([ip link add p0 type veth peer name host-p0])
-AT_CHECK([ip addr add dev host-p0 "172.31.1.100/24"])
-AT_CHECK([ip link set dev host-p0 up])
-AT_CHECK([ip link set p0 netns at_ns0])
-AT_CHECK([ip netns exec at_ns0 ip addr add dev p0 "172.31.1.1/24"])
-AT_CHECK([ip netns exec at_ns0 ip link set dev p0 up])
+AT_CHECK([ip addr add dev br-ovs-p0 "172.31.1.100/24"])
+AT_CHECK([ip link set dev br-ovs-p0 up])

 dnl Set up remote end of tunnel inside the namespace.
 ADD_NATIVE_TUNNEL([vxlan], [at_vxlan1], [at_ns0], [172.31.1.1],
[172.31.1.100],
@@ -152,5 +150,8 @@ AT_CHECK([cat ping.output | grep "transmitted" | sed
's/time.*ms$/time 0ms/'], [
 3 packets transmitted, 3 received, 0% packet loss, time 0ms
 ])

+AT_CHECK([ip addr del dev br0 "10.1.1.100/24"])
+AT_CHECK([ip addr del dev br-ovs-p0 "172.31.1.100/24"])
+
 OVS_KMOD_VSWITCHD_STOP
 AT_CLEANUP


I'll leave it up to you, I can also make this change in my next series.

Acked-by: Daniele Di Proietto <diproiet...@vmware.com>


On 30/07/2015 00:52, "Joe Stringer" <joestrin...@nicira.com> wrote:

>Signed-off-by: Joe Stringer <joestrin...@nicira.com>
>---
> tests/kmod-macros.at  | 20 ++++++++++++++++++++
> tests/kmod-traffic.at | 49
>+++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 69 insertions(+)
>
>diff --git a/tests/kmod-macros.at b/tests/kmod-macros.at
>index 3487c67..be3c123 100644
>--- a/tests/kmod-macros.at
>+++ b/tests/kmod-macros.at
>@@ -87,3 +87,23 @@ m4_define([ADD_VLAN],
>       AT_CHECK([ip netns exec $2 ip addr add dev $1.$3 $4])
>     ]
> )
>+
>+# ADD_NATIVE_TUNNEL([type], [port], [namespace], [local-addr],
>[remote-addr],
>+#                   [overlay-addr], [link-args])
>+#
>+# Add a native tunnel device within 'namespace', with name 'port' and
>type
>+# 'type'. The tunnel device will be configured as point-to-point with the
>+# 'local-addr' address configured as the underlay address within
>'namespace',
>+# and 'remote-addr' as the underlay address of the remote destination (as
>+# viewed from the perspective of that namespace).
>+#
>+# 'port' will be configured with the address 'overlay-addr'. 'link-args'
>is
>+# made available so that additional arguments can be passed to "ip link",
>+# for instance to configure the vxlan destination port.
>+m4_define([ADD_NATIVE_TUNNEL],
>+    [ AT_CHECK([ip netns exec $3 ip link add dev $2 type $1 local $4
>remote $5 $7])
>+      AT_CHECK([ip netns exec $3 ip addr add dev $2 $6])
>+      AT_CHECK([ip netns exec $3 ip link set dev $2 up])
>+      AT_CHECK([ip netns exec $3 ip link set dev $2 mtu 1450])
>+    ]
>+)
>diff --git a/tests/kmod-traffic.at b/tests/kmod-traffic.at
>index 9df8b62..169078d 100644
>--- a/tests/kmod-traffic.at
>+++ b/tests/kmod-traffic.at
>@@ -105,3 +105,52 @@ AT_CHECK([cat ping.output | grep "transmitted" | sed
>'s/time.*ms$/time 0ms/'], [
> 
> OVS_KMOD_VSWITCHD_STOP
> AT_CLEANUP
>+
>+AT_SETUP([kmod - ping over vxlan tunnel])
>+AT_SKIP_IF([! ip link help 2>&1 | grep vxlan >/dev/null])
>+
>+OVS_KMOD_VSWITCHD_START(
>+   [set-fail-mode br0 standalone --])
>+dnl Ensure that vport_* can be removed on exit.
>+ON_EXIT([modprobe -r vport_vxlan])
>+ON_EXIT([ovs-dpctl del-dp ovs-system])
>+
>+ADD_NAMESPACES(at_ns0)
>+
>+dnl Set up underlay link from host into the namespace using veth pair.
>+AT_CHECK([ip link add p0 type veth peer name host-p0])
>+AT_CHECK([ip addr add dev host-p0 "172.31.1.100/24"])
>+AT_CHECK([ip link set dev host-p0 up])
>+AT_CHECK([ip link set p0 netns at_ns0])
>+AT_CHECK([ip netns exec at_ns0 ip addr add dev p0 "172.31.1.1/24"])
>+AT_CHECK([ip netns exec at_ns0 ip link set dev p0 up])
>+
>+dnl Set up remote end of tunnel inside the namespace.
>+ADD_NATIVE_TUNNEL([vxlan], [at_vxlan1], [at_ns0], [172.31.1.1],
>[172.31.1.100],
>+    [10.1.1.1/24], [id 0 dstport 4789])
>+
>+dnl Set up local end of tunnel in default namespace.
>+AT_CHECK([ovs-vsctl add-port br0 vxlan0 -- \
>+    set int vxlan0 type=vxlan options:remote_ip=172.31.1.1])
>+AT_CHECK([ip addr add dev br0 10.1.1.100/24])
>+AT_CHECK([ip link set dev br0 up])
>+AT_CHECK([ip link set dev br0 mtu 1450])
>+
>+AT_CAPTURE_FILE([ping.output])
>+dnl First, check the underlay
>+AT_CHECK([ip netns exec at_ns0 bash -c "ping -q -c 3 -i 0.3 -w 2
>172.31.1.100 > ping.output"])
>+
>+dnl Okay, now check the overlay with different packet sizes
>+AT_CHECK([ip netns exec at_ns0 bash -c "ping -q -c 3 -i 0.3 -w 2
>10.1.1.100 >> ping.output"])
>+AT_CHECK([ip netns exec at_ns0 bash -c "ping -s 1600 -q -c 3 -i 0.3 -w 2
>10.1.1.100 >> ping.output"])
>+AT_CHECK([ip netns exec at_ns0 bash -c "ping -s 3200 -q -c 3 -i 0.3 -w 2
>10.1.1.100 >> ping.output"])
>+
>+AT_CHECK([cat ping.output | grep "transmitted" | sed 's/time.*ms$/time
>0ms/'], [0], [dnl
>+3 packets transmitted, 3 received, 0% packet loss, time 0ms
>+3 packets transmitted, 3 received, 0% packet loss, time 0ms
>+3 packets transmitted, 3 received, 0% packet loss, time 0ms
>+3 packets transmitted, 3 received, 0% packet loss, time 0ms
>+])
>+
>+OVS_KMOD_VSWITCHD_STOP
>+AT_CLEANUP
>-- 
>2.1.4
>
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Sm
>B5nZacmXNq0gKCC1s_Cw5yUNjxgD4v5kJqZ2uWLlE&m=tYMJUXOj1Fn0vyVLlAHSvzeBLu3Mw5
>KXkJxuDm8tCcQ&s=LrPHR-nHMQReNatbFL1nWoQywzsvwg5Mp-fy7g3cXx8&e= 

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to