diff options
author | Ethan Jackson <ethan@nicira.com> | 2011-11-18 13:47:25 -0800 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2011-11-21 12:52:10 -0800 |
commit | fd19297bb3d61789aa2a8871e3316b2a4e3e34c3 (patch) | |
tree | e180652945c72620e4a35b4d2b1fedcbb72a4f94 | |
parent | 451256f6c83873a6f636186d109baeb24f102c0a (diff) |
ofproto-dpif: Test basic output and flooding.
This patch adds basic tests to ofproto-dpif which verify that
output and flood actions respect the relevant OFPPC flags, and do
not loop back to the in_port.
-rw-r--r-- | tests/ofproto-dpif.at | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 397c42ec..13c6fd77 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -62,6 +62,64 @@ AT_CHECK([tail -1 stdout], [0], OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - output/flood flags]) +dnl This test assumes that OpenFlow port numbers are allocated in order +dnl starting from one. It does not necessarily require that they are allocated +dnl in the same order that they are named in the database. Just that the +dnl following command guarantees OpenFlow port 65534, and ports 1-7 exist in +dnl the bridge. +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy --\ + add-port br0 p2 -- set Interface p2 type=dummy --\ + add-port br0 p3 -- set Interface p3 type=dummy --\ + add-port br0 p4 -- set Interface p4 type=dummy --\ + add-port br0 p5 -- set Interface p5 type=dummy --\ + add-port br0 p6 -- set Interface p6 type=dummy --\ + add-port br0 p7 -- set Interface p7 type=dummy ]) + +AT_DATA([flows.txt], [dnl +in_port=1 actions=flood +in_port=2 actions=all +in_port=3 actions=output:65534,output:1,output:2,output:3,output:4,output:5,output:6,output:7 +in_port=4 actions=enqueue:65534:1,enqueue:1:1,enqueue:2:1,enqueue:3:1,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1 +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +AT_CHECK([ovs-ofctl mod-port br0 5 noforward]) +AT_CHECK([ovs-ofctl mod-port br0 6 noflood]) + +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout]) +AT_CHECK([tail -1 stdout \ +| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl +0 +2 +3 +4 +7 +]) + +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout]) +AT_CHECK([tail -1 stdout \ +| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl +0 +1 +3 +4 +6 +7 +]) + +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: 0,1,2,4,6,7 +]) + +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: 0,1,2,3,6,7 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto-dpif - set_tunnel]) OVS_VSWITCHD_START AT_DATA([flows.txt], [dnl |