ovsdb-idl: Add interface to find out the permanent IDL of an inserted row.
[sliver-openvswitch.git] / tests / reconnect.at
index 33e4b95..95996ff 100644 (file)
@@ -104,15 +104,14 @@ enable
 run
   should connect
 connecting
-  in CONNECTING for 0 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (0 ms backoff)
 
 # Connect after 500 ms.
 advance 500
 
 ### t=1500 ###
-  in CONNECTING for 500 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 500 ms (0 ms backoff)
 run
-  should connect
 connected
   in ACTIVE for 0 ms (0 ms backoff)
   created 1000, last received 1000, last connected 1500
@@ -218,14 +217,13 @@ enable
 run
   should connect
 connecting
-  in CONNECTING for 0 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (0 ms backoff)
 run
-  should connect
 timeout
   advance 1000 ms
 
 ### t=2000 ###
-  in CONNECTING for 1000 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (0 ms backoff)
 run
   should disconnect
 connect-failed
@@ -243,12 +241,12 @@ run
 
 # Second connection attempt fails after 1000 ms.
 connecting
-  in CONNECTING for 0 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (1000 ms backoff)
 timeout
   advance 1000 ms
 
 ### t=4000 ###
-  in CONNECTING for 1000 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (1000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -266,12 +264,12 @@ run
 
 # Third connection attempt fails after 2000 ms.
 connecting
-  in CONNECTING for 0 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (2000 ms backoff)
 timeout
   advance 2000 ms
 
 ### t=8000 ###
-  in CONNECTING for 2000 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 2000 ms (2000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -289,12 +287,12 @@ run
 
 # Third connection attempt fails after 4000 ms.
 connecting
-  in CONNECTING for 0 ms (4000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (4000 ms backoff)
 timeout
   advance 4000 ms
 
 ### t=16000 ###
-  in CONNECTING for 4000 ms (4000 ms backoff)
+  in CONNECT_IN_PROGRESS for 4000 ms (4000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -312,12 +310,12 @@ run
 
 # Third connection attempt fails after 8000 ms.
 connecting
-  in CONNECTING for 0 ms (8000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (8000 ms backoff)
 timeout
   advance 8000 ms
 
 ### t=32000 ###
-  in CONNECTING for 8000 ms (8000 ms backoff)
+  in CONNECT_IN_PROGRESS for 8000 ms (8000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -335,12 +333,12 @@ run
 
 # Fourth connection attempt fails after 8000 ms.
 connecting
-  in CONNECTING for 0 ms (8000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (8000 ms backoff)
 timeout
   advance 8000 ms
 
 ### t=48000 ###
-  in CONNECTING for 8000 ms (8000 ms backoff)
+  in CONNECT_IN_PROGRESS for 8000 ms (8000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -563,14 +561,13 @@ enable
 run
   should connect
 connecting
-  in CONNECTING for 0 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (0 ms backoff)
 run
-  should connect
 timeout
   advance 1000 ms
 
 ### t=2000 ###
-  in CONNECTING for 1000 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (0 ms backoff)
 run
   should disconnect
 connect-failed
@@ -588,12 +585,12 @@ run
 
 # Second connection attempt fails after 1000 ms.
 connecting
-  in CONNECTING for 0 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (1000 ms backoff)
 timeout
   advance 1000 ms
 
 ### t=4000 ###
-  in CONNECTING for 1000 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (1000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -611,13 +608,12 @@ run
 
 # Third connection attempt succeeds after 500 ms.
 connecting
-  in CONNECTING for 0 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (2000 ms backoff)
 advance 500
 
 ### t=6500 ###
-  in CONNECTING for 500 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 500 ms (2000 ms backoff)
 run
-  should connect
 connected
   in ACTIVE for 0 ms (2000 ms backoff)
   created 1000, last received 1000, last connected 6500
@@ -708,14 +704,13 @@ enable
 run
   should connect
 connecting
-  in CONNECTING for 0 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (0 ms backoff)
 run
-  should connect
 timeout
   advance 1000 ms
 
 ### t=2000 ###
-  in CONNECTING for 1000 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (0 ms backoff)
 run
   should disconnect
 connect-failed
@@ -733,12 +728,12 @@ run
 
 # Second connection attempt fails after 1000 ms.
 connecting
-  in CONNECTING for 0 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (1000 ms backoff)
 timeout
   advance 1000 ms
 
 ### t=4000 ###
-  in CONNECTING for 1000 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (1000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -756,13 +751,12 @@ run
 
 # Third connection attempt succeeds after 500 ms.
 connecting
-  in CONNECTING for 0 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (2000 ms backoff)
 advance 500
 
 ### t=6500 ###
-  in CONNECTING for 500 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 500 ms (2000 ms backoff)
 run
-  should connect
 connected
   in ACTIVE for 0 ms (2000 ms backoff)
   created 1000, last received 1000, last connected 6500
@@ -874,14 +868,13 @@ enable
 run
   should connect
 connecting
-  in CONNECTING for 0 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (0 ms backoff)
 run
-  should connect
 timeout
   advance 1000 ms
 
 ### t=2000 ###
-  in CONNECTING for 1000 ms (0 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (0 ms backoff)
 run
   should disconnect
 connect-failed
@@ -899,12 +892,12 @@ run
 
 # Second connection attempt fails after 1000 ms.
 connecting
-  in CONNECTING for 0 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (1000 ms backoff)
 timeout
   advance 1000 ms
 
 ### t=4000 ###
-  in CONNECTING for 1000 ms (1000 ms backoff)
+  in CONNECT_IN_PROGRESS for 1000 ms (1000 ms backoff)
 run
   should disconnect
 connect-failed
@@ -922,13 +915,12 @@ run
 
 # Third connection attempt succeeds after 500 ms.
 connecting
-  in CONNECTING for 0 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 0 ms (2000 ms backoff)
 advance 500
 
 ### t=6500 ###
-  in CONNECTING for 500 ms (2000 ms backoff)
+  in CONNECT_IN_PROGRESS for 500 ms (2000 ms backoff)
 run
-  should connect
 connected
   in ACTIVE for 0 ms (2000 ms backoff)
   created 1000, last received 1000, last connected 6500
@@ -1037,3 +1029,83 @@ timeout
 ])
 AT_CLEANUP
 
+######################################################################
+AT_SETUP([max-tries of 1 honored])
+AT_KEYWORDS([reconnect])
+AT_DATA([input], [set-max-tries 1
+enable
+
+# Connection succeeds.
+run
+connected
+
+# Send inactivity probe.
+timeout
+run
+
+# Idle timeout kills connection.
+timeout
+run
+disconnected
+])
+OVS_CHECK_LCOV([test-reconnect < input], [0], 
+  [### t=1000 ###
+set-max-tries 1
+  1 tries left
+enable
+  in BACKOFF for 0 ms (0 ms backoff)
+  0 tries left
+
+# Connection succeeds.
+run
+  should connect
+connected
+  in ACTIVE for 0 ms (0 ms backoff)
+  1 successful connections out of 1 attempts, seqno 1
+  connected (0 ms), total 0 ms connected
+
+# Send inactivity probe.
+timeout
+  advance 5000 ms
+
+### t=6000 ###
+  in ACTIVE for 5000 ms (0 ms backoff)
+  connected (5000 ms), total 5000 ms connected
+run
+  should send probe
+  in IDLE for 0 ms (0 ms backoff)
+
+# Idle timeout kills connection.
+timeout
+  advance 5000 ms
+
+### t=11000 ###
+  in IDLE for 5000 ms (0 ms backoff)
+  connected (10000 ms), total 10000 ms connected
+run
+  should disconnect
+disconnected
+  in VOID for 0 ms (1000 ms backoff)
+  1 successful connections out of 1 attempts, seqno 2
+  not connected (0 ms), total 10000 ms connected
+])
+AT_CLEANUP
+
+######################################################################
+AT_SETUP([max-tries of 0 honored])
+AT_KEYWORDS([reconnect])
+AT_DATA([input], [set-max-tries 0
+enable
+run
+timeout
+])
+OVS_CHECK_LCOV([test-reconnect < input], [0], 
+  [### t=1000 ###
+set-max-tries 0
+  0 tries left
+enable
+run
+timeout
+  no timeout
+])
+AT_CLEANUP