+
+AT_SETUP([ofproto-dpif - fragment handling])
+OVS_VSWITCHD_START
+AT_DATA([flows.txt], [dnl
+priority=75 tcp ip_frag=no tp_dst=80 actions=output:1
+priority=75 tcp ip_frag=first tp_dst=80 actions=output:2
+priority=75 tcp ip_frag=later tp_dst=80 actions=output:3
+priority=50 tcp ip_frag=no actions=output:4
+priority=50 tcp ip_frag=first actions=output:5
+priority=50 tcp ip_frag=later actions=output:6
+])
+AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
+
+base_flow="in_port(90),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=6,tos=0"
+no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
+first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
+later_flow="$base_flow,frag=later)"
+
+ # mode no first later
+for tuple in \
+ 'normal 1 5 6' \
+ 'drop 1 drop drop' \
+ 'nx-match 1 2 6'
+do
+ set $tuple
+ mode=$1
+ no=$2
+ first=$3
+ later=$4
+
+ AT_CHECK([ovs-ofctl set-frags br0 $mode])
+ for type in no first later; do
+ eval flow=\$${type}_flow exp_output=\$$type
+ AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
+ AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $exp_output
+])
+ done
+done
+OVS_VSWITCHD_STOP
+AT_CLEANUP