mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
Tests - functions/environment - set and use $CTDB_NODES
"ctdb listnodes" changed so that it never tries to contact the daemon but reads the local nodes file instead. This fails if the nodes file is in a non-default place but $CTDB_NODES isn't set. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a7ad2fb75f06791508dd928d2a0c305fc7f7b814)
This commit is contained in:
parent
bd41a2ae0d
commit
88c74987dc
@ -32,6 +32,8 @@ if [ ! -n "$CTDB_TEST_REAL_CLUSTER" ] ; then
|
||||
done
|
||||
|
||||
PATH="${CTDB_DIR}/bin:${CTDB_DIR}/tests/bin:${PATH}"
|
||||
|
||||
export CTDB_NODES="$var_dir/nodes.txt"
|
||||
fi
|
||||
|
||||
# If $VALGRIND is set then use it whenever ctdb is called, but only if
|
||||
|
@ -720,10 +720,9 @@ daemons_setup ()
|
||||
|
||||
mkdir -p $var_dir/test.db/persistent
|
||||
|
||||
local nodes=$var_dir/nodes.txt
|
||||
local public_addresses=$var_dir/public_addresses.txt
|
||||
local no_public_addresses=$var_dir/no_public_addresses.txt
|
||||
rm -f $nodes $public_addresses $no_public_addresses
|
||||
rm -f $CTDB_NODES $public_addresses $no_public_addresses
|
||||
|
||||
# If there are (strictly) greater than 2 nodes then we'll randomly
|
||||
# choose a node to have no public addresses.
|
||||
@ -737,7 +736,7 @@ daemons_setup ()
|
||||
echo ::$i >> $nodes
|
||||
ip addr add ::$i/128 dev lo
|
||||
else
|
||||
echo 127.0.0.$i >> $nodes
|
||||
echo 127.0.0.$i >> $CTDB_NODES
|
||||
# 2 public addresses on most nodes, just to make things interesting.
|
||||
if [ $(($i - 1)) -ne $no_public_ips ] ; then
|
||||
echo "192.0.2.$i/24 lo" >> $public_addresses
|
||||
@ -754,7 +753,6 @@ daemons_start_1 ()
|
||||
|
||||
local var_dir=$CTDB_DIR/tests/var
|
||||
|
||||
local nodes=$var_dir/nodes.txt
|
||||
local public_addresses=$var_dir/public_addresses.txt
|
||||
local no_public_addresses=$var_dir/no_public_addresses.txt
|
||||
|
||||
@ -765,7 +763,7 @@ daemons_start_1 ()
|
||||
echo "Node $no_public_ips will have no public IPs."
|
||||
fi
|
||||
|
||||
local ctdb_options="--reclock=$var_dir/rec.lock --nlist $nodes --nopublicipcheck --event-script-dir=$CTDB_DIR/tests/events.d --logfile=$var_dir/daemons.log -d 0 --dbdir=$var_dir/test.db --dbdir-persistent=$var_dir/test.db/persistent --dbdir-state=$var_dir/test.db/state"
|
||||
local ctdb_options="--reclock=$var_dir/rec.lock --nlist $CTDB_NODES --nopublicipcheck --event-script-dir=$CTDB_DIR/tests/events.d --logfile=$var_dir/daemons.log -d 0 --dbdir=$var_dir/test.db --dbdir-persistent=$var_dir/test.db/persistent --dbdir-state=$var_dir/test.db/state"
|
||||
|
||||
if [ $(id -u) -eq 0 ]; then
|
||||
ctdb_options="$ctdb_options --public-interface=lo"
|
||||
|
Loading…
x
Reference in New Issue
Block a user