aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2012-01-05 10:19:15 -0800
committerJustin Pettit <jpettit@nicira.com>2012-01-05 12:35:19 -0800
commit777507385a993b3ca072c512dac30ba1e6354b42 (patch)
tree1e90e42de3c55eba05669237e014c888f72eb122 /tests
parentc4dba11a6395722c6522eee7d238bb4fc6685e7d (diff)
ofproto-dpif.at: Add test for normal action with OFPP_NONE in_port.
Commit 33158a (ofproto-dpif: Fake-up OFPP_NONE input bundle for mirroring and normal.) fixed handling of packets sent from a controller with an ingress port of OFPP_NONE. It includes a unit test for the mirroring case, but not the "normal" processing case. The reason is that the test requires commit fadc05 (ofproto-dpif: Fix nondeterministic flow revalidation behavior.), which removes a check that causes the test to fail. That fix isn't available in all branches that 33158a is on, so this test is only being run on those that are. Signed-off-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ofproto-dpif.at28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 58d3d233..d58c5313 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -62,6 +62,34 @@ AT_CHECK([tail -1 stdout], [0],
OVS_VSWITCHD_STOP
AT_CLEANUP
+AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set Interface p1 type=dummy --\
+ add-port br0 p2 -- set Interface p2 type=dummy])
+
+AT_CHECK(
+ [ovs-vsctl \
+ -- get Interface p1 ofport \
+ -- get Interface p2 ofport],
+ [0], [stdout])
+set `cat stdout`
+br0=0 p1=$1 p2=$2
+
+AT_CHECK([ovs-ofctl add-flow br0 action=normal])
+
+# "in_port" defaults to OFPP_NONE if it's not specified.
+flow="eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
+AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
+actual=`tail -1 stdout | sed 's/Datapath actions: //'`
+
+expected="$br0,$p1,$p2"
+AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" br0=$br0 p1=$p1 p2=$p2], [0], [stdout])
+mv stdout expout
+AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" br0=$br0 p1=$p1 p2=$p2], [0], [expout])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
AT_SETUP([ofproto-dpif - DSCP])
dnl This test assumes port p1 is allocated OpenFlow port number 1.
OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])