3 # Run a simple backup of the Bacula build directory but
4 # create three volumes and do six backups causing the
5 # volumes to be recycled, and cycling through the volumes
6 # twice. Tests maxvoljobs and volretention.
9 scripts/copy-test-confs
11 echo "${cwd}/build" >/tmp/file-list
15 echo " === Starting recycle-test ==="
16 echo " === Starting recycle-test ===" >working/log
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
23 label storage=File1 volume=TestVolume001
24 label storage=File1 volume=TestVolume002
25 label storage=File1 volume=TestVolume003
26 update Volume=TestVolume001 volretention=10s
27 update Volume=TestVolume001 maxvoljobs=1
28 update Volume=TestVolume002 volretention=10s
29 update Volume=TestVolume002 maxvoljobs=1
30 update Volume=TestVolume003 volretention=10s
31 update Volume=TestVolume003 maxvoljobs=1
33 run job=NightlySave storage=File1 level=full yes
37 run job=NightlySave storage=File1 level=full yes
41 run job=NightlySave storage=File1 level=full yes
46 run job=NightlySave storage=File1 level=full yes
50 run job=NightlySave storage=File1 level=full yes
55 run job=NightlySave storage=File1 level=full yes
63 restore where=${cwd}/tmp/bacula-restores select storage=File1
73 scripts/check_for_zombie_jobs storage=File1
74 bin/bacula stop 2>&1 >/dev/null
75 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
77 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
79 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
80 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
83 echo " !!!!! recycle-test Bacula source failed!!! !!!!! "
84 echo " !!!!! recycle-test failed!!! !!!!! " >>test.out
85 if [ $bstat != 0 -o $rstat != 0 ] ; then
86 echo " !!!!! Bad Job termination status !!!!! "
87 echo " !!!!! Bad Job termination status !!!!! " >>test.out
89 echo " !!!!! Restored files differ !!!!! "
90 echo " !!!!! Restored files differ !!!!! " >>test.out
94 echo " ===== recycle-test Bacula source OK ===== "
95 echo " ===== recycle-test OK ===== " >>test.out