tests: Remove the unit test for "ovs-appctl coverage/show".
[sliver-openvswitch.git] / tests / ofproto-dpif.at
index 2050443..87e3d0e 100644 (file)
@@ -1161,8 +1161,15 @@ in_port=2 actions=output:1
 ])
 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 
-odp_flow="in_port(1)"
+odp_flow="in_port(p1)"
 br_flow="in_port=1"
+# Test command: ofproto/trace odp_flow with in_port as a name.
+AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
+AT_CHECK([tail -1 stdout], [0], [dnl
+Datapath actions: 2
+])
+
+odp_flow="in_port(1)"
 # Test command: ofproto/trace odp_flow
 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
 AT_CHECK([tail -1 stdout], [0], [dnl
@@ -1307,7 +1314,7 @@ m4_foreach(
 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
   [2], [], [stderr])
 AT_CHECK([tail -2 stderr], [0], [dnl
-Cannot find datapath of this name
+Cannot find the datapath
 ovs-appctl: ovs-vswitchd: server returned an error
 ])])
 
@@ -1320,7 +1327,7 @@ m4_foreach(
 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
   [2], [], [stderr])
 AT_CHECK([tail -2 stderr], [0], [dnl
-Cannot find datapath of this name
+Cannot find the datapath
 ovs-appctl: ovs-vswitchd: server returned an error
 ])])
 
@@ -1333,7 +1340,7 @@ m4_foreach(
 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
   [2], [], [stderr])
 AT_CHECK([tail -2 stderr], [0], [dnl
-Cannot find datapath of this name
+Cannot find the datapath
 ovs-appctl: ovs-vswitchd: server returned an error
 ])])
 
@@ -1346,7 +1353,7 @@ m4_foreach(
 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
   [2], [], [stderr])
 AT_CHECK([tail -2 stderr], [0], [dnl
-Cannot find datapath of this name
+Cannot find the datapath
 ovs-appctl: ovs-vswitchd: server returned an error
 ])])
 
@@ -2834,37 +2841,67 @@ AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
+\f
+AT_BANNER([ofproto-dpif - flow translation resource limits])
 
-# Unit test for appctl coverage/show command
-AT_SETUP([ofproto-dpif - coverage/show])
+AT_SETUP([ofproto-dpif - infinite resubmit])
 OVS_VSWITCHD_START
-
-ovs-appctl time/stop
-# before the first 5 seconds, nothing can be calculated but the total count.
-# there should be two unixctl commands received, but the count of the "appctl
-# coverage/show" command is not updated to the total. so there show only 1.
-AT_CHECK([ovs-appctl coverage/show | sed -n '/^unixctl_received.*/p'], [], [dnl
-unixctl_received           0.0/sec     0.000/sec        0.0000/sec   total: 1
+AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
+AT_CHECK([ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
+  [0], [stdout])
+AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
 ])
-
-ovs-appctl time/warp 5000
-# at first 5 second time instant, should have stats.
-AT_CHECK([ovs-appctl coverage/show | sed -n '/^unixctl_received.*/p'], [], [dnl
-unixctl_received           0.6/sec     0.050/sec        0.0008/sec   total: 3
+AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
+  [0], [1
 ])
+OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
+AT_CLEANUP
 
-for i in `seq 0 10`; do ovs-appctl time/warp 5000; done
-# advance to first 1 minute time instant.
-AT_CHECK([ovs-appctl coverage/show | sed -n '/^unixctl_received.*/p'], [], [dnl
-unixctl_received           0.2/sec     0.250/sec        0.0042/sec   total: 15
-])
+AT_SETUP([ofproto-dpif - exponential resubmit chain])
+OVS_VSWITCHD_START
+ADD_OF_PORTS([br0], 1)
+(for i in `seq 1 64`; do
+     j=`expr $i + 1`
+     echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
+ done
+ echo "in_port=65, actions=local") > flows
+ AT_CHECK([ovs-ofctl add-flows br0 flows])
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
+AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
+])
+OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
+AT_CLEANUP
 
-ovs-appctl time/warp 60000
-# advance to next 1 minute time instant directly, should observe the per-minute
-# rate drop.
-AT_CHECK([ovs-appctl coverage/show | sed -n '/^unixctl_received.*/p'], [], [dnl
-unixctl_received           0.4/sec     0.033/sec        0.0047/sec   total: 17
-])
+AT_SETUP([ofproto-dpif - too many output actions])
+OVS_VSWITCHD_START
+ADD_OF_PORTS([br0], 1)
+(for i in `seq 1 12`; do
+     j=`expr $i + 1`
+     echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
+ done
+ echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
+AT_CHECK([ovs-ofctl add-flows br0 flows])
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
+AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
+])
+AT_CHECK([grep -c 'discarding oversize datapath actions' ovs-vswitchd.log], [0], [1
+])
+OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d
+/discarding oversize datapath actions/d"])
+AT_CLEANUP
 
-OVS_VSWITCHD_STOP
+AT_SETUP([ofproto-dpif - stack too deep])
+OVS_VSWITCHD_START
+ADD_OF_PORTS([br0], 1)
+(for i in `seq 1 12`; do
+     j=`expr $i + 1`
+     echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
+ done
+ push="push:NXM_NX_REG0[[]]"
+ echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
+ AT_CHECK([ovs-ofctl add-flows br0 flows])
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
+AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
+])
+OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
 AT_CLEANUP