Update the test for an MPLS pop on on a packet whose label stack going to
userspace to test that it goes to userspace, which is currently the case,
rather than being dropped, which was the case earlier.

Signed-off-by: Simon Horman <ho...@verge.net.au>
---
 tests/ofproto-dpif.at | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 06f60d4..24a2866 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -2380,7 +2380,7 @@ 
skb_priority(0),skb_mark(0/0),in_port(p3),eth(src=50:54:00:00:00:09/00:00:00:00:
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
-AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows - MPLS actions that result 
in a drop])
+AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows - MPLS actions that result 
in a userspace action])
 OVS_VSWITCHD_START([dnl
    add-port br0 p1 -- set Interface p1 type=dummy
 ])
@@ -2393,9 +2393,9 @@ dl_src=60:66:66:66:66:01 
actions=pop_mpls:0x8849,controller
 ])
 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 
-dnl Packet is dropped because an MPLS POP action is applied to a packet with
-dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
-dnl can't determine the resulting MPLS label after an MPLS POP action.
+dnl Packet is sent to userspace because an MPLS POP action is applied to a
+dnl packet with 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs
+dnl and thus can't determine the resulting MPLS label after an MPLS POP action.
 dnl
 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
 dnl 60:66:66:66:66:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), 
length 74: MPLS (label 20, exp 0, ttl 32)
@@ -2406,6 +2406,27 @@ dnl         (tos 0x0, ttl 64, id 0, offset 0, flags 
[none], proto TCP (6), lengt
 dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), 
seq 42:46, win 10000, length 4
 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 
00 88 47 00 01 40 20 00 01 40 20 00 01 40 20 00 01 41 20 45 00 00 2c 00 00 00 
00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 
00 27 10 77 44 00 00 48 4f 47 45'])
 
+AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
+skb_priority(0),in_port(1),eth(src=60:66:66:66:66:00/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020/0x100,lse1=0x14020/0x100,lse2=0x14020/0x100),
 packets:0, bytes:0, used:never, 
actions:userspace(pid=0,slow_path(controller,action))
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+
+AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows - MPLS actions that result 
in a drop])
+OVS_VSWITCHD_START([dnl
+   add-port br0 p1 -- set Interface p1 type=dummy
+])
+ON_EXIT([kill `cat ovs-ofctl.pid`])
+
+AT_CAPTURE_FILE([ofctl_monitor.log])
+AT_DATA([flows.txt], [dnl
+dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
+dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
+])
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
+
 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
 dnl can't determine the resulting MPLS label after an MPLS PUSH action.
@@ -2420,7 +2441,6 @@ dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], 
cksum 0x7744 (correct), se
 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 
01 88 47 00 01 40 20 00 01 40 20 00 01 40 20 00 01 41 20 45 00 00 2c 00 00 00 
00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 
00 27 10 77 44 00 00 48 4f 47 45'])
 
 AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
-skb_priority(0),in_port(1),eth(src=60:66:66:66:66:00/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020/0x100,lse1=0x14020/0x100,lse2=0x14020/0x100),
 packets:0, bytes:0, used:never, actions:drop
 
skb_priority(0),in_port(1),eth(src=60:66:66:66:66:01/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020/0x100,lse1=0x14020/0x100,lse2=0x14020/0x100),
 packets:0, bytes:0, used:never, actions:drop
 ])
 
-- 
1.8.5.2

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

Reply via email to