diff options
author | Alaa Eddine Elamri <alaeddine.elamri@bareos.com> | 2022-08-09 14:00:34 +0300 |
---|---|---|
committer | Philipp Storz <philipp.storz@bareos.com> | 2022-09-19 13:46:50 +0300 |
commit | 2e059da67d7fc2b02ea615e42d94d5b8df66e32c (patch) | |
tree | 30dedd2afbbd6aa05799b42ab84a68d82f52673f /systemtests | |
parent | ae399de56995bd77682d0721cb7ae8545808eab6 (diff) |
scripts/functions: introduce wait_for_jobs_to_terminate
(cherry picked from commit f5d50c878cbe1d02735406272569f8cd033dda87)
status what
(cherry picked from commit d10fde771f00c50cd5d289c0d28d2af027d4d98b)
Diffstat (limited to 'systemtests')
-rw-r--r-- | systemtests/scripts/functions | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/systemtests/scripts/functions b/systemtests/scripts/functions index a30475e5b..edc8916a7 100644 --- a/systemtests/scripts/functions +++ b/systemtests/scripts/functions @@ -3,6 +3,20 @@ # A set of useful functions to be sourced in each test # +wait_for_jobs_to_terminate () +{ + status_of_what=$1 + max_wait_in_seconds=$2 + count=max_wait_in_seconds + while (( --count >= 0 )); do + if "${BAREOS_BCONSOLE_BINARY}" -c "${conf}" <<< "status ${status_of_what}" | grep "No Jobs running."; + then + break + fi + sleep 1 + done +} + copy_configs() { COMPONENTS="bareos-dir bareos-sd bareos-fd bconsole tray-monitor" |