3 # Run a simple backup of the Bacula build directory
4 # to a tape then restore it, we do that twice to ensure that
5 # we can correctly append to a tape.
8 scripts/copy-tape-confs
11 echo "${cwd}/build" >/tmp/file-list
15 echo " === Starting Bacula tape test ==="
16 echo " === Starting Bacula tape test ===" >>working/log
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
24 label storage=DDS-4 volume=TestVolume001 slot=0
25 purge volume=TestVolume001
26 relabel pool=Default storage=DDS-4 oldVolume=TestVolume001 volume=TestVolume002 slot=0
27 purge volume=TestVolume002
28 relabel pool=Default storage=DDS-4 oldVolume=TestVolume002 volume=TestVolume001 slot=0
29 run job=NightlySave yes
66 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
71 bin/bacula stop 2>&1 >/dev/null
73 # Now do a second backup after making a few changes
75 touch ${cwd}/build/src/dird/*.c
76 echo "test test" > ${cwd}/build/src/dird/xxx
77 bin/bacula start 2>&1 >/dev/null
78 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
82 run job=NightlySave yes
86 @# now do a second restore
89 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
96 scripts/check_for_zombie_jobs storage=DDS-4
98 bin/bacula stop 2>&1 >/dev/null
99 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
101 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
103 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
104 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
107 echo " !!!!! Bacula tape test Bacula source failed!!! !!!!! "
108 echo " !!!!! Bacula tape test failed!!! !!!!! " >>test.out
111 echo " ===== Bacula tape test Bacula source OK ===== "
112 echo " ===== Bacula tape test OK ===== " >>test.out