[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Tue Sep 24 03:47:03 UTC 2019


The branch, master has been updated
       via  b8f4f141a2d ctdb-tests: Switch TEST_VAR_DIR to a local script variable
       via  e78c1a0ca22 ctdb-tests: Use CTDB_TEST_TMP_DIR in integration.bash
       via  263890b36db ctdb-tests: Switch simple tests to use CTDB_TEST_TMP_DIR
       via  def929954aa ctdb-tests: Switch takeover helper unit tests to use CTDB_TEST_TMP_DIR
       via  1934f673dc7 ctdb-tests: Switch tool unit tests to use CTDB_TEST_TMP_DIR
       via  18ecdbfb02e ctdb-tests: Switch onnode unit tests to use CTDB_TEST_TMP_DIR
       via  3b16aa2016e ctdb-tests: Switch eventscript unit tests to use CTDB_TEST_TMP_DIR
       via  96aa807f79d ctdb-tests: Switch eventd unit tests to use CTDB_TEST_TMP_DIR
       via  cbd27c0a142 ctdb-tests: Switch cunit unit tests to use CTDB_TEST_TMP_DIR
       via  cec8f3907ef ctdb-tests: Add new variable CTDB_TEST_TMP_DIR
       via  e9ce035c2d2 ctdb-tests: Move setting of CTDB_TEST_SUITE_DIR to run_tests.sh
       via  02edfb0f199 ctdb-tests: Rename variable TEST_SUBDIR -> CTDB_TEST_SUITE_DIR
       via  f331f3f723a ctdb-tests: Use local_daemons.sh onnode for local daemons tests
       via  ae1e8002b09 ctdb-tests: Use local $ctdb_base instead of $CTDB_BASE
       via  08fea1ced39 ctdb-tests: Generalise pattern for matching valgrind memcheck executable
      from  c7e6db97de9 smbd: Add an error return END_PROFILE call

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b8f4f141a2d7aed9a8af572b27e2afcc1365bf3b
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 9 17:59:15 2019 +1000

    ctdb-tests: Switch TEST_VAR_DIR to a local script variable
    
    This is now local to run_tests.sh.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue Sep 24 03:46:59 UTC 2019 on sn-devel-184

commit e78c1a0ca2254b533ffa1ab27184e73e79819962
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 9 16:13:45 2019 +1000

    ctdb-tests: Use CTDB_TEST_TMP_DIR in integration.bash
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 263890b36dbe23460a3d38050250d6d792907426
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 5 13:57:35 2019 +1000

    ctdb-tests: Switch simple tests to use CTDB_TEST_TMP_DIR
    
    CTDB_TEST_TMP_DIR repaces SIMPLE_TESTS_VAR_DIR.  local.bash no longer
    needs to ensure that TEST_VAR_DIR is set, since it longer uses this
    variable.  Drop the comment because state has not been maintained
    between tests for some time.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit def929954aa26116fc5356203b313b50fcb6d7a8
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 21:35:39 2019 +1000

    ctdb-tests: Switch takeover helper unit tests to use CTDB_TEST_TMP_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 1934f673dc7aadf8eb288d4ac1b46876d442e039
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 21:35:16 2019 +1000

    ctdb-tests: Switch tool unit tests to use CTDB_TEST_TMP_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 18ecdbfb02e64ae7942378efb69df7541b5859f0
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 19:58:46 2019 +1000

    ctdb-tests: Switch onnode unit tests to use CTDB_TEST_TMP_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3b16aa2016e499af96c4cbb3de4cb38515e86284
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 20:13:19 2019 +1000

    ctdb-tests: Switch eventscript unit tests to use CTDB_TEST_TMP_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 96aa807f79df99c0fd64ea66d7f83527d5a490c2
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 21:35:54 2019 +1000

    ctdb-tests: Switch eventd unit tests to use CTDB_TEST_TMP_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit cbd27c0a14247477acdf158cc40864afe91e5900
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 21:47:52 2019 +1000

    ctdb-tests: Switch cunit unit tests to use CTDB_TEST_TMP_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit cec8f3907ef7b324035b59f9a965c198b5d03de6
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 5 13:42:26 2019 +1000

    ctdb-tests: Add new variable CTDB_TEST_TMP_DIR
    
    This is a subdirectory of TEST_VAR_DIR that is unique to the current
    test suite.  It is recreated for each individual test.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e9ce035c2d2ef6fd177a3bb10031162586b696bd
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 9 16:19:52 2019 +1000

    ctdb-tests: Move setting of CTDB_TEST_SUITE_DIR to run_tests.sh
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 02edfb0f199fb7206df1f725aee56826d65716c1
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 6 20:54:37 2019 +1000

    ctdb-tests: Rename variable TEST_SUBDIR -> CTDB_TEST_SUITE_DIR
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f331f3f723a4e26af2d5c356cb9b72d062df6311
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 5 15:47:13 2019 +1000

    ctdb-tests: Use local_daemons.sh onnode for local daemons tests
    
    With some upcoming changes, the setting of CTDB_BASE becomes
    problematic because it will be included unconditionally whereas it is
    currently being conveniently and almost accidentally not include in
    some contexts.
    
    So, instead of trying to coerce onnode into behaving as desired, have
    the local daemons tests use local_daemons.sh onnode directly.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit ae1e8002b09f0035712df236f4b5efc85d7ad1d6
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 23 16:57:36 2019 +1000

    ctdb-tests: Use local $ctdb_base instead of $CTDB_BASE
    
    The latter might not be defined in a test.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 08fea1ced39652954ae44d8cdc4dc405b31786b6
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 23 16:13:05 2019 +1000

    ctdb-tests: Generalise pattern for matching valgrind memcheck executable
    
    On my laptop this is "memcheck-amd64-linux instead of just "memcheck".
    
    Alternatively, this part of the test could simply be skipped if
    $VALGRIND is set.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/tests/README                                |  6 ++--
 ctdb/tests/cunit/cluster_mutex_001.sh            |  2 +-
 ctdb/tests/cunit/cluster_mutex_002.sh            |  2 +-
 ctdb/tests/cunit/cluster_mutex_003.sh            |  2 +-
 ctdb/tests/cunit/comm_test_002.sh                |  2 +-
 ctdb/tests/cunit/conf_test_001.sh                |  2 +-
 ctdb/tests/cunit/config_test_001.sh              |  2 +-
 ctdb/tests/cunit/config_test_002.sh              |  2 +-
 ctdb/tests/cunit/config_test_003.sh              |  2 +-
 ctdb/tests/cunit/config_test_004.sh              |  2 +-
 ctdb/tests/cunit/config_test_005.sh              |  2 +-
 ctdb/tests/cunit/config_test_006.sh              |  2 +-
 ctdb/tests/cunit/config_test_007.sh              |  2 +-
 ctdb/tests/cunit/event_script_test_001.sh        |  2 +-
 ctdb/tests/cunit/line_test_001.sh                |  2 +-
 ctdb/tests/cunit/path_tests_001.sh               |  2 +-
 ctdb/tests/cunit/pidfile_test_001.sh             |  2 +-
 ctdb/tests/cunit/porting_tests_001.sh            |  2 +-
 ctdb/tests/cunit/run_event_001.sh                |  2 +-
 ctdb/tests/cunit/run_proc_001.sh                 |  6 ++--
 ctdb/tests/cunit/sock_daemon_test_001.sh         |  4 +--
 ctdb/tests/cunit/sock_io_test_001.sh             |  2 +-
 ctdb/tests/cunit/system_socket_test_001.sh       |  2 +-
 ctdb/tests/eventd/scripts/local.sh               |  2 +-
 ctdb/tests/eventscripts/13.per_ip_routing.024.sh |  2 +-
 ctdb/tests/eventscripts/scripts/01.reclock.sh    |  2 +-
 ctdb/tests/eventscripts/scripts/60.nfs.sh        |  8 ++---
 ctdb/tests/eventscripts/scripts/local.sh         | 33 +++++++----------
 ctdb/tests/eventscripts/stubs/ctdb               |  4 +--
 ctdb/tests/eventscripts/stubs/service            |  2 +-
 ctdb/tests/local_daemons.sh                      |  9 ++---
 ctdb/tests/onnode/scripts/local.sh               | 15 +++-----
 ctdb/tests/onnode/stubs/ctdb                     |  4 +--
 ctdb/tests/run_tests.sh                          | 45 +++++++++++++++++-------
 ctdb/tests/scripts/common.sh                     | 10 ++----
 ctdb/tests/scripts/integration.bash              |  4 +--
 ctdb/tests/scripts/unit.sh                       |  2 +-
 ctdb/tests/simple/06_ctdb_getpid.sh              | 20 ++++++-----
 ctdb/tests/simple/90_debug_hung_script.sh        |  2 +-
 ctdb/tests/simple/scripts/local.bash             | 10 +-----
 ctdb/tests/simple/scripts/local_daemons.bash     | 11 +++---
 ctdb/tests/takeover_helper/scripts/local.sh      |  4 +--
 ctdb/tests/tool/scripts/local.sh                 |  4 +--
 43 files changed, 119 insertions(+), 130 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/tests/README b/ctdb/tests/README
index bbda3313850..1ab96a89b41 100644
--- a/ctdb/tests/README
+++ b/ctdb/tests/README
@@ -62,7 +62,7 @@ Some of the more useful options include:
 
   -e  Exit on the first test failure
 
-  -C  Clean up - kill daemons and remove $TEST_VAR_DIR when done
+  -C  Clean up when done by removing test state directory
 
       Tests uses a temporary/var directory for test state.  By default,
       this directory is not removed when tests are complete, so you
@@ -70,9 +70,7 @@ Some of the more useful options include:
       have failed against the same directory (with the same local
       daemons setup).  So this option cleans things up.
 
-      Also kills local daemons associated with directory.
-
-  -V  Use <dir> as $TEST_VAR_DIR
+  -V  Use <dir> as test state directory
 
       Use the specified temporary temporary/var directory.
 
diff --git a/ctdb/tests/cunit/cluster_mutex_001.sh b/ctdb/tests/cunit/cluster_mutex_001.sh
index feb78f3efa8..eaa7b2d5b1c 100755
--- a/ctdb/tests/cunit/cluster_mutex_001.sh
+++ b/ctdb/tests/cunit/cluster_mutex_001.sh
@@ -7,7 +7,7 @@
 t="${CTDB_SCRIPTS_HELPER_BINDIR}/ctdb_mutex_fcntl_helper"
 export CTDB_CLUSTER_MUTEX_HELPER="$t"
 
-lockfile="${TEST_VAR_DIR}/cluster_mutex.lockfile"
+lockfile="${CTDB_TEST_TMP_DIR}/cluster_mutex.lockfile"
 trap 'rm -f ${lockfile}' 0
 
 ok <<EOF
diff --git a/ctdb/tests/cunit/cluster_mutex_002.sh b/ctdb/tests/cunit/cluster_mutex_002.sh
index 97fbbfc24d3..c36a9f583a9 100755
--- a/ctdb/tests/cunit/cluster_mutex_002.sh
+++ b/ctdb/tests/cunit/cluster_mutex_002.sh
@@ -6,7 +6,7 @@
 
 export CTDB_CLUSTER_MUTEX_HELPER="/bin/false"
 
-lockfile="${TEST_VAR_DIR}/cluster_mutex.lockfile"
+lockfile="${CTDB_TEST_TMP_DIR}/cluster_mutex.lockfile"
 trap 'rm ${lockfile}' 0
 
 t="${CTDB_SCRIPTS_HELPER_BINDIR}/ctdb_mutex_fcntl_helper"
diff --git a/ctdb/tests/cunit/cluster_mutex_003.sh b/ctdb/tests/cunit/cluster_mutex_003.sh
index 5f351d9e9e1..e4f95c1f509 100755
--- a/ctdb/tests/cunit/cluster_mutex_003.sh
+++ b/ctdb/tests/cunit/cluster_mutex_003.sh
@@ -9,7 +9,7 @@
 
 export CTDB_CLUSTER_MUTEX_HELPER="/bin/false"
 
-lockfile="${TEST_VAR_DIR}/cluster_mutex.lockfile"
+lockfile="${CTDB_TEST_TMP_DIR}/cluster_mutex.lockfile"
 trap 'rm ${lockfile}' 0
 
 if [ -n "$CTDB_TEST_MUTEX_HELPER" ] ; then
diff --git a/ctdb/tests/cunit/comm_test_002.sh b/ctdb/tests/cunit/comm_test_002.sh
index 76ee62d1a24..a2fbf5189be 100755
--- a/ctdb/tests/cunit/comm_test_002.sh
+++ b/ctdb/tests/cunit/comm_test_002.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-socket="${TEST_VAR_DIR}/test_sock.$$"
+socket="${CTDB_TEST_TMP_DIR}/test_sock.$$"
 num_clients=10
 
 remove_socket ()
diff --git a/ctdb/tests/cunit/conf_test_001.sh b/ctdb/tests/cunit/conf_test_001.sh
index bad1c1d2c78..188964e41f6 100755
--- a/ctdb/tests/cunit/conf_test_001.sh
+++ b/ctdb/tests/cunit/conf_test_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-conffile="${TEST_VAR_DIR}/config.$$"
+conffile="${CTDB_TEST_TMP_DIR}/config.$$"
 
 remove_files ()
 {
diff --git a/ctdb/tests/cunit/config_test_001.sh b/ctdb/tests/cunit/config_test_001.sh
index d213aa88bfd..9a8682b04e6 100755
--- a/ctdb/tests/cunit/config_test_001.sh
+++ b/ctdb/tests/cunit/config_test_001.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="${CTDB_BASE}/ctdb.conf"
 
diff --git a/ctdb/tests/cunit/config_test_002.sh b/ctdb/tests/cunit/config_test_002.sh
index 6491fa811a1..ad6d381d4ed 100755
--- a/ctdb/tests/cunit/config_test_002.sh
+++ b/ctdb/tests/cunit/config_test_002.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="${CTDB_BASE}/ctdb.conf"
 
diff --git a/ctdb/tests/cunit/config_test_003.sh b/ctdb/tests/cunit/config_test_003.sh
index 28b06226866..4e8d55397c0 100755
--- a/ctdb/tests/cunit/config_test_003.sh
+++ b/ctdb/tests/cunit/config_test_003.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="${CTDB_BASE}/ctdb.conf"
 scriptfile="${CTDB_BASE}/debug-hung-script.sh"
diff --git a/ctdb/tests/cunit/config_test_004.sh b/ctdb/tests/cunit/config_test_004.sh
index 4578bdb543c..10a36567dac 100755
--- a/ctdb/tests/cunit/config_test_004.sh
+++ b/ctdb/tests/cunit/config_test_004.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="$CTDB_BASE/ctdb.conf"
 
diff --git a/ctdb/tests/cunit/config_test_005.sh b/ctdb/tests/cunit/config_test_005.sh
index cd48a84a78a..c16a43f8265 100755
--- a/ctdb/tests/cunit/config_test_005.sh
+++ b/ctdb/tests/cunit/config_test_005.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_HELPER_BINDIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="${CTDB_BASE}/ctdb.conf"
 scriptfile="${CTDB_BASE}/debug_locks.sh"
diff --git a/ctdb/tests/cunit/config_test_006.sh b/ctdb/tests/cunit/config_test_006.sh
index d367cd48c2e..11b23fce0e5 100755
--- a/ctdb/tests/cunit/config_test_006.sh
+++ b/ctdb/tests/cunit/config_test_006.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_HELPER_BINDIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="${CTDB_BASE}/ctdb.conf"
 
diff --git a/ctdb/tests/cunit/config_test_007.sh b/ctdb/tests/cunit/config_test_007.sh
index adffeb7b1ca..8804448af89 100755
--- a/ctdb/tests/cunit/config_test_007.sh
+++ b/ctdb/tests/cunit/config_test_007.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_HELPER_BINDIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 conffile="${CTDB_BASE}/ctdb.conf"
 
diff --git a/ctdb/tests/cunit/event_script_test_001.sh b/ctdb/tests/cunit/event_script_test_001.sh
index 0ef93653dc7..0d6a38e9dea 100755
--- a/ctdb/tests/cunit/event_script_test_001.sh
+++ b/ctdb/tests/cunit/event_script_test_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-scriptdir="${TEST_VAR_DIR}/cunit/scriptdir"
+scriptdir="${CTDB_TEST_TMP_DIR}/scriptdir"
 mkdir -p "${scriptdir}"
 
 scriptdir=$(cd "$scriptdir" && echo "$PWD")
diff --git a/ctdb/tests/cunit/line_test_001.sh b/ctdb/tests/cunit/line_test_001.sh
index 991d01a24e7..5676893ba17 100755
--- a/ctdb/tests/cunit/line_test_001.sh
+++ b/ctdb/tests/cunit/line_test_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-tfile="${TEST_VAR_DIR}/line.$$"
+tfile="${CTDB_TEST_TMP_DIR}/line.$$"
 
 remove_files ()
 {
diff --git a/ctdb/tests/cunit/path_tests_001.sh b/ctdb/tests/cunit/path_tests_001.sh
index 7b2ff129b71..5713fc88bae 100755
--- a/ctdb/tests/cunit/path_tests_001.sh
+++ b/ctdb/tests/cunit/path_tests_001.sh
@@ -4,7 +4,7 @@
 
 PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
 
-setup_ctdb_base "${TEST_VAR_DIR}" "cunit"
+setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
 
 ok <<EOF
 $CTDB_BASE/ctdb.conf
diff --git a/ctdb/tests/cunit/pidfile_test_001.sh b/ctdb/tests/cunit/pidfile_test_001.sh
index fb80d62cf6f..cf484039cbf 100755
--- a/ctdb/tests/cunit/pidfile_test_001.sh
+++ b/ctdb/tests/cunit/pidfile_test_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-pidfile=$(TMPDIR="$TEST_VAR_DIR" mktemp)
+pidfile=$(TMPDIR="$CTDB_TEST_TMP_DIR" mktemp)
 
 ok_null
 unit_test pidfile_test $pidfile
diff --git a/ctdb/tests/cunit/porting_tests_001.sh b/ctdb/tests/cunit/porting_tests_001.sh
index 45ae6194610..52291b20cc6 100755
--- a/ctdb/tests/cunit/porting_tests_001.sh
+++ b/ctdb/tests/cunit/porting_tests_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-socket="${TEST_VAR_DIR}/test_sock.$$"
+socket="${CTDB_TEST_TMP_DIR}/test_sock.$$"
 
 remove_socket ()
 {
diff --git a/ctdb/tests/cunit/run_event_001.sh b/ctdb/tests/cunit/run_event_001.sh
index 75c51111b14..50051bfaab2 100755
--- a/ctdb/tests/cunit/run_event_001.sh
+++ b/ctdb/tests/cunit/run_event_001.sh
@@ -8,7 +8,7 @@ run_event_init() failed, ret=2
 EOF
 unit_test run_event_test /a/b/c list
 
-scriptdir=$(TMPDIR="$TEST_VAR_DIR" mktemp -d)
+scriptdir=$(TMPDIR="$CTDB_TEST_TMP_DIR" mktemp -d)
 
 # Empty directory
 ok <<EOF
diff --git a/ctdb/tests/cunit/run_proc_001.sh b/ctdb/tests/cunit/run_proc_001.sh
index ac0c0da6ca4..3f48885298d 100755
--- a/ctdb/tests/cunit/run_proc_001.sh
+++ b/ctdb/tests/cunit/run_proc_001.sh
@@ -9,7 +9,7 @@ EOF
 unit_test run_proc_test 0 -1 /a/b/c
 
 # Non-executable path
-prog=$(TMPDIR="$TEST_VAR_DIR" mktemp)
+prog=$(TMPDIR="$CTDB_TEST_TMP_DIR" mktemp)
 cat > "$prog" <<EOF
 echo hello
 EOF
@@ -49,7 +49,7 @@ EOF
 unit_test run_proc_test 5 -1 "$prog"
 
 # Redirected output
-output=$(TMPDIR="$TEST_VAR_DIR" mktemp)
+output=$(TMPDIR="$CTDB_TEST_TMP_DIR" mktemp)
 cat > "$prog" <<EOF
 #!/bin/sh
 exec >"$output" 2>&1
@@ -110,7 +110,7 @@ EOF
 unit_test run_proc_test 1 -1 "$prog"
 
 # No zombie processes
-pidfile=$(TMPDIR="$TEST_VAR_DIR" mktemp)
+pidfile=$(TMPDIR="$CTDB_TEST_TMP_DIR" mktemp)
 
 cat > "$prog" <<EOF
 #!/bin/sh
diff --git a/ctdb/tests/cunit/sock_daemon_test_001.sh b/ctdb/tests/cunit/sock_daemon_test_001.sh
index 1b64c2ca9ff..54796079941 100755
--- a/ctdb/tests/cunit/sock_daemon_test_001.sh
+++ b/ctdb/tests/cunit/sock_daemon_test_001.sh
@@ -2,8 +2,8 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-pidfile="${TEST_VAR_DIR}/sock_daemon_test.pid.$$"
-sockpath="${TEST_VAR_DIR}/sock_daemon_test.sock.$$"
+pidfile="${CTDB_TEST_TMP_DIR}/sock_daemon_test.pid.$$"
+sockpath="${CTDB_TEST_TMP_DIR}/sock_daemon_test.sock.$$"
 
 remove_files ()
 {
diff --git a/ctdb/tests/cunit/sock_io_test_001.sh b/ctdb/tests/cunit/sock_io_test_001.sh
index 1ead2f37508..09a280c45e7 100755
--- a/ctdb/tests/cunit/sock_io_test_001.sh
+++ b/ctdb/tests/cunit/sock_io_test_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-sockpath="${TEST_VAR_DIR}/sock_daemon_test.sock.$$"
+sockpath="${CTDB_TEST_TMP_DIR}/sock_daemon_test.sock.$$"
 
 ok_null
 
diff --git a/ctdb/tests/cunit/system_socket_test_001.sh b/ctdb/tests/cunit/system_socket_test_001.sh
index 3fe9db39e13..4a74b8c64a0 100755
--- a/ctdb/tests/cunit/system_socket_test_001.sh
+++ b/ctdb/tests/cunit/system_socket_test_001.sh
@@ -2,7 +2,7 @@
 
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
-out_file="${TEST_VAR_DIR}/cunit/packet.out"
+out_file="${CTDB_TEST_TMP_DIR}/packet.out"
 
 remove_file ()
 {
diff --git a/ctdb/tests/eventd/scripts/local.sh b/ctdb/tests/eventd/scripts/local.sh
index 9668632dca3..2cb1115fcf9 100644
--- a/ctdb/tests/eventd/scripts/local.sh
+++ b/ctdb/tests/eventd/scripts/local.sh
@@ -10,7 +10,7 @@ else
     debug () { : ; }
 fi
 
-setup_ctdb_base "${TEST_VAR_DIR}" "eventd"
+setup_ctdb_base "$CTDB_TEST_TMP_DIR" "ctdb-etc"
 
 ctdb_config=$(ctdb-path config)
 eventd_socket=$(ctdb-path socket eventd)
diff --git a/ctdb/tests/eventscripts/13.per_ip_routing.024.sh b/ctdb/tests/eventscripts/13.per_ip_routing.024.sh
index 809573d0936..7b1af3705aa 100755
--- a/ctdb/tests/eventscripts/13.per_ip_routing.024.sh
+++ b/ctdb/tests/eventscripts/13.per_ip_routing.024.sh
@@ -9,7 +9,7 @@ setup
 create_policy_routing_config 1 default
 
 _rt_tables="$CTDB_SYS_ETCDIR/iproute2/rt_tables"
-_rt_orig=$(TMPDIR="$EVENTSCRIPTS_TESTS_VAR_DIR" mktemp)
+_rt_orig=$(TMPDIR="$CTDB_TEST_TMP_DIR" mktemp)
 cp "$_rt_tables" "$_rt_orig"
 
 ctdb_get_1_public_address | {
diff --git a/ctdb/tests/eventscripts/scripts/01.reclock.sh b/ctdb/tests/eventscripts/scripts/01.reclock.sh
index 25c845f667b..cc1f086bb2c 100644
--- a/ctdb/tests/eventscripts/scripts/01.reclock.sh
+++ b/ctdb/tests/eventscripts/scripts/01.reclock.sh
@@ -3,7 +3,7 @@ setup ()
 	if [ $# -eq 1 ] ; then
 		reclock="$1"
 	else
-		reclock="${EVENTSCRIPTS_TESTS_VAR_DIR}/reclock_subdir/rec.lock"
+		reclock="${CTDB_TEST_TMP_DIR}/reclock_subdir/rec.lock"
 	fi
 	CTDB_RECOVERY_LOCK="$reclock"
 
diff --git a/ctdb/tests/eventscripts/scripts/60.nfs.sh b/ctdb/tests/eventscripts/scripts/60.nfs.sh
index 195f7ffd780..59cdeda9b96 100644
--- a/ctdb/tests/eventscripts/scripts/60.nfs.sh
+++ b/ctdb/tests/eventscripts/scripts/60.nfs.sh
@@ -15,7 +15,7 @@ setup ()
 	setup_script_options <<EOF
 CTDB_NFS_SKIP_SHARE_CHECK="no"
 # This doesn't even need to exist
-CTDB_NFS_EXPORTS_FILE="$EVENTSCRIPTS_TESTS_VAR_DIR/etc-exports"
+CTDB_NFS_EXPORTS_FILE="${CTDB_TEST_TMP_DIR}/etc-exports"
 EOF
 
 	export RPCNFSDCOUNT
@@ -112,7 +112,7 @@ nfs_setup_fake_threads ()
 
 	case "$_prog" in
 	nfsd)
-		export PROCFS_PATH="${EVENTSCRIPTS_TESTS_VAR_DIR}/proc"
+		export PROCFS_PATH="${CTDB_TEST_TMP_DIR}/proc"
 		_threads="${PROCFS_PATH}/fs/nfsd/threads"
 		mkdir -p $(dirname "$_threads")
 		echo $# >"$_threads"
@@ -232,9 +232,9 @@ rpc_set_service_failure_response ()
 	[ -r "$_file" ] || \
 		die "RPC check file \"$_file\" does not exist or is not unique"
 
-	_out="${EVENTSCRIPTS_TESTS_VAR_DIR}/rpc_failure_output"
+	_out="${CTDB_TEST_TMP_DIR}/rpc_failure_output"
 	: >"$_out"
-	_rc_file="${EVENTSCRIPTS_TESTS_VAR_DIR}/rpc_result"
+	_rc_file="${CTDB_TEST_TMP_DIR}/rpc_result"
 
 	(
 		# Subshell to restrict scope variables...
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index c0eb72badd1..e1b92b41fbe 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -4,7 +4,7 @@
 # Augment PATH with relevant stubs/ directories.
 #
 
-stubs_dir="${TEST_SUBDIR}/stubs"
+stubs_dir="${CTDB_TEST_SUITE_DIR}/stubs"
 [ -d "${stubs_dir}" ] || die "Failed to locate stubs/ subdirectory"
 
 # Make the path absolute for tests that change directory
@@ -21,37 +21,30 @@ PATH="${stubs_dir}:${PATH}"
 
 export CTDB="ctdb"
 
-[ -n "$TEST_VAR_DIR" ] || die "TEST_VAR_DIR unset"
-export EVENTSCRIPTS_TESTS_VAR_DIR="${TEST_VAR_DIR}/unit_eventscripts"
-if [ -d "$EVENTSCRIPTS_TESTS_VAR_DIR" ] ; then
-	rm -r "$EVENTSCRIPTS_TESTS_VAR_DIR"
-fi
-mkdir -p "$EVENTSCRIPTS_TESTS_VAR_DIR"
-
 # Force this to be absolute - event scripts can change directory
-EVENTSCRIPTS_TESTS_VAR_DIR=$(cd "$EVENTSCRIPTS_TESTS_VAR_DIR" && echo "$PWD")
+CTDB_TEST_TMP_DIR=$(cd "$CTDB_TEST_TMP_DIR" && echo "$PWD")
 
-export CTDB_LOGGING="file:${EVENTSCRIPTS_TESTS_VAR_DIR}/log.ctdb"
+export CTDB_LOGGING="file:${CTDB_TEST_TMP_DIR}/log.ctdb"
 touch "${CTDB_LOGGING#file:}" || \
     die "Unable to setup logging for \"$CTDB_LOGGING\""
 
-if [ -d "${TEST_SUBDIR}/etc" ] ; then
-    cp -a "${TEST_SUBDIR}/etc" "$EVENTSCRIPTS_TESTS_VAR_DIR"
-    export CTDB_SYS_ETCDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/etc"
+if [ -d "${CTDB_TEST_SUITE_DIR}/etc" ] ; then
+    cp -a "${CTDB_TEST_SUITE_DIR}/etc" "$CTDB_TEST_TMP_DIR"
+    export CTDB_SYS_ETCDIR="${CTDB_TEST_TMP_DIR}/etc"
 else
     die "Unable to setup \$CTDB_SYS_ETCDIR"
 fi
 
-setup_ctdb_base "$EVENTSCRIPTS_TESTS_VAR_DIR" "etc-ctdb" \
+setup_ctdb_base "$CTDB_TEST_TMP_DIR" "etc-ctdb" \
 		functions \
 		nfs-checks.d \
 		nfs-linux-kernel-callout \
 		statd-callout
 
-export FAKE_CTDB_STATE="$EVENTSCRIPTS_TESTS_VAR_DIR/fake-ctdb"
+export FAKE_CTDB_STATE="${CTDB_TEST_TMP_DIR}/fake-ctdb"
 mkdir -p "$FAKE_CTDB_STATE"
 
-export FAKE_NETWORK_STATE="$EVENTSCRIPTS_TESTS_VAR_DIR/fake-network-state"
+export FAKE_NETWORK_STATE="${CTDB_TEST_TMP_DIR}/fake-network-state"
 mkdir -p "$FAKE_NETWORK_STATE"
 
 ######################################################################
@@ -100,7 +93,7 @@ setup_script_options ()
 
 setup_dbdir ()
 {
-	export CTDB_DBDIR_BASE="${EVENTSCRIPTS_TESTS_VAR_DIR}/db"
+	export CTDB_DBDIR_BASE="${CTDB_TEST_TMP_DIR}/db"
 	CTDB_DBDIR="${CTDB_DBDIR_BASE}/volatile"
 	CTDB_DBDIR_PERSISTENT="${CTDB_DBDIR_BASE}/persistent"
 	CTDB_DBDIR_STATE="${CTDB_DBDIR_BASE}/state"
@@ -166,7 +159,7 @@ setup_shares ()
 	# Create 3 fake shares/exports.
 	export FAKE_SHARES=""
 	for i in $(seq 1 3) ; do
-		_s="${EVENTSCRIPTS_TESTS_VAR_DIR}/shares/share${i}"
+		_s="${CTDB_TEST_TMP_DIR}/shares/share${i}"
 		mkdir -p "$_s"
 		FAKE_SHARES="${FAKE_SHARES}${FAKE_SHARES:+ }${_s}"
 	done
@@ -311,7 +304,7 @@ ctdb_set_pnn ()
     export FAKE_CTDB_PNN="$1"
     echo "Setting up PNN ${FAKE_CTDB_PNN}"
 
-    CTDB_SCRIPT_VARDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/scripts/${FAKE_CTDB_PNN}"
+    CTDB_SCRIPT_VARDIR="${CTDB_TEST_TMP_DIR}/scripts/${FAKE_CTDB_PNN}"
     export CTDB_SCRIPT_VARDIR
     mkdir -p "$CTDB_SCRIPT_VARDIR"
 }
@@ -495,7 +488,7 @@ define_test ()
 	printf "%-17s %-10s %-4s - %s\n\n" \
 	       "$script_short" "$event" "$_num" "$desc"
 
-	_f="${TEST_SUBDIR}/scripts/${script_short}.sh"
+	_f="${CTDB_TEST_SUITE_DIR}/scripts/${script_short}.sh"
 	if [ -r "$_f" ] ; then
 		. "$_f"
 	fi
diff --git a/ctdb/tests/eventscripts/stubs/ctdb b/ctdb/tests/eventscripts/stubs/ctdb
index c3ea0d50550..12627de16a5 100755


-- 
Samba Shared Repository



More information about the samba-cvs mailing list