ctdb-tests: Move variable FAKE_IP_STATE into the ip stub
authorMartin Schwenke <martin@meltin.net>
Thu, 8 Feb 2018 05:29:05 +0000 (16:29 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 28 Mar 2018 00:57:16 +0000 (02:57 +0200)
It is the only user of this variable.

This is now a subdirectory of FAKE_NETWORK_STATE.

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

index 48fdf31bc6efb2ea4fc1812baf06f8985e57a7d5..3f237d0d8421ceaab37cbf6a8d7d6d34c265e5a7 100644 (file)
@@ -85,15 +85,6 @@ setup_generic ()
     mkdir -p "$FAKE_ETHTOOL_LINK_DOWN"
     rm -f "$FAKE_ETHTOOL_LINK_DOWN"/*
 
-    # This can only have 2 levels.  We don't want to resort to usings
-    # something dangerous like "rm -r" setup time.
-    export FAKE_IP_STATE="$EVENTSCRIPTS_TESTS_VAR_DIR/fake-ip-state"
-    mkdir -p "$FAKE_IP_STATE"
-    rm -f "$FAKE_IP_STATE"/*/*
-    rm -f "$FAKE_IP_STATE"/* 2>/dev/null || true
-    rmdir "$FAKE_IP_STATE"/* 2>/dev/null || true
-
-
     export CTDB_DBDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/db"
     export CTDB_DBDIR_PERSISTENT="${CTDB_DBDIR}/persistent"
     export CTDB_DBDIR_STATE="${CTDB_DBDIR}/state"
index af155beb188b4876c2a443c4c23433ad7297dfa7..1c4ad35b50a5d74e14c1b8ec3d91b72454fb9f07 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+FAKE_IP_STATE="${FAKE_NETWORK_STATE}/ip-state"
+mkdir -p "$FAKE_IP_STATE"
+
 promote_secondaries=true
 
 not_implemented ()