tests: Fix MPLS test cases.
authorJoe Stringer <joestringer@nicira.com>
Sat, 8 Feb 2014 00:39:54 +0000 (16:39 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 11 Feb 2014 18:05:01 +0000 (10:05 -0800)
The "userspace" MPLS test case was checking the same things as the
"drop" test case, rather than checking to see that packets were being
sent to userspace. This patch makes the testsuite consistent with itself.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests/ofproto-dpif.at

index d57319c..8dcd7b9 100644 (file)
@@ -2903,22 +2903,19 @@ 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 sent to userspace because a MPLS push or pop action is applied to
-dnl a packet with 4 MPLS LSEs but userspace and the datapath can only handle up
-dnl to 3 labels.
+dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
 dnl
-dnl The input is a frame with four MPLS labels which tcpdump -vve shows as:
+dnl The input is a frame with two MPLS labels 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)
-dnl         (label 20, exp 0, ttl 32)
-dnl         (label 20, exp 0, ttl 32)
 dnl         (label 20, exp 0, [S], ttl 32)
 dnl         (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
 dnl     192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
 
 for dl_src in 00 01; do
-    AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014020 00014020 00014120 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 netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 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_UNQUOTED([ovs-appctl dpif/dump-flows br0 | grep ":$dl_src/" | STRIP_USED], [0], [dnl
-skb_priority(0),in_port(1),eth(src=60:66:66:66:66:$dl_src/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:$dl_src/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,lse1=0x14120), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(controller))
 ])
 done
 
@@ -2941,7 +2938,7 @@ 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.
+dnl can't determine the resulting MPLS label after MPLS push/pop actions.
 dnl
 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
 dnl 60:66:66:66:66:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
@@ -2950,11 +2947,14 @@ dnl         (label 20, exp 0, ttl 32)
 dnl         (label 20, exp 0, [S], ttl 32)
 dnl         (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
 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 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: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
+for dl_src in 00 01; do
+    AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 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_UNQUOTED([ovs-appctl dpif/dump-flows br0 | grep ":$dl_src/" | STRIP_USED], [0], [dnl
+skb_priority(0),in_port(1),eth(src=60:66:66:66:66:$dl_src/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,lse1=0x14120), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(controller))
 ])
+done
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP