From 10ffffa6c00a890b46c22ea87e4653953d0948c2 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 22 Jan 2018 19:14:48 +1100 Subject: [PATCH] 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 Reviewed-by: Amitay Isaacs (cherry picked from commit e17d02d4039001563d189b33200c30e3906ce845) --- ctdb/tests/run_tests.sh | 13 ++++--------- ctdb/tests/simple/scripts/local_daemons.bash | 6 ++++++ ctdb/wscript | 3 +-- 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 Use socket wrapper library for local integration tests -v Verbose - print test output for non-failures (only some tests) -V Use 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) -- 2.34.1