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 run job=NightlySave yes
32 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
37 bin/bacula stop 2>&1 >/dev/null
39 # Now do a second backup after making a few changes
41 touch ${cwd}/build/src/dird/*.c
42 echo "test test" > ${cwd}/build/src/dird/xxx
43 bin/bacula start 2>&1 >/dev/null
44 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
48 run job=NightlySave yes
52 @# now do a second restore
55 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
62 scripts/check_for_zombie_jobs storage=DDS-4
64 bin/bacula stop 2>&1 >/dev/null
65 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
67 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
69 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
70 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
73 echo " !!!!! Bacula tape test Bacula source failed!!! !!!!! "
74 echo " !!!!! Bacula tape test failed!!! !!!!! " >>test.out
77 echo " ===== Bacula tape test Bacula source OK ===== "
78 echo " ===== Bacula tape test OK ===== " >>test.out