diff options
author | Alaa Eddine Elamri <alaeddine.elamri@bareos.com> | 2022-08-12 12:06:53 +0300 |
---|---|---|
committer | Philipp Storz <philipp.storz@bareos.com> | 2022-09-19 13:46:50 +0300 |
commit | af64d37e82ce70d74e7edc8a3a143746554e28bc (patch) | |
tree | 06e561841c82a85555bd6c952b76d5de120f4a7e /systemtests | |
parent | c8b044876aa77caea9a8d43197d269c3ce028d46 (diff) |
systemtest: update scheduler backup test
scheduler
Diffstat (limited to 'systemtests')
4 files changed, 29 insertions, 72 deletions
diff --git a/systemtests/tests/scheduler-backup/etc/bareos/bareos-dir.d/schedule/schedule.conf b/systemtests/tests/scheduler-backup/etc/bareos/bareos-dir.d/schedule/schedule.conf deleted file mode 100644 index 240185e33..000000000 --- a/systemtests/tests/scheduler-backup/etc/bareos/bareos-dir.d/schedule/schedule.conf +++ /dev/null @@ -1,63 +0,0 @@ -Schedule { - Name = "TestCycle" - Run = Level=Full hourly at 0:00 - Run = Level=Full hourly at 0:01 - Run = Level=Full hourly at 0:02 - Run = Level=Full hourly at 0:03 - Run = Level=Full hourly at 0:04 - Run = Level=Full hourly at 0:05 - Run = Level=Full hourly at 0:06 - Run = Level=Full hourly at 0:07 - Run = Level=Full hourly at 0:08 - Run = Level=Full hourly at 0:09 - Run = Level=Full hourly at 0:10 - Run = Level=Full hourly at 0:11 - Run = Level=Full hourly at 0:12 - Run = Level=Full hourly at 0:13 - Run = Level=Full hourly at 0:14 - Run = Level=Full hourly at 0:15 - Run = Level=Full hourly at 0:16 - Run = Level=Full hourly at 0:17 - Run = Level=Full hourly at 0:18 - Run = Level=Full hourly at 0:19 - Run = Level=Full hourly at 0:20 - Run = Level=Full hourly at 0:21 - Run = Level=Full hourly at 0:22 - Run = Level=Full hourly at 0:23 - Run = Level=Full hourly at 0:24 - Run = Level=Full hourly at 0:25 - Run = Level=Full hourly at 0:26 - Run = Level=Full hourly at 0:27 - Run = Level=Full hourly at 0:28 - Run = Level=Full hourly at 0:29 - Run = Level=Full hourly at 0:30 - Run = Level=Full hourly at 0:31 - Run = Level=Full hourly at 0:32 - Run = Level=Full hourly at 0:33 - Run = Level=Full hourly at 0:34 - Run = Level=Full hourly at 0:35 - Run = Level=Full hourly at 0:36 - Run = Level=Full hourly at 0:37 - Run = Level=Full hourly at 0:38 - Run = Level=Full hourly at 0:39 - Run = Level=Full hourly at 0:40 - Run = Level=Full hourly at 0:41 - Run = Level=Full hourly at 0:42 - Run = Level=Full hourly at 0:43 - Run = Level=Full hourly at 0:44 - Run = Level=Full hourly at 0:45 - Run = Level=Full hourly at 0:46 - Run = Level=Full hourly at 0:47 - Run = Level=Full hourly at 0:48 - Run = Level=Full hourly at 0:49 - Run = Level=Full hourly at 0:50 - Run = Level=Full hourly at 0:51 - Run = Level=Full hourly at 0:52 - Run = Level=Full hourly at 0:53 - Run = Level=Full hourly at 0:54 - Run = Level=Full hourly at 0:55 - Run = Level=Full hourly at 0:56 - Run = Level=Full hourly at 0:57 - Run = Level=Full hourly at 0:58 - Run = Level=Full hourly at 0:59 -} diff --git a/systemtests/tests/scheduler-backup/test-setup b/systemtests/tests/scheduler-backup/test-setup index 3b467ba11..30231d4c2 100755 --- a/systemtests/tests/scheduler-backup/test-setup +++ b/systemtests/tests/scheduler-backup/test-setup @@ -2,7 +2,7 @@ # BAREOSĀ® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2021-2021 Bareos GmbH & Co. KG +# Copyright (C) 2021-2022 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -34,6 +34,24 @@ set -u # Fill ${BackupDirectory} with data. setup_data + +# Setup scheduler configuration to run at current time +if [ $(date +"%S") -ge 50 ]; then + sleep 11 + # to avoid case when we set a scheduled time at for example 13:01 and + # before the setup is finished, it becomes 13:02 and schedule doesn't + # start. So we give the test extra time to go to the next minute. +fi + +currenttime=$(date +"%H:%M") + +[[ -d "${conf}/bareos-dir.d/schedule" ]] || mkdir "${conf}/bareos-dir.d/schedule" + +echo "Schedule { + Name = \"TestCycle\" + Run = Level=Full daily at $currenttime +}" > "$conf"/bareos-dir.d/schedule/schedule.conf + bin/bareos start # make sure, director is up and running. diff --git a/systemtests/tests/scheduler-backup/testrunner-scheduler-backup b/systemtests/tests/scheduler-backup/testrunner-scheduler-backup index 4f23ee3dc..e68285e5a 100755 --- a/systemtests/tests/scheduler-backup/testrunner-scheduler-backup +++ b/systemtests/tests/scheduler-backup/testrunner-scheduler-backup @@ -34,8 +34,7 @@ messages @# @$out $tmp/log2.out wait -restore client=bareos-fd fileset=SelfTest where=$tmp/bareos-restores select all done -yes +restore client=bareos-fd fileset=SelfTest where=$tmp/bareos-restores select all done yes wait messages quit diff --git a/systemtests/tests/scheduler-backup/testrunner-scheduler-status-copy-job b/systemtests/tests/scheduler-backup/testrunner-scheduler-status-copy-job index 15f9bd790..d689dab2c 100755 --- a/systemtests/tests/scheduler-backup/testrunner-scheduler-status-copy-job +++ b/systemtests/tests/scheduler-backup/testrunner-scheduler-status-copy-job @@ -19,13 +19,16 @@ export TestName start_test +disablelog="$tmp"/disablelog.out +statuslog="$tmp"/statuslog.out + cat <<END_OF_DATA >$tmp/bconcmds messages -@$out $tmp/log3.out w +@$out $disablelog enable client=bareos-fd status scheduler job=copy -@$out $tmp/log4.out w +@$out $statuslog disable client=bareos-fd status scheduler job=copy wait @@ -36,14 +39,14 @@ END_OF_DATA run_bconsole #check that `status scheduler job=...` returns scheduled copy jobs -if ! grep "TestCycle Level=Full" "$tmp"/log3.out; then - echo "No scheduled job was found in $tmp/log3.out, which should contain all scheduled jobs" >&2 +if ! grep "TestCycle Level=Full" "$disablelog"; then + echo "No scheduled jobs were found in $disablelog, which should contain all scheduled jobs" >&2 estat=1 fi #check that `status scheduler job=...` returns nothing when we disable the client -if grep "TestCycle Level=Full" "$tmp"/log4.out; then - echo "a scheduled job was listed in $tmp/log4.out, which shouldn't happen" >&2 +if grep "TestCycle Level=Full" "$statuslog"; then + echo "a scheduled job was listed in $statuslog, which shouldn't happen" >&2 estat=1 fi |