Acked-by: Daniele Di Proietto <diproiet...@vmware.com> On 30/07/2015 00:52, "Joe Stringer" <joestrin...@nicira.com> wrote:
>The initial sanity test only checked IPv4 without IP fragments. This patch >adds additional tests using IPv6 and VLANs with IP fragments and expands >the existing test to be more strict. > >Signed-off-by: Joe Stringer <joestrin...@nicira.com> >CC: Daniele Di Proietto <diproiet...@vmware.com> >--- > >Daniele, these tests are basic sanity checks to ensure that the tree >works correctly today in particular when we start getting things like IP >fragments and VLANs involved. For each of these tests, I also have some >forthcoming tests that test the same environments but with >conntrack/firewall flows. Would you mind looking at how we can make >these tests generic across both datapaths, just like the other tests you >have in your conntrack branch? It might be worthwhile to start >upstreaming those changes, too. It doesn't appear too complicated to port these tests to the userspace datapath (they actually do not require any change at all). I have some patches almost ready on top of this series to do that. I'll post them tomorrow, hoping that this gets merged Thanks! >--- > tests/kmod-macros.at | 11 ++++++ > tests/kmod-traffic.at | 93 >++++++++++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 103 insertions(+), 1 deletion(-) > >diff --git a/tests/kmod-macros.at b/tests/kmod-macros.at >index 5824940..eef1263 100644 >--- a/tests/kmod-macros.at >+++ b/tests/kmod-macros.at >@@ -77,3 +77,14 @@ m4_define([ADD_VETH], > AT_CHECK([ip netns exec $2 ip link set dev $1 up]) > ] > ) >+ >+# ADD_VLAN([port], [namespace], [vlan-id], [ip-addr]) >+# >+# Add a VLAN device named 'port' within 'namespace'. It will be >configured >+# with the ID 'vlan-id' and the address 'ip-addr'. >+m4_define([ADD_VLAN], >+ [ AT_CHECK([ip netns exec $2 ip link add link $1 name $1.$3 type >vlan id $3]) >+ AT_CHECK([ip netns exec $2 ip link set dev $1.$3 up]) >+ AT_CHECK([ip netns exec $2 ip addr add dev $1.$3 $4]) >+ ] >+) >diff --git a/tests/kmod-traffic.at b/tests/kmod-traffic.at >index f7783be..9df8b62 100644 >--- a/tests/kmod-traffic.at >+++ b/tests/kmod-traffic.at >@@ -11,6 +11,97 @@ ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24") > > AT_CAPTURE_FILE([ping.output]) > AT_CHECK([ip netns exec at_ns0 bash -c "ping -q -c 3 -i 0.3 -w 2 >10.1.1.2 > 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.2 >> 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.2 >> ping.output"]) > >-OVS_KMOD_VSWITCHD_STOP([], DEL_NAMESPACES(at_ns0, at_ns1)) >+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 >+]) >+ >+OVS_KMOD_VSWITCHD_STOP >+AT_CLEANUP >+ >+AT_SETUP([kmod - ping between two ports on vlan]) >+OVS_KMOD_VSWITCHD_START( >+ [set-fail-mode br0 standalone -- ]) >+ >+ADD_NAMESPACES(at_ns0, at_ns1) >+ >+ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24") >+ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24") >+ >+ADD_VLAN(p0, at_ns0, 100, "10.2.2.1/24") >+ADD_VLAN(p1, at_ns1, 100, "10.2.2.2/24") >+ >+AT_CAPTURE_FILE([ping.output]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping -q -c 3 -i 0.3 -w 2 >10.2.2.2 > ping.output"]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping -s 1600 -q -c 3 -i 0.3 -w 2 >10.2.2.2 >> ping.output"]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping -s 3200 -q -c 3 -i 0.3 -w 2 >10.2.2.2 >> 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 >+]) >+ >+OVS_KMOD_VSWITCHD_STOP >+AT_CLEANUP >+ >+AT_SETUP([kmod - ping6 between two ports]) >+OVS_KMOD_VSWITCHD_START( >+ [set-fail-mode br0 standalone -- ]) >+ >+ADD_NAMESPACES(at_ns0, at_ns1) >+ >+ADD_VETH(p0, at_ns0, br0, "fc00::1/96") >+ADD_VETH(p1, at_ns1, br0, "fc00::2/96") >+ >+dnl Without this sleep, we get occasional failures due to the following >error: >+dnl "connect: Cannot assign requested address" >+sleep 2; >+ >+AT_CAPTURE_FILE([ping.output]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping6 -q -c 3 -i 0.3 -w 2 >fc00::2 > ping.output"]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping6 -s 1600 -q -c 3 -i 0.3 -w >2 fc00::2 >> ping.output"]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping6 -s 3200 -q -c 3 -i 0.3 -w >2 fc00::2 >> 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 >+]) >+ >+OVS_KMOD_VSWITCHD_STOP >+AT_CLEANUP >+ >+AT_SETUP([kmod - ping6 between two ports on vlan]) >+OVS_KMOD_VSWITCHD_START( >+ [set-fail-mode br0 standalone -- ]) >+ >+ADD_NAMESPACES(at_ns0, at_ns1) >+ >+ADD_VETH(p0, at_ns0, br0, "fc00::1/96") >+ADD_VETH(p1, at_ns1, br0, "fc00::2/96") >+ >+ADD_VLAN(p0, at_ns0, 100, "fc00:1::1/96") >+ADD_VLAN(p1, at_ns1, 100, "fc00:1::2/96") >+ >+dnl Without this sleep, we get occasional failures due to the following >error: >+dnl "connect: Cannot assign requested address" >+sleep 2; >+ >+AT_CAPTURE_FILE([ping.output]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping6 -q -c 3 -i 0.3 -w 2 >fc00:1::2 > ping.output"]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping6 -s 1600 -q -c 3 -i 0.3 -w >2 fc00:1::2 >> ping.output"]) >+AT_CHECK([ip netns exec at_ns0 bash -c "ping6 -s 3200 -q -c 3 -i 0.3 -w >2 fc00:1::2 >> 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 >+]) >+ >+OVS_KMOD_VSWITCHD_STOP > AT_CLEANUP >-- >2.1.4 > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev