From: Martin Schwenke Date: Wed, 7 Feb 2018 19:24:01 +0000 (+1100) Subject: ctdb-tests: 01.reclock event script setup modularisation X-Git-Tag: talloc-2.1.13~162 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cddc88d0386bbe3b5c2fb18dc28b4e9fa75f727;p=thirdparty%2Fsamba.git ctdb-tests: 01.reclock event script setup modularisation Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.001.sh b/ctdb/tests/eventscripts/01.reclock.monitor.001.sh index 8230528c3fe..2922f5d0220 100755 --- a/ctdb/tests/eventscripts/01.reclock.monitor.001.sh +++ b/ctdb/tests/eventscripts/01.reclock.monitor.001.sh @@ -4,6 +4,8 @@ define_test "unset, check no-op" +setup + CTDB_RECOVERY_LOCK="" ok_null diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.002.sh b/ctdb/tests/eventscripts/01.reclock.monitor.002.sh index b40213f3256..d82aecf5b92 100755 --- a/ctdb/tests/eventscripts/01.reclock.monitor.002.sh +++ b/ctdb/tests/eventscripts/01.reclock.monitor.002.sh @@ -4,6 +4,8 @@ define_test "set to helper, check no-op" +setup + CTDB_RECOVERY_LOCK="!/some/recover/lock/helper foo" ok_null diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.003.sh b/ctdb/tests/eventscripts/01.reclock.monitor.003.sh index 2d82a21d1ee..3e28ebbae7d 100755 --- a/ctdb/tests/eventscripts/01.reclock.monitor.003.sh +++ b/ctdb/tests/eventscripts/01.reclock.monitor.003.sh @@ -4,7 +4,7 @@ define_test "set, exists" -setup_reclock +setup ok_null simple_test diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.004.sh b/ctdb/tests/eventscripts/01.reclock.monitor.004.sh index 8ea0fd026fb..965f2466b16 100755 --- a/ctdb/tests/eventscripts/01.reclock.monitor.004.sh +++ b/ctdb/tests/eventscripts/01.reclock.monitor.004.sh @@ -4,7 +4,7 @@ define_test "set, doesn't exist, 4 times" -setup_reclock +setup rm -f "$CTDB_RECOVERY_LOCK" ok_null diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.005.sh b/ctdb/tests/eventscripts/01.reclock.monitor.005.sh index 8572c25ff15..1590520469d 100755 --- a/ctdb/tests/eventscripts/01.reclock.monitor.005.sh +++ b/ctdb/tests/eventscripts/01.reclock.monitor.005.sh @@ -4,7 +4,7 @@ define_test "set, doesn't exist, 4 times" -setup_reclock +setup rm -f "$CTDB_RECOVERY_LOCK" ok_null diff --git a/ctdb/tests/eventscripts/scripts/01.reclock.sh b/ctdb/tests/eventscripts/scripts/01.reclock.sh index aef1e075567..b6ab922d4bc 100644 --- a/ctdb/tests/eventscripts/scripts/01.reclock.sh +++ b/ctdb/tests/eventscripts/scripts/01.reclock.sh @@ -7,10 +7,9 @@ cleanup_reclock () done } -setup_reclock () +setup () { - CTDB_RECOVERY_LOCK=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR") - export CTDB_RECOVERY_LOCK + export CTDB_RECOVERY_LOCK="${EVENTSCRIPTS_TESTS_VAR_DIR}/rec.lock" test_cleanup cleanup_reclock }