3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental 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 incremental-test ==="
20 echo " === Starting incremental-test ===" >>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
37 # Now create two new files to be restored later
40 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
41 cp -f ${cwd}/tmp/build/dird.c ${cwd}/tmp/build/ficheriro2.txt
42 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
46 @# Force Incremental on the second Volume
47 update volume=TestVolume001 VolStatus=Used
48 run level=Differential job=CompressedTest yes
54 touch ${cwd}/tmp/build/ficheriro1.txt
55 touch ${cwd}/tmp/build/ficheriro2.txt
56 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
60 run level=Incremental job=CompressedTest yes
67 cp -f ficheriro2.txt 1
68 sed "s%a%b%g" 1 >ficheriro2.txt
71 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
75 run level=Differential job=CompressedTest yes
81 touch ${cwd}/tmp/build/ficheriro1.txt
82 touch ${cwd}/tmp/build/ficheriro2.txt
83 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
87 run level=Incremental job=CompressedTest yes
93 touch ${cwd}/tmp/build/ficheriro1.txt
94 touch ${cwd}/tmp/build/ficheriro2.txt
95 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
99 run level=Incremental job=CompressedTest yes
105 touch ${cwd}/tmp/build/ficheriro1.txt
106 touch ${cwd}/tmp/build/ficheriro2.txt
107 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
111 run level=Incremental job=CompressedTest yes
117 touch ${cwd}/tmp/build/ficheriro1.txt
118 touch ${cwd}/tmp/build/ficheriro2.txt
119 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
123 run level=Incremental job=CompressedTest yes
130 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
137 scripts/check_for_zombie_jobs storage=File
138 bin/bacula stop 2>&1 >/dev/null
139 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
141 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
144 # Delete .c files because we will only restored the txt files
147 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
148 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
151 echo " !!!!! incremental-test Bacula source failed!!! !!!!! "
152 echo " !!!!! incremental-test failed!!! !!!!! " >>test.out
155 echo " ===== incremental-test Bacula source OK ===== "
156 echo " ===== incremental-test OK ===== " >>test.out