flow: Support OF1.5+ (draft) actset_output field.
[cascardo/ovs.git] / tests / ofproto-dpif.at
index 05bb0e3..58a2cf9 100644 (file)
@@ -490,6 +490,46 @@ AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+
+AT_SETUP([ofproto-dpif - actset_output])
+OVS_VSWITCHD_START
+ADD_OF_PORTS(
+  [br0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13])
+AT_DATA([flows.txt], [dnl
+table=0     actions=write_actions(output(2)),goto_table(1)
+table=1     actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
+
+# Verify that actset_output got set.
+table=2,priority=20,actset_output=2  actions=4,goto_table(3)
+table=2,priority=10                  actions=5,goto_table(3)
+
+# Verify that xreg0 got copied properly from actset_output.
+table=3,priority=20,xreg0=2  actions=6,goto_table(4)
+table=3,priority=10          actions=7,goto_table(4)
+
+# Verify that adding a group action unsets actset_output.
+table=4 actions=write_actions(group(5)),goto_table(5)
+table=5,priority=20,actset_output=unset  actions=8,goto_table(6)
+table=5,priority=10                      actions=9,goto_table(6)
+
+# Verify that adding another output action doesn't change actset_output
+# (since there's still a group).
+table=6 actions=write_actions(output(3)),goto_table(7)
+table=7,priority=20,actset_output=unset  actions=10,goto_table(8)
+table=7,priority=10                      actions=11,goto_table(8)
+
+# Verify that clearing the action set, then writing an output action,
+# causes actset_output to be set again.
+table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
+table=9,priority=20,actset_output=2 actions=12
+table=9,priority=10                 actions=13
+])
+AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
+AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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)'], [0], [stdout])
+AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
 AT_SETUP([ofproto-dpif - push-pop])
 OVS_VSWITCHD_START
 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])