3 # Run a simple backup of the Bacula build directory but
4 # split the archive into two volumes, then build a BSR with
5 # the restore command and use bextract to restore the files.
8 if test "$debug" -eq 1 ; then
15 scripts/copy-test-confs
17 echo "${cwd}/build" >/tmp/file-list
21 echo " === Starting bextract-test at `date +%R:%S` ==="
22 echo " === Starting bextract-test at `date +%R:%S` ===" >working/log
25 cat <<END_OF_DATA >tmp/bconcmds
29 label storage=File1 volume=TestVolume001
30 label storage=File1 volume=TestVolume002
31 update Volume=TestVolume001 MaxVolBytes=3000000
32 run job=NightlySave storage=File1 yes
36 @# now build the bsr file
39 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
47 if test "$debug" -eq 1 ; then
49 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
51 bin/bacula start 2>&1 >/dev/null
52 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
55 scripts/check_for_zombie_jobs storage=File1
56 bin/bacula stop 2>&1 >/dev/null
57 mkdir -p ${cwd}/tmp/bacula-restores
58 bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
59 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
61 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
62 if [ $? != 0 -o $bstat != 0 ] ; then
65 echo " !!!!! bextract-test Bacula source failed!!! !!!!! "
66 echo " !!!!! bextract-test failed!!! !!!!! " >>test.out
67 if [ $bstat != 0 ] ; then
68 echo " !!!!! Bad Job termination status !!!!! "
69 echo " !!!!! Bad Job termination status !!!!! " >>test.out
71 echo " !!!!! Restored files differ !!!!! "
72 echo " !!!!! Restored files differ !!!!! " >>test.out
76 echo " ===== bextract-test Bacula source OK ===== "
77 echo " ===== bextract-test OK ===== " >>test.out