From: Martin Schwenke Date: Mon, 19 Mar 2018 09:30:03 +0000 (+1100) Subject: ctdb-tests: Create 01.reclock.sh X-Git-Tag: talloc-2.1.13~183 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b4dd7e539c8e37a4a594f3cd3a6819fc40a5594;p=thirdparty%2Fsamba.git ctdb-tests: Create 01.reclock.sh Contains testing support used only by tests for 01.reclock event script. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/eventscripts/scripts/01.reclock.sh b/ctdb/tests/eventscripts/scripts/01.reclock.sh new file mode 100644 index 00000000000..aef1e075567 --- /dev/null +++ b/ctdb/tests/eventscripts/scripts/01.reclock.sh @@ -0,0 +1,16 @@ +cleanup_reclock () +{ + _pattern="${script_dir}/${script}" + while pgrep -f "$_pattern" >/dev/null ; do + echo "Waiting for backgrounded ${script} to exit..." + (FAKE_SLEEP_REALLY=yes sleep 1) + done +} + +setup_reclock () +{ + CTDB_RECOVERY_LOCK=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR") + export CTDB_RECOVERY_LOCK + + test_cleanup cleanup_reclock +} diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index e8696b375b9..9e24a49ce70 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -1152,28 +1152,6 @@ program $_rpc_service${_ver:+ version }${_ver} is not available" rm -f "$_out" "$_rc_file" } -###################################################################### - -# Recovery lock fakery - -cleanup_reclock () -{ - _pattern="${script_dir}/${script}" - while pgrep -f "$_pattern" >/dev/null ; do - echo "Waiting for backgrounded ${script} to exit..." - (FAKE_SLEEP_REALLY=yes sleep 1) - done -} - -setup_reclock () -{ - CTDB_RECOVERY_LOCK=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR") - export CTDB_RECOVERY_LOCK - - test_cleanup cleanup_reclock -} - -###################################################################### # VSFTPD fakery