Skip to content

Commit

Permalink
tests: Fix MPLS tests.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
Jarno Rajahalme committed Feb 25, 2016
1 parent 8cffdcd commit 3fd1219
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions tests/dpif-netdev.at
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions tests/mpls-xlate.at
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AT_BANNER([mpls_xlate])
AT_BANNER([mpls-xlate])

AT_SETUP([MPLS xlate action])

Expand Down Expand Up @@ -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
])
Expand Down
10 changes: 5 additions & 5 deletions tests/ofproto-dpif.at
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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])

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3fd1219

Please sign in to comment.