summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-01-22 19:14:48 +1100
committerStefan Metzmacher <metze@samba.org>2018-02-12 11:28:49 +0100
commit10ffffa6c00a890b46c22ea87e4653953d0948c2 (patch)
tree146a5d03758ce889849db2c7bc6a25b2a8ef3ebd /ctdb
parente7af9b0baf46e90d63621c709dcc8e85af465f5c (diff)
downloadsamba-10ffffa6c00a890b46c22ea87e4653953d0948c2.tar.gz
ctdb-tests: Only use socket-wrapper for simple, local daemon tests
The run_tests.sh -S option now takes the path to the socker-wrapper shared library. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit e17d02d4039001563d189b33200c30e3906ce845)
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/run_tests.sh13
-rw-r--r--ctdb/tests/simple/scripts/local_daemons.bash6
-rw-r--r--ctdb/wscript3
3 files changed, 11 insertions, 11 deletions
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh
index d790996e5ef..a133445a132 100755
--- a/ctdb/tests/run_tests.sh
+++ b/ctdb/tests/run_tests.sh
@@ -14,7 +14,7 @@ Options:
-H No headers - for running single test with other wrapper
-N Don't print summary of tests results after running all tests
-q Quiet - don't show tests being run (hint: use with -s)
- -S Enable socket wrapper
+ -S <lib> Use socket wrapper library <lib> for local integration tests
-v Verbose - print test output for non-failures (only some tests)
-V <dir> Use <dir> as TEST_VAR_DIR
-x Trace this script with the -x option
@@ -36,7 +36,6 @@ with_desc=false
quiet=false
exit_on_fail=false
no_header=false
-socket_wrapper=false
export TEST_VERBOSE=false
export TEST_COMMAND_TRACE=false
@@ -47,8 +46,9 @@ export TEST_LOCAL_DAEMONS
export TEST_VAR_DIR=""
export TEST_CLEANUP=false
export TEST_TIMEOUT=600
+export TEST_SOCKET_WRAPPER_SO_PATH=""
-temp=$(getopt -n "$prog" -o "AcCdDehHNqST:vV:xX" -l help -- "$@")
+temp=$(getopt -n "$prog" -o "AcCdDehHNqS:T:vV:xX" -l help -- "$@")
[ $? != 0 ] && usage
@@ -65,7 +65,7 @@ while true ; do
-H) no_header=true ; shift ;;
-N) with_summary=false ; shift ;;
-q) quiet=true ; shift ;;
- -S) socket_wrapper=true ; shift ;;
+ -S) TEST_SOCKET_WRAPPER_SO_PATH="$2" ; shift 2 ;;
-T) TEST_TIMEOUT="$2" ; shift 2 ;;
-v) TEST_VERBOSE=true ; shift ;;
-V) TEST_VAR_DIR="$2" ; shift 2 ;;
@@ -252,11 +252,6 @@ mkdir -p "$TEST_VAR_DIR"
TEST_VAR_DIR=$(cd "$TEST_VAR_DIR"; echo "$PWD")
echo "TEST_VAR_DIR=$TEST_VAR_DIR"
-if $socket_wrapper ; then
- export SOCKET_WRAPPER_DIR="${TEST_VAR_DIR}/sw"
- mkdir -p "$SOCKET_WRAPPER_DIR"
-fi
-
export TEST_SCRIPTS_DIR="${CTDB_TEST_DIR}/scripts"
# If no tests specified then run some defaults
diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash
index a0c807725df..512d11fb253 100644
--- a/ctdb/tests/simple/scripts/local_daemons.bash
+++ b/ctdb/tests/simple/scripts/local_daemons.bash
@@ -17,6 +17,12 @@ fi
export CTDB_NODES="${TEST_VAR_DIR}/nodes.txt"
+if [ -n "$TEST_SOCKET_WRAPPER_SO_PATH" ] ; then
+ export LD_PRELOAD="$TEST_SOCKET_WRAPPER_SO_PATH"
+ export SOCKET_WRAPPER_DIR="${TEST_VAR_DIR}/sw"
+ mkdir -p "$SOCKET_WRAPPER_DIR"
+fi
+
#######################################
config_from_environment ()
diff --git a/ctdb/wscript b/ctdb/wscript
index 715ecb175fa..059ce3d43d8 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -986,8 +986,7 @@ def test(ctx):
def autotest(ctx):
env = samba_utils.LOAD_ENVIRONMENT()
- ld = 'LD_PRELOAD=%s' % env.SOCKET_WRAPPER_SO_PATH
- cmd = '%s tests/run_tests.sh -e -S -C' % ld
+ cmd = 'tests/run_tests.sh -e -S %s -C' % env.SOCKET_WRAPPER_SO_PATH
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('autotest exited with exit status %d' % ret)