Skip to content

Commit

Permalink
parallel-test: make problems more likely
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsura authored and BareosBot committed Aug 1, 2023
1 parent 12162ae commit dea6ad0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
Expand Up @@ -4,7 +4,7 @@ Pool {
Recycle = yes # Bareos can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # How long should the Full Backups be kept? (#06)
Maximum Volume Bytes = 50G # Limit Volume size to something reasonable
Maximum Volume Bytes = 70K # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "Full-" # Volumes will be labeled "Full-<volume-id>"
}
27 changes: 18 additions & 9 deletions systemtests/tests/parallel-jobs/testrunner-parallel-jobs
Expand Up @@ -34,6 +34,12 @@ run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
run job=${backupjob} level=Full yes
wait
messages
quit
Expand All @@ -43,12 +49,9 @@ run_bconsole

backup_jobids=($(grep 'Job queued.' $parallelbackuplog | sed -n -e 's/^.*JobId=//p'))

rm -rf $tmp/restore1
rm -rf $tmp/restore2
rm -rf $tmp/restore3
rm -rf $tmp/restore4
rm -rf $tmp/restore5
rm -rf $tmp/restore6
num_jobs=${#backup_jobids[@]}

find "$tmp" -type d -name "restore*" -exec rm -rf {} +

cat <<END_OF_DATA >"$tmp/bconcmds"
@$out $parallelrestorelog
Expand All @@ -58,24 +61,30 @@ restore jobid=${backup_jobids[2]} where=$tmp/restore3 all done yes
restore jobid=${backup_jobids[3]} where=$tmp/restore4 all done yes
restore jobid=${backup_jobids[4]} where=$tmp/restore5 all done yes
restore jobid=${backup_jobids[5]} where=$tmp/restore6 all done yes
restore jobid=${backup_jobids[6]} where=$tmp/restore7 all done yes
restore jobid=${backup_jobids[7]} where=$tmp/restore8 all done yes
restore jobid=${backup_jobids[8]} where=$tmp/restore9 all done yes
restore jobid=${backup_jobids[9]} where=$tmp/restore10 all done yes
restore jobid=${backup_jobids[10]} where=$tmp/restore11 all done yes
restore jobid=${backup_jobids[11]} where=$tmp/restore12 all done yes
wait
messages
quit
END_OF_DATA

run_bconsole

if [[ $(grep -c "Termination:.*Backup OK" "$parallelbackuplog") -ne "6" ]]; then
if [[ $(grep -c "Termination:.*Backup OK" "$parallelbackuplog") -ne "$num_jobs" ]]; then
echo "Not all backups jobs finished successfully."
estat=1
fi

if [[ $(grep -c "Termination:.*Restore OK" "$parallelrestorelog") -ne "6" ]]; then
if [[ $(grep -c "Termination:.*Restore OK" "$parallelrestorelog") -ne "$num_jobs" ]]; then
echo "Not all restore jobs finished successfully."
estat=2
fi

for i in {1..6}; do
for i in $(seq 1 "$num_jobs"); do
restoredir="$tmp/restore$i"
check_restore_diff "${BackupDirectory}" "$restoredir"
done
Expand Down

0 comments on commit dea6ad0

Please sign in to comment.