1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdb-tests: Use setup_ctdb_base() for onnode unit tests

The nodes file is now in the CTDB_BASE directory so no CTDB_NODES_FILE
variable is needed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-02-07 14:09:45 +11:00 committed by Martin Schwenke
parent 258e1e04ae
commit 2b38b82303
4 changed files with 6 additions and 17 deletions

View File

@ -1 +0,0 @@
../../config/functions

View File

@ -8,23 +8,15 @@ stubs_dir="${TEST_SUBDIR}/stubs"
[ -d "${stubs_dir}" ] || die "Failed to locate stubs/ subdirectory"
PATH="${stubs_dir}:${PATH}"
# Find CTDB nodes file.
if [ -z "$CTDB_NODES_FILE" ] ; then
if [ -r "${TEST_SUBDIR}/nodes" ] ; then
CTDB_NODES_FILE="${TEST_SUBDIR}/nodes"
else
CTDB_NODES_FILE="${CTDB_BASE:-/etc/ctdb}/nodes"
fi
fi
export CTDB_NODES_FILE
[ -n "$TEST_VAR_DIR" ] || die "TEST_VAR_DIR unset"
export ONNODE_TESTS_VAR_DIR="${TEST_VAR_DIR}/unit_onnode"
if [ -d "$ONNODE_TESTS_VAR_DIR" ] ; then
rm -r "$ONNODE_TESTS_VAR_DIR"
fi
mkdir -p "$ONNODE_TESTS_VAR_DIR"
if [ -z "$CTDB_BASE" ] ; then
export CTDB_BASE=$(dirname "$CTDB_NODES_FILE")
fi
setup_ctdb_base "$ONNODE_TESTS_VAR_DIR" "etc-ctdb" \
functions
define_test ()
{

View File

@ -946,8 +946,6 @@ def build(bld):
# Tests that use onnode need to overwrite link to in-tree
# functions file when installed
bld.symlink_as(os.path.join(bld.env.CTDB_TEST_DATADIR, 'onnode/functions'),
os.path.join(bld.env.CTDB_ETCDIR, 'functions'))
bld.symlink_as(os.path.join(bld.env.CTDB_TEST_DATADIR, 'simple/functions'),
os.path.join(bld.env.CTDB_ETCDIR, 'functions'))