[ovs-dev] [mpls 1/2] tests: Fix up a couple of tests to match current results.

Ben Pfaff blp at nicira.com
Mon Feb 3 20:57:55 UTC 2014


Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 tests/odp.at          |    7 +++++--
 tests/ofproto-dpif.at |   17 ++++++++++-------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/tests/odp.at b/tests/odp.at
index 7834a74..a968dd3 100644
--- a/tests/odp.at
+++ b/tests/odp.at
@@ -85,8 +85,11 @@ AT_CAPTURE_FILE([odp-in.txt])
 dnl If the BoS bit of the last LSE is 0 then the stack is unterminated
 dnl Internally a stack of 3 LSEs will be used with the trailing LSEs
 dnl set to zero. This is reflected when the key is formated
-sed 's/mpls(label=100,tc=7,ttl=100,bos=0)/mpls(lse0=0x64e64,lse1=0,lse2=0)/
-s/mpls(label=1000,tc=4,ttl=200,bos=0)/mpls(lse0=0x3e88c8,lse1=0,lse2=0)/' < odp-in.txt > odp-out.txt
+sed '/bos=0/{
+s/^/ODP_FIT_TOO_LITTLE: /
+s/mpls(label=100,tc=7,ttl=100,bos=0)/mpls(lse0=0x64e64,lse1=0,lse2=0)/
+s/mpls(label=1000,tc=4,ttl=200,bos=0)/mpls(lse0=0x3e88c8,lse1=0,lse2=0)/
+}' < odp-in.txt > odp-out.txt
 
 AT_CHECK_UNQUOTED([test-odp parse-keys < odp-in.txt], [0], [`cat odp-out.txt`
 ])
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 24a2866..9fa542a 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -2393,22 +2393,25 @@ 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 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 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
-dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
+dnl The input is a frame with four 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
-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))
+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_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
 ])
+done
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
-- 
1.7.10.4




More information about the dev mailing list