tests: Fix MPLS tests.
authorJarno Rajahalme <jarno@ovn.org>
Thu, 25 Feb 2016 00:10:42 +0000 (16:10 -0800)
committerJarno Rajahalme <jarno@ovn.org>
Thu, 25 Feb 2016 00:10:42 +0000 (16:10 -0800)
Some MPLS tests used non-MPLS ethertype for popping a label from a
multi-label stack.  Also, reveal actions in some MPLS tests.  This
will make later patches more easily understandable.

Fix the mpls-xlate banner and remove '-generate' option from MPLS
tests as it is no longer needed to create recirculation state.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
tests/dpif-netdev.at
tests/mpls-xlate.at
tests/ofproto-dpif.at

index 9abfbaf..12468f4 100644 (file)
@@ -14,6 +14,15 @@ strip_xout () {
 ' | sort
 }
 
+strip_xout_keep_actions () {
+    sed '
+    s/ufid:[-0-9a-f]* //
+    s/used:[0-9]*\.[0-9]*/used:0.0/
+    s/packets:[0-9]*/packets:0/
+    s/bytes:[0-9]*/bytes:0/
+' | sort
+}
+
 filter_flow_install () {
     grep 'flow_add' | sed 's/.*flow_add: //' | sort | uniq
 }
index 38790ea..d06036f 100644 (file)
@@ -1,4 +1,4 @@
-AT_BANNER([mpls_xlate])
+AT_BANNER([mpls-xlate])
 
 AT_SETUP([MPLS xlate action])
 
@@ -45,17 +45,17 @@ AT_CHECK([tail -1 stdout], [0],
 ])
 
 dnl Double MPLS pop
-AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=60,tc=0/0,ttl=64,bos=0)' -generate], [0], [stdout])
+AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=60,tc=0,ttl=64,bos=0)'], [0], [stdout])
 AT_CHECK([tail -1 stdout], [0],
   [Datapath actions: pop_mpls(eth_type=0x8847),recirc(0x1)
 ])
 
-AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(1),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=50,tc=0/0,ttl=64,bos=0)' -generate], [0], [stdout])
+AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(1),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=50,tc=0,ttl=64,bos=0)'], [0], [stdout])
 AT_CHECK([tail -1 stdout], [0],
   [Datapath actions: pop_mpls(eth_type=0x800),recirc(0x2)
 ])
 
-AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(2),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)' -generate], [0], [stdout])
+AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(2),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout])
 AT_CHECK([tail -1 stdout], [0],
   [Datapath actions: set(ipv4(ttl=10)),100
 ])
index a435842..fcb9716 100644 (file)
@@ -6069,7 +6069,7 @@ 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
+dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
 ])
 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 
@@ -6105,7 +6105,7 @@ 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
+dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
 ])
 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 
@@ -6396,9 +6396,9 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
 sleep 1
-AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
-recirc_id=0,mpls,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1, actions: <del>
-recirc_id=0,mpls,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions: <del>
+AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout_keep_actions], [0], [dnl
+recirc_id=0,mpls,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1, actions:push_mpls(label=11,tc=3,ttl=64,bos=0,eth_type=0x8847),2
+recirc_id=0,mpls,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions:pop_mpls(eth_type=0x800),2
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP