From: Martin Schwenke Date: Mon, 12 Aug 2019 12:10:41 +0000 (+1000) Subject: ctdb-tests: Simplify test_wrap script X-Git-Tag: tdb-1.4.2~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=061656d383772b27607b8feb4a4ea9c988ce17d8;p=thirdparty%2Fsamba.git ctdb-tests: Simplify test_wrap script Given other improvements, this is now needlessly complex. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/test_wrap b/ctdb/tests/scripts/test_wrap index 3db3180ae98..d9a6d09e202 100755 --- a/ctdb/tests/scripts/test_wrap +++ b/ctdb/tests/scripts/test_wrap @@ -1,20 +1,10 @@ #!/bin/bash -# Execute the given command. The intention is that it is a function -# from "${TEST_SCRIPTS_DIR}/integration.bash". +# Execute the given command. The intention is that it is either +# * a function from "${TEST_SCRIPTS_DIR}/integration.bash"; or +# * a test helper binary -PATH="$(dirname $0):${PATH}" - -TEST_SCRIPTS_DIR=$(dirname $0) - -# We need the test binaries (i.e. tests/bin/) to be in $PATH. If they -# aren't already in $PATH then we know that tests/bin/ sits alongside -# tests/scripts/. -f="fetch_ring" -if [ ! $(which $f >/dev/null 2>&1) ] ; then - d=$(dirname "$TEST_SCRIPTS_DIR")/bin - [ -x "$d/$f" ] && PATH="$d:$PATH" -fi +TEST_SCRIPTS_DIR=$(dirname "$0") . "${TEST_SCRIPTS_DIR}/integration.bash" diff --git a/ctdb/wscript b/ctdb/wscript index 03e29e133d8..45207d5548a 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -1091,14 +1091,10 @@ def build(bld): os.path.join('tests/scripts', t), destname=os.path.join('scripts', t)) - sed_expr = 's@^TEST_SCRIPTS_DIR=.*@&\\nexport TEST_BIN_DIR=\"%s\"@' % ( - bld.env.CTDB_TEST_LIBEXECDIR) - bld.SAMBA_GENERATOR('ctdb-test-wrap', - source='tests/scripts/test_wrap', - target='test_wrap', - rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr) - bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR+"/scripts", 'test_wrap', - destname='test_wrap', chmod=MODE_755) + bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR, + 'tests/scripts/test_wrap', + destname='scripts/test_wrap', + chmod=MODE_755) bld.SAMBA_GENERATOR('ctdb-test-script-install-paths', source='tests/scripts/script_install_paths.sh',