3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do a Differental then a bunch of query commands
5 # and finally restore the two files.
8 if test "$debug" -eq 1 ; then
15 scripts/copy-test-confs
17 echo "${cwd}/tmp/build" >/tmp/file-list
18 mkdir ${cwd}/tmp/build
19 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
21 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
22 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
27 echo " === Starting query-test at `date +%R:%S` ==="
28 echo " === Starting query-test at `date +%R:%S` ===" >>working/log
31 bin/bacula start 2>&1 >/dev/null
32 cat <<END_OF_DATA >tmp/bconcmds
36 label storage=File volume=TestVolume001
37 label storage=File volume=TestVolume002
38 run job=CompressedTest yes
43 if test "$debug" -eq 1 ; then
45 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
47 bin/bacula start 2>&1 >/dev/null
48 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
50 scripts/check_for_zombie_jobs storage=File
51 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
52 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
53 cat <<END_OF_DATA >tmp/bconcmds
57 @# Force differental on the second Volume
58 update volume=TestVolume001 VolStatus=Used
59 run level=differental job=CompressedTest yes
64 if test "$debug" -eq 1 ; then
66 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
68 bin/bacula start 2>&1 >/dev/null
69 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
71 scripts/check_for_zombie_jobs storage=File
72 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
73 cat <<END_OF_DATA >tmp/bconcmds
77 run level=incremental job=CompressedTest yes
114 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
121 if test "$debug" -eq 1 ; then
123 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
125 bin/bacula start 2>&1 >/dev/null
126 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
128 scripts/check_for_zombie_jobs storage=File
129 bin/bacula stop 2>&1 >/dev/null
130 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
132 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
135 # Delete .c files because we will only restored the txt files
138 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
139 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
142 echo " !!!!! query-test Bacula source failed!!! !!!!! "
143 echo " !!!!! query-test failed!!! !!!!! " >>test.out
144 if [ $bstat != 0 -o $rstat != 0 ] ; then
145 echo " !!!!! Bad Job termination status !!!!! "
146 echo " !!!!! Bad Job termination status !!!!! " >>test.out
148 echo " !!!!! Restored files differ !!!!! "
149 echo " !!!!! Restored files differ !!!!! " >>test.out
153 echo " ===== query-test Bacula source OK `date +%R:%S` ===== "
154 echo " ===== query-test OK `date +%R:%S` ===== " >>test.out