ctdb-tests: Use consistent NAT gateway nodes file
authorMartin Schwenke <martin@meltin.net>
Mon, 12 Feb 2018 00:34:57 +0000 (11:34 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 1 Mar 2018 18:39:14 +0000 (19:39 +0100)
Using a different file each time causes the event script to believe
that the configuration has changed even though only the node states
have changed.  Change this to stop the tests from doing something
unexpected.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/eventscripts/11.natgw.015.sh
ctdb/tests/eventscripts/11.natgw.025.sh
ctdb/tests/eventscripts/scripts/local.sh

index c7e0c15262f39e2eab0de82ff2271876d9be9aa5..691b363ef1bfc39e49418b74aadf164d353a4ced 100755 (executable)
@@ -33,7 +33,7 @@ setup_ctdb_natgw <<EOF
 192.168.1.24
 EOF
 
-ok "NAT gateway configuration has changed"
+ok_null
 simple_test_event "ipreallocated"
 
 ok "default via ${FAKE_CTDB_NATGW_MASTER} dev ethXXX  metric 10 "
@@ -51,7 +51,7 @@ setup_ctdb_natgw <<EOF
 192.168.1.24
 EOF
 
-ok "NAT gateway configuration has changed"
+ok_null
 simple_test_event "ipreallocated"
 
 ok "default via ${CTDB_NATGW_DEFAULT_GATEWAY} dev ethXXX  metric 10 "
@@ -59,4 +59,3 @@ simple_test_command ip route show
 
 ok_natgw_master_ip_addr_show
 simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE"
-
index 456fc3c030f691414468dddcd8bffa117b4361b7..60602d3ead99ac1c0be11b237117e5510d880fec 100755 (executable)
@@ -35,7 +35,7 @@ setup_ctdb_natgw <<EOF
 192.168.1.24
 EOF
 
-ok "NAT gateway configuration has changed"
+ok_null
 simple_test_event "ipreallocated"
 
 ok_natgw_slave_static_routes
@@ -53,7 +53,7 @@ setup_ctdb_natgw <<EOF
 192.168.1.24
 EOF
 
-ok "NAT gateway configuration has changed"
+ok_null
 simple_test_event "ipreallocated"
 
 ok_natgw_master_static_routes
index 65676e08b21c67dd54ead118717c9c367c11611d..adaad08a9b1e1348acdfcb2bd9e8829e11bfd02b 100644 (file)
@@ -728,9 +728,7 @@ setup_ctdb_natgw ()
        natgw_config_dir="${TEST_VAR_DIR}/natgw_config"
        mkdir -p "$natgw_config_dir"
 
-       # These will accumulate, 1 per test... but will be cleaned up at
-       # the end.
-       export CTDB_NATGW_NODES=$(mktemp --tmpdir="$natgw_config_dir")
+       export CTDB_NATGW_NODES="${natgw_config_dir}/natgw_nodes"
 
        # Read from stdin
        while read _ip _opts ; do