Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlaa Eddine Elamri <alaeddine.elamri@bareos.com>2022-10-13 14:09:49 +0300
committerPhilipp Storz <philipp.storz@bareos.com>2022-10-25 14:13:49 +0300
commit0948006db0f919b327138a93c705d0c9e1b51a81 (patch)
tree0da2a96dd69abe3d979dacbb40e048908d008d0d /systemtests
parentc047c55a8f3e48298e8373ac3373bcb61cfcea02 (diff)
systemtests: add checkpoints and spooling test
Diffstat (limited to 'systemtests')
-rwxr-xr-xsystemtests/tests/checkpoints/testrunner-checkpoints-and-spooling66
1 files changed, 66 insertions, 0 deletions
diff --git a/systemtests/tests/checkpoints/testrunner-checkpoints-and-spooling b/systemtests/tests/checkpoints/testrunner-checkpoints-and-spooling
new file mode 100755
index 000000000..7877b84f7
--- /dev/null
+++ b/systemtests/tests/checkpoints/testrunner-checkpoints-and-spooling
@@ -0,0 +1,66 @@
+#!/bin/bash
+set -o pipefail
+set -u
+#
+# Run a job with spooling and check that checkpoints are not triggered
+#
+TestName="$(basename "$(pwd)")"
+export TestName
+
+#shellcheck source=../environment.in
+. ./environment
+
+#shellcheck source=../scripts/functions
+. "${rscripts}"/functions
+
+start_test
+
+backup_log=$tmp/spool-backup-checkpoints.out
+restore_log=$tmp/spool-restore-checkpoints.out
+restore_directory=$tmp/spool-checkpoints-restore
+
+rm -f $backup_log
+rm -f $restore_log
+rm -rf $restore_directory
+
+slowjob="slow-backup-bareos-fd"
+
+cat <<END_OF_DATA >"$tmp/bconcmds"
+@$out /dev/null
+messages
+@$out $backup_log
+run job=$slowjob level=Full spooldata=yes yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+expect_not_grep "Doing timed backup checkpoint." \
+ "$backup_log" \
+ "Timed checkpoint was triggered for a spooled job. This should not happen here."
+
+expect_not_grep "Volume changed, doing checkpoint:" \
+ "$backup_log" \
+ "Checkpoint on volume change was triggered for a spooled job. This should not happen here."
+
+slowjobid=$(grep 'Job queued. JobId=' $backup_log | sed -n -e 's/^.*JobId=//p')
+
+cat <<END_OF_DATA >"$tmp/bconcmds"
+@$out /dev/null
+messages
+@$out $restore_log
+restore jobid=${slowjobid} where=$restore_directory all done yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+expect_grep "Termination: Restore OK" \
+ "$restore_log" \
+ "Restore is not OK."
+
+end_test