3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do a differential and restore those two files.
7 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
20 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
21 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
26 echo " === Starting differential-test at `date +%R:%S` ==="
27 echo " === Starting differential-test at `date +%R:%S` ===" >>working/log
30 cat <<END_OF_DATA >tmp/bconcmds
34 label storage=File volume=TestVolume001
35 label storage=File volume=TestVolume002
36 run job=CompressedTest yes
42 if test "$debug" -eq 1 ; then
44 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
46 bin/bacula start 2>&1 >/dev/null
47 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
54 cat <<END_OF_DATA >tmp/bconcmds
58 @# Force differential on the second Volume
59 update volume=TestVolume001 VolStatus=Used
60 run level=differential job=CompressedTest yes
66 if test "$debug" -eq 1 ; then
67 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
69 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
72 scripts/check_for_zombie_jobs storage=File
73 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
75 cat <<END_OF_DATA >tmp/bconcmds
79 run level=incremental job=CompressedTest yes
86 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
94 if test "$debug" -eq 1 ; then
95 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
97 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
100 scripts/check_for_zombie_jobs storage=File
101 bin/bacula stop 2>&1 >/dev/null
102 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
104 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
107 # Delete .c files because we will only restore the txt files
110 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
111 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
114 echo " !!!!! differential-test Bacula source failed!!! !!!!! "
115 echo " !!!!! differential-test failed!!! !!!!! " >>test.out
116 if [ $bstat != 0 -o $rstat != 0 ] ; then
117 echo " !!!!! Bad Job termination status !!!!! "
118 echo " !!!!! Bad Job termination status !!!!! " >>test.out
120 echo " !!!!! Restored files differ !!!!! "
121 echo " !!!!! Restored files differ !!!!! " >>test.out
125 echo " ===== differential-test Bacula source OK ===== "
126 echo " ===== differential-test OK ===== " >>test.out