Skip to content

Commit

Permalink
systemtests: update parallel-jobs 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 52d7fc1 commit c66a0e1
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 116 deletions.
@@ -0,0 +1,13 @@
Job {
Name = "slow-backup-big-volume"
Type = Backup
Level = Full
Client = bareos-fd
FileSet = "SelfTest"
Storage = File
Messages = Standard
Pool = Full
Full Backup Pool = Full
Maximum Bandwidth = 50K
MaximumConcurrentJobs = 10
}
@@ -0,0 +1,13 @@
Job {
Name = "slow-backup-small-volumes"
Type = Backup
Level = Full
Client = bareos-fd
FileSet = "SelfTest"
Storage = File
Messages = Standard
Pool = SmallFull
Full Backup Pool = SmallFull
Maximum Bandwidth = 50K
MaximumConcurrentJobs = 10
}
Expand Up @@ -4,8 +4,7 @@ Pool {
Recycle = yes
AutoPrune = yes
Volume Retention = 365 days
Maximum Volume Bytes = 32k
Maximum Volume Bytes = 100k
Maximum Volumes = 100
Label Format = "SmallFull-"
Maximum Block Size = 16K
}
66 changes: 0 additions & 66 deletions systemtests/tests/parallel-jobs/parallel

This file was deleted.

70 changes: 70 additions & 0 deletions systemtests/tests/parallel-jobs/parallel-jobs-small-volumes
@@ -0,0 +1,70 @@
#!/bin/bash
set -e
set -o pipefail
set -u
#
# Run multiple backups in parallel in small volumes and
# then restore them.
#
TestName="$(basename "$(pwd)")"
export TestName

#shellcheck source=../environment.in
. ./environment

#shellcheck source=../scripts/functions
. "${rscripts}"/functions

start_test

backupjob="slow-backup-small-volumes"
parallelbackuplog="$tmp/small-volumes-parallel-backup.out"
parallelrestorelog="$tmp/small-volumes-parallel-restore.out"

cat <<END_OF_DATA >"$tmp/bconcmds"
@$out /dev/null
messages
@$out $parallelbackuplog
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
@$out $parallelrestorelog
restore jobid=13 where=$tmp/restore13 all done yes
wait
restore jobid=14 where=$tmp/restore14 all done yes
wait
restore jobid=15 where=$tmp/restore15 all done yes
wait
restore jobid=16 where=$tmp/restore16 all done yes
wait
restore jobid=17 where=$tmp/restore17 all done yes
wait
restore jobid=18 where=$tmp/restore18 all done yes
wait
messages
quit
END_OF_DATA

run_bconsole

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

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

for i in {13..18}; do
restoredir="$tmp/restore$i"
check_restore_diff "${BackupDirectory}" "$restoredir"
done

end_test
48 changes: 0 additions & 48 deletions systemtests/tests/parallel-jobs/testrunner-parallel-jobs

This file was deleted.

@@ -0,0 +1,70 @@
#!/bin/bash
set -e
set -o pipefail
set -u
#
# Run multiple backups in parallel and
# then restore them.
#
TestName="$(basename "$(pwd)")"
export TestName

#shellcheck source=../environment.in
. ./environment

#shellcheck source=../scripts/functions
. "${rscripts}"/functions

start_test

backupjob="slow-backup-big-volume"
parallelbackuplog="$tmp/big-volumes-parallel-backup.out"
parallelrestorelog="$tmp/big-volume-parallel-restore.out"

cat <<END_OF_DATA >"$tmp/bconcmds"
@$out /dev/null
messages
@$out $parallelbackuplog
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
@$out $parallelrestorelog
restore jobid=1 where=$tmp/restore1 all done yes
wait
restore jobid=2 where=$tmp/restore2 all done yes
wait
restore jobid=3 where=$tmp/restore3 all done yes
wait
restore jobid=4 where=$tmp/restore4 all done yes
wait
restore jobid=5 where=$tmp/restore5 all done yes
wait
restore jobid=6 where=$tmp/restore6 all done yes
wait
messages
quit
END_OF_DATA

run_bconsole

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

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

for i in {1..6}; do
restoredir="$tmp/restore$i"
check_restore_diff "${BackupDirectory}" "$restoredir"
done

end_test

0 comments on commit c66a0e1

Please sign in to comment.