diff options
author | Martin Schwenke <martin@meltin.net> | 2012-07-18 17:02:38 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-09-28 17:05:34 +1000 |
commit | 3ccaba7842e22029ee6541b4f9e35c80f756c056 (patch) | |
tree | 91ada7abfc4aff9c40a195c4162f68b3b341c962 | |
parent | 82922ec305565356c76ccecab6235ad827b5d6ca (diff) | |
download | samba-3ccaba7842e22029ee6541b4f9e35c80f756c056.tar.gz samba-3ccaba7842e22029ee6541b4f9e35c80f756c056.tar.xz samba-3ccaba7842e22029ee6541b4f9e35c80f756c056.zip |
tests/tool: New function setup_natgw() to setup $CTDB_NATGW_NODES
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 0f0aef21a1bb2d88a8c184ef70c718e0c91acdc3)
-rw-r--r-- | ctdb/tests/tool/scripts/local.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ctdb/tests/tool/scripts/local.sh b/ctdb/tests/tool/scripts/local.sh index 77c5f16a6c..3b9670c8c1 100644 --- a/ctdb/tests/tool/scripts/local.sh +++ b/ctdb/tests/tool/scripts/local.sh @@ -1,5 +1,11 @@ # Hey Emacs, this is a -*- shell-script -*- !!! :-) +if "$TEST_VERBOSE" ; then + debug () { echo "$@" ; } +else + debug () { : ; } +fi + define_test () { _f=$(basename "$0" ".sh") @@ -22,6 +28,20 @@ define_test () printf "%-28s - %s\n" "$_f" "$1" } +setup_natgw () +{ + debug "Setting up NAT gateway" + + natgw_config_dir="${TEST_VAR_DIR}/natgw_config" + mkdir -p "$natgw_config_dir" + + # These will accumulate, 1 per test... but will be cleaned up at + # the end. + export CTDB_NATGW_NODES=$(mktemp --tmpdir="$natgw_config_dir") + + cat >"$CTDB_NATGW_NODES" +} + simple_test () { # Most of the tests when the tool fails will have a date/time/pid |