3 # Run a simple backup of the Bacula build directory using the compressed option
8 if test "$debug" -eq 1 ; then
14 scripts/copy-test-confs
16 echo "${cwd}/tmp/build" >/tmp/file-list
17 mkdir ${cwd}/tmp/build
18 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
22 sed s%\^%${cwd}/tmp/build/% 1 >restore-list
28 echo " === Starting restore-by-file-test at `date +%R:%S` ==="
29 echo " === Starting restore-by-file-test at `date +%R:%S` ===" >>working/log
32 cat <<END_OF_DATA >tmp/bconcmds
36 label storage=File volume=TestVolume001
37 run job=CompressedTest yes
44 restore where=${cwd}/tmp/bacula-restores storage=File
46 <${cwd}/tmp/restore-list
55 if test "$debug" -eq 1 ; then
57 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
59 bin/bacula start 2>&1 >/dev/null
60 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
63 scripts/check_for_zombie_jobs storage=File
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 tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
70 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
73 echo " !!!!! restore-by-file-test Bacula source failed!!! !!!!! "
74 echo " !!!!! restore-by-file-test failed!!! !!!!! " >>test.out
75 if [ $bstat != 0 -o $rstat != 0 ] ; then
76 echo " !!!!! Bad Job termination status !!!!! "
77 echo " !!!!! Bad Job termination status !!!!! " >>test.out
79 echo " !!!!! Restored files differ !!!!! "
80 echo " !!!!! Restored files differ !!!!! " >>test.out
84 echo " ===== restore-by-file-test Bacula source OK ===== "
85 echo " ===== restore-by-file-test OK ===== " >>test.out