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
17 bin/bacula stop 2>&1 >/dev/null
19 ./drop_bacula_tables >/dev/null 2>&1
20 ./make_bacula_tables >/dev/null 2>&1
21 ./grant_bacula_privileges 2>&1 >/dev/null
26 echo " === Starting query-test ==="
27 echo " === Starting query-test ===" >>working/log
30 bin/bacula start 2>&1 >/dev/null
31 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
35 label storage=File volume=TestVolume001
36 label storage=File volume=TestVolume002
37 run job=CompressedTest yes
42 scripts/check_for_zombie_jobs storage=File
43 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
44 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
45 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
49 @# Force decremental on the second Volume
50 update volume=TestVolume001 VolStatus=Used
51 run level=decremental job=CompressedTest yes
56 scripts/check_for_zombie_jobs storage=File
57 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
58 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
62 run level=incremental job=CompressedTest yes
101 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
108 scripts/check_for_zombie_jobs storage=File
109 bin/bacula stop 2>&1 >/dev/null
110 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
112 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
115 # Delete .c files because we will only restored the txt files
118 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
119 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
122 echo " !!!!! query-test Bacula source failed!!! !!!!! "
123 echo " !!!!! query-test failed!!! !!!!! " >>test.out
126 echo " ===== query-test Bacula source OK ===== "
127 echo " ===== query-test OK ===== " >>test.out