3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do a Decremental and restore those two files.
7 scripts/copy-test-confs
9 echo "${cwd}/tmp/build" >/tmp/file-list
10 mkdir ${cwd}/tmp/build
11 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
13 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
14 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
19 echo " === Starting decremental-test at `date +%R:%S` ==="
20 echo " === Starting decremental-test at `date +%R:%S` ===" >>working/log
23 bin/bacula start 2>&1 >/dev/null
24 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
28 label storage=File volume=TestVolume001
29 label storage=File volume=TestVolume002
30 run job=CompressedTest yes
35 scripts/check_for_zombie_jobs storage=File
36 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
37 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
38 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
42 @# Force decremental on the second Volume
43 update volume=TestVolume001 VolStatus=Used
44 run level=decremental job=CompressedTest yes
49 scripts/check_for_zombie_jobs storage=File
50 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
51 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
55 run level=incremental job=CompressedTest yes
62 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
69 scripts/check_for_zombie_jobs storage=File
70 bin/bacula stop 2>&1 >/dev/null
71 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
73 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
76 # Delete .c files because we will only restored the txt files
79 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
80 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
83 echo " !!!!! decremental-test Bacula source failed!!! !!!!! "
84 echo " !!!!! decremental-test failed!!! !!!!! " >>test.out
85 if [ $bstat != 0 -o $rstat != 0 ] ; then
86 echo " !!!!! Bad Job termination status !!!!! "
87 echo " !!!!! Bad Job termination status !!!!! " >>test.out
89 echo " !!!!! Restored files differ !!!!! "
90 echo " !!!!! Restored files differ !!!!! " >>test.out
94 echo " ===== decremental-test Bacula source OK ===== "
95 echo " ===== decremental-test OK ===== " >>test.out