Makefile.am: Clean flake8-check too.
[cascardo/ovs.git] / tests / learn.at
index 2ca58fc..31ff4fd 100644 (file)
@@ -91,6 +91,20 @@ ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
 ]])
 AT_CLEANUP
 
+AT_SETUP([learning action - too-long immediate value])
+dnl 129 bits is too long.
+AT_CHECK([[ovs-ofctl parse-flow 'actions=learn(load:0x1fedbca9876543210fedbca9876543210->NXM_NX_IPV6_DST[])']],
+  [1], [], [[ovs-ofctl: 0x1fedbca9876543210fedbca9876543210->NXM_NX_IPV6_DST[]: value does not fit into 128 bits
+]])
+
+dnl 128 bits is merely a bad prerequisite.
+AT_CHECK([[ovs-ofctl parse-flow 'actions=learn(load:0xfedbca9876543210fedbca9876543210->NXM_NX_IPV6_DST[])']], [1], [], [stderr])
+AT_CHECK([sed -e 's/.*|meta_flow|WARN|//' < stderr], [0],
+  [[destination field ipv6_dst lacks correct prerequisites
+ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
+]], [[]])
+AT_CLEANUP
+
 AT_SETUP([learning action - standard VLAN+MAC learning])
 OVS_VSWITCHD_START(
   [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
@@ -219,9 +233,7 @@ NXST_FLOW reply:
 done
 
 # Make sure that 15 seconds without refreshing makes the flow time out.
-ovs-appctl time/warp 5000
-ovs-appctl time/warp 5000
-ovs-appctl time/warp 5000
+ovs-appctl time/warp 15000 5000
 sleep 1
 AT_CHECK([ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort], [0], [dnl
  table=1, priority=0 actions=FLOOD
@@ -290,7 +302,7 @@ AT_CLEANUP
 # flow.
 AT_SETUP([learning action - self-modifying flow])
 OVS_VSWITCHD_START
-ADD_OF_PORTS([br0], 1, 2, 3)
+add_of_ports br0 1 2 3
 
 ovs-appctl time/stop
 # Set up flow table for TCPv4 port learning.
@@ -315,7 +327,7 @@ NXST_FLOW reply:
 
 # Check that the first packet went out port 2 and the rest out port 3.
 AT_CHECK(
-  [(ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | STRIP_XIDS], [0],
+  [(ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | strip_xids], [0],
   [OFPST_PORT reply: 1 ports
   port  2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
            tx pkts=1, bytes=60, drop=0, errs=0, coll=0
@@ -332,7 +344,7 @@ AT_CLEANUP
 # attributed correctly.
 AT_SETUP([learning action - self-modifying flow with idle_timeout])
 OVS_VSWITCHD_START
-ADD_OF_PORTS([br0], 1, 2, 3)
+add_of_ports br0 1 2 3
 
 ovs-appctl time/stop
 # Set up flow table for TCPv4 port learning.
@@ -366,7 +378,7 @@ done
 # Check that the first packet of each flow went out port 2 and the rest out
 # port 3.
 AT_CHECK(
-  [(ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | STRIP_XIDS], [0],
+  [(ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | strip_xids], [0],
   [OFPST_PORT reply: 1 ports
   port  2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
            tx pkts=2, bytes=120, drop=0, errs=0, coll=0
@@ -390,7 +402,7 @@ AT_CLEANUP
 # attributed correctly.
 AT_SETUP([learning action - self-modifying flow with hard_timeout])
 OVS_VSWITCHD_START
-ADD_OF_PORTS([br0], 1, 2, 3)
+add_of_ports br0 1 2 3
 
 ovs-appctl time/stop
 # Set up flow table for TCPv4 port learning.
@@ -452,7 +464,7 @@ done
 # Check that the first packet of each flow went out port 2 and the rest out
 # port 3.
 AT_CHECK(
-  [(ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | STRIP_XIDS], [0],
+  [(ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | strip_xids], [0],
   [OFPST_PORT reply: 1 ports
   port  2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
            tx pkts=3, bytes=180, drop=0, errs=0, coll=0