ctdb-tests: Improve releaseip connection resetting tests
authorMartin Schwenke <martin@meltin.net>
Tue, 22 Aug 2017 06:37:30 +0000 (16:37 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 31 Aug 2017 22:13:06 +0000 (00:13 +0200)
Make the tests more general by setting up the IP address using a
"takeip" event.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/eventscripts/10.interface.010.sh [moved from ctdb/tests/eventscripts/10.interface.releaseip.010.sh with 76% similarity]
ctdb/tests/eventscripts/10.interface.011.sh [moved from ctdb/tests/eventscripts/10.interface.releaseip.011.sh with 82% similarity]
ctdb/tests/eventscripts/10.interface.012.sh [moved from ctdb/tests/eventscripts/10.interface.releaseip.012.sh with 84% similarity]
ctdb/tests/eventscripts/10.interface.013.sh [moved from ctdb/tests/eventscripts/10.interface.releaseip.013.sh with 87% similarity]

similarity index 76%
rename from ctdb/tests/eventscripts/10.interface.releaseip.010.sh
rename to ctdb/tests/eventscripts/10.interface.010.sh
index 095e85c9b7c20ed4e19dfdd187be4a8901bf0142..f5fa0622582a0a6c68b161bb9c0d61c70e6127ae 100755 (executable)
@@ -8,7 +8,8 @@ setup_ctdb
 
 ctdb_get_1_public_address |
 while read dev ip bits ; do
-       ip addr add "${ip}/${bits}" dev "$dev"
+       ok_null
+       simple_test_event "takeip" $dev $ip $bits
 
        count=10
        setup_tcp_connections $count \
@@ -18,5 +19,5 @@ while read dev ip bits ; do
 Killed ${count}/${count} TCP connections to released IP $ip
 EOF
 
-       simple_test $dev $ip $bits
+       simple_test_event "releaseip" $dev $ip $bits
 done
similarity index 82%
rename from ctdb/tests/eventscripts/10.interface.releaseip.011.sh
rename to ctdb/tests/eventscripts/10.interface.011.sh
index c129346db8eeda5e7cf04b254f48adecd53f3109..1b85cead0c30435b401083f7a889fd3cb9360d40 100755 (executable)
@@ -8,7 +8,8 @@ setup_ctdb
 
 ctdb_get_1_public_address |
 while read dev ip bits ; do
-       ip addr add "${ip}/${bits}" dev "$dev"
+       ok_null
+       simple_test_event "takeip" $dev $ip $bits
 
        count=10
        setup_tcp_connections $count \
@@ -23,5 +24,5 @@ Remaining connections:
   10.0.0.3:445 10.254.254.1:43211
 EOF
 
-       simple_test $dev $ip $bits
+       simple_test_event "releaseip" $dev $ip $bits
 done
similarity index 84%
rename from ctdb/tests/eventscripts/10.interface.releaseip.012.sh
rename to ctdb/tests/eventscripts/10.interface.012.sh
index 53971fec88d13ca7e69b421277639b1ca9e4c30d..03c6c792504d493561a43447c4038890485c004a 100755 (executable)
@@ -8,7 +8,8 @@ setup_ctdb
 
 ctdb_get_1_public_address |
 while read dev ip bits ; do
-       ip addr add "${ip}/${bits}" dev "$dev"
+       ok_null
+       simple_test_event "takeip" $dev $ip $bits
 
        count=10
 
@@ -26,5 +27,5 @@ Remaining connections:
   10.0.0.3:445 10.254.254.3:43213
 EOF
 
-       simple_test $dev $ip $bits
+       simple_test_event "releaseip"  $dev $ip $bits
 done
similarity index 87%
rename from ctdb/tests/eventscripts/10.interface.releaseip.013.sh
rename to ctdb/tests/eventscripts/10.interface.013.sh
index 91393d27ed90407db656fa23d5f872e4c7f92fca..eb4c2803ba09950f700d4a7817b3365a5c8bfc27 100755 (executable)
@@ -8,7 +8,8 @@ setup_ctdb
 
 ctdb_get_1_public_address |
 while read dev ip bits ; do
-       ip addr add "${ip}/${bits}" dev "$dev"
+       ok_null
+       simple_test_event "takeip" $dev $ip $bits
 
        setup_tcp_connections 0
 
@@ -31,5 +32,5 @@ Remaining connections:
   10.0.0.3:445 10.254.254.10:43220
 EOF
 
-    simple_test $dev $ip $bits
+    simple_test_event "releaseip"  $dev $ip $bits
 done