3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do a Decremental then a bunch of query commands
5 # and finally restore the two files.
8 scripts/copy-test-confs
10 echo "${cwd}/tmp/build" >/tmp/file-list
11 mkdir ${cwd}/tmp/build
12 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
14 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
15 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
20 echo " === Starting query-test at `date +%R:%S` ==="
21 echo " === Starting query-test at `date +%R:%S` ===" >>working/log
24 bin/bacula start 2>&1 >/dev/null
25 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
29 label storage=File volume=TestVolume001
30 label storage=File volume=TestVolume002
31 run job=CompressedTest yes
36 scripts/check_for_zombie_jobs storage=File
37 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
38 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
39 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
43 @# Force decremental on the second Volume
44 update volume=TestVolume001 VolStatus=Used
45 run level=decremental job=CompressedTest yes
50 scripts/check_for_zombie_jobs storage=File
51 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
52 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
56 run level=incremental job=CompressedTest yes
95 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
102 scripts/check_for_zombie_jobs storage=File
103 bin/bacula stop 2>&1 >/dev/null
104 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
106 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
109 # Delete .c files because we will only restored the txt files
112 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
113 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
116 echo " !!!!! query-test Bacula source failed!!! !!!!! "
117 echo " !!!!! query-test failed!!! !!!!! " >>test.out
118 if [ $bstat != 0 -o $rstat != 0 ] ; then
119 echo " !!!!! Bad Job termination status !!!!! "
120 echo " !!!!! Bad Job termination status !!!!! " >>test.out
122 echo " !!!!! Restored files differ !!!!! "
123 echo " !!!!! Restored files differ !!!!! " >>test.out
127 echo " ===== query-test Bacula source OK `date +%R:%S` ===== "
128 echo " ===== query-test OK `date +%R:%S` ===== " >>test.out