Skip to content

Commit

Permalink
systemtests: add checkpoints and spooling test
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri authored and pstorz committed Oct 25, 2022
1 parent c047c55 commit 0948006
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions systemtests/tests/checkpoints/testrunner-checkpoints-and-spooling
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0948006

Please sign in to comment.