3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental and restore those two files.
5 # test the bvfs interface
12 ${rscripts}/copy-test-confs
13 echo "${tmpsrc}" >${tmp}/file-list
14 echo "${cwd}/build" >> ${tmp}/file-list
17 cp -p ${src}/src/dird/*.c ${tmpsrc}
19 echo "${tmpsrc}/ficheriro1.txt" >restore-list
20 echo "${tmpsrc}/ficheriro2.txt" >>restore-list
23 change_jobname CompressedTest $JobName
26 cat <<END_OF_DATA >${tmp}/bconcmds
30 label storage=File volume=TestVolume001
31 label storage=File volume=TestVolume002
39 check_for_zombie_jobs storage=File
41 # Now create two new files to be restored later
44 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
45 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
47 cat <<END_OF_DATA >${tmp}/bconcmds
51 @# Force Incremental on the second Volume
52 update volume=TestVolume001 VolStatus=Used
53 run level=Differential job=$JobName yes
62 touch ${tmpsrc}/ficheriro1.txt
63 touch ${tmpsrc}/ficheriro2.txt
65 cat <<END_OF_DATA >${tmp}/bconcmds
69 run level=Incremental job=$JobName yes
79 cp -f ficheriro2.txt 1
80 sed "s%a%b%g" 1 >ficheriro2.txt
83 cat <<END_OF_DATA >${tmp}/bconcmds
87 run level=Differential job=$JobName yes
96 touch ${tmpsrc}/ficheriro1.txt
97 touch ${tmpsrc}/ficheriro2.txt
98 cat <<END_OF_DATA >${tmp}/bconcmds
101 @$out ${tmp}/log1.out
102 run level=Incremental job=$JobName yes
111 touch ${tmpsrc}/ficheriro1.txt
112 touch ${tmpsrc}/ficheriro2.txt
113 cat <<END_OF_DATA >${tmp}/bconcmds
116 @$out ${tmp}/log1.out
117 run level=Incremental job=$JobName yes
126 touch ${tmpsrc}/ficheriro1.txt
127 touch ${tmpsrc}/ficheriro2.txt
128 cat <<END_OF_DATA >${tmp}/bconcmds
131 @$out ${tmp}/log1.out
132 run level=Incremental job=$JobName yes
140 touch ${tmpsrc}/ficheriro1.txt
141 touch ${tmpsrc}/ficheriro2.txt
143 cat <<END_OF_DATA >${tmp}/bconcmds
146 @$out ${tmp}/log1.out
147 run level=Incremental job=$JobName yes
153 @$out ${tmp}/log2.out
154 setdebug level=10 storage=File
155 restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
160 @$out ${tmp}/log3.out
161 setdebug level=10 director
164 SELECT HasCache FROM Job WHERE Type='B';
166 .bvfs_lsdir path=${tmpsrc}/ jobid=1,2,3,4,5,6,7,8
167 .bvfs_lsfile path=${tmpsrc}/ jobid=1,2,3,4,5,6,7,8
172 check_for_zombie_jobs storage=File
177 # Delete .c files because we will only restored the txt files
180 check_restore_tmp_build_diff
182 ${cwd}/build/src/tools/bvfs_test -T -p ${tmpsrc} -j 1,2,3,4,5,6,7,8 \
183 -w "$working" -n "$db_name" -u "$db_user" -P "$db_password"
185 ${cwd}/build/src/tools/bvfs_test -p ${cwd}/build/ -j 1,2,3,4,5,6,7,8 \
186 -w "$working" -n "$db_name" -u "$db_user" -P "$db_password"
188 ${cwd}/build/src/tools/bvfs_test -p ${tmpsrc} -j 1,2,3,4,5,6,7,8 \
189 -w "$working" -n "$db_name" -u "$db_user" -P "$db_password" \
190 -f ficheriro1.txt -c ${HOST}-fd