[ovs-dev,5/5] system-traffic: 802.1ad: Add dot1q-tunnel test case.

Submitted by Eric Garver on March 17, 2017, 8:13 p.m.

Details

Message ID 20170317201315.2708-6-e@erig.me
State Accepted
Delegated to: Joe Stringer
Headers show

Commit Message

Eric Garver March 17, 2017, 8:13 p.m.
Test case for dot1q-tunnel between two "customer" bridges.

Signed-off-by: Eric Garver <e@erig.me>
---
 tests/system-traffic.at | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index fd026ca2a040..1816b1a88f72 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -3615,3 +3615,66 @@  NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -w 2 10.2.2.2 | FORMAT_PING
 
 OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
+
+
+AT_SETUP([802.1ad - 802.1q tunnel])
+OVS_TRAFFIC_VSWITCHD_START([set Open_vSwitch . other_config:vlan-limit=0])
+OVS_CHECK_8021AD()
+
+ADD_BR([br1])
+ADD_BR([br2])
+ADD_NAMESPACES(at_ns0, at_ns1)
+
+AT_CHECK([ip link add ovs-p0 type veth peer name ovs-p1])
+AT_CHECK([ip link set dev ovs-p0 up])
+AT_CHECK([ip link set dev ovs-p1 up])
+AT_CHECK([ovs-vsctl add-port br0 ovs-p0])
+AT_CHECK([ovs-vsctl add-port br1 ovs-p1])
+on_exit 'ip link del ovs-p0'
+
+AT_CHECK([ip link add ovs-p2 type veth peer name ovs-p3])
+AT_CHECK([ip link set dev ovs-p2 up])
+AT_CHECK([ip link set dev ovs-p3 up])
+AT_CHECK([ovs-vsctl add-port br0 ovs-p2])
+AT_CHECK([ovs-vsctl add-port br2 ovs-p3])
+on_exit 'ip link del ovs-p2'
+
+ADD_VETH(p4, at_ns0, br1, "10.1.1.1/24")
+ADD_VETH(p5, at_ns1, br2, "10.1.1.2/24")
+ADD_CVLAN(p4, at_ns0, 100, "10.2.2.1/24")
+ADD_CVLAN(p5, at_ns1, 100, "10.2.2.2/24")
+ADD_CVLAN(p4, at_ns0, 200, "10.3.2.1/24")
+ADD_CVLAN(p5, at_ns1, 200, "10.3.2.2/24")
+ADD_CVLAN(p4, at_ns0, 300, "10.4.2.1/24")
+ADD_CVLAN(p5, at_ns1, 300, "10.4.2.2/24")
+
+AT_CHECK([ovs-ofctl add-flow br0 action=normal])
+AT_CHECK([ovs-ofctl add-flow br1 action=normal])
+AT_CHECK([ovs-ofctl add-flow br2 action=normal])
+AT_CHECK([ovs-vsctl set port ovs-p0 vlan_mode=dot1q-tunnel tag=4094 cvlans=100,200])
+AT_CHECK([ovs-vsctl set port ovs-p2 vlan_mode=dot1q-tunnel tag=4094 cvlans=100,200])
+
+OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2])
+OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.3.2.2])
+
+NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.2.2.2 | FORMAT_PING], [0], [dnl
+3 packets transmitted, 3 received, 0% packet loss, time 0ms
+])
+
+NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.3.2.2 | FORMAT_PING], [0], [dnl
+3 packets transmitted, 3 received, 0% packet loss, time 0ms
+])
+
+NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -w 2 10.2.2.2 | FORMAT_PING], [0], [dnl
+3 packets transmitted, 3 received, 0% packet loss, time 0ms
+])
+
+NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -w 2 10.3.2.2 | FORMAT_PING], [0], [dnl
+3 packets transmitted, 3 received, 0% packet loss, time 0ms
+])
+
+dnl CVLAN 300 is not permitted by dot1q-tunnel
+NS_CHECK_EXEC([at_ns0], [ping -q -c 1 -w 3 10.4.2.2], [1], [ignore])
+
+OVS_TRAFFIC_VSWITCHD_STOP(["/dropping VLAN \(0\|300\) packet received on dot1q-tunnel port/d"])
+AT_CLEANUP