]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/accurate-test
update
[bacula/bacula] / regress / tests / accurate-test
index 0d84e9ad45e0b9e15ff3fa08ed69b0c8c23480a5..b2211d3fdcb39c1fc13d76cc13723415413216f7 100755 (executable)
@@ -7,6 +7,7 @@
 # Run a accurate backup of the Bacula build directory
 #   then restore it.
 #
+
 TestName="accurate-test"
 JobName=backup
 . scripts/functions
@@ -14,7 +15,8 @@ scripts/cleanup
 
 copy_test_confs
 /bin/cp -f scripts/bacula-dir.conf.accurate bin/bacula-dir.conf
-sed -i s/all,/all,saved,/ bin/bacula-fd.conf
+sed s/all,/all,saved,/ bin/bacula-fd.conf > tmp/1
+cp tmp/1 bin/bacula-fd.conf
 
 change_jobname Client1 $JobName
 
@@ -25,6 +27,8 @@ rm -rf ${cwd}/build/accurate
 
 # add extra files
 mkdir ${cwd}/build/accurate
+mkdir ${cwd}/build/accurate/dirtest
+echo "test test" > ${cwd}/build/accurate/dirtest/hello
 echo "test test" > ${cwd}/build/accurate/xxx
 echo "test test" > ${cwd}/build/accurate/yyy
 echo "test test" > ${cwd}/build/accurate/zzz
@@ -56,6 +60,7 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out  
+setdebug level=10 storage=File
 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -80,12 +85,14 @@ rm -rf ${cwd}/tmp/bacula-restores
 # Now do a second backup after making few changes
 ################################################################
 rm ${cwd}/build/accurate/xxx  # delete a file
+rm ${cwd}/build/accurate/dirtest/hello
 
 run_bconsole
 check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 4
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -93,12 +100,14 @@ rm -rf ${cwd}/tmp/bacula-restores
 # Now do a third backup after making few changes
 ################################################################
 rm ${cwd}/build/accurate/yyyyyy  # delete a file
+rmdir ${cwd}/build/accurate/dirtest
 
 run_bconsole
 check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 3
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -112,6 +121,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -125,6 +135,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -138,6 +149,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -179,6 +191,7 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out  
+setdebug level=10 storage=File
 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -211,6 +224,7 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out  
+setdebug level=10 storage=File
 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -235,6 +249,7 @@ touch ${cwd}/build/accurate/bbbbbb
 
 run_bconsole
 check_for_zombie_jobs storage=File
+check_files_written ${cwd}/tmp/log1.out 3
 
 check_two_logs
 check_restore_diff
@@ -266,7 +281,9 @@ cd ..
 
 echo "volume=TestVolume001" >tmp/bscan.bsr
 
-${cwd}/bin/bscan -c ${cwd}/bin/bacula-sd.conf -n regress -u regress -m -s -b tmp/bscan.bsr FileStorage 2>&1 > ${cwd}/tmp/bscan.log
+bscan_libdbi
+
+${cwd}/bin/bscan -c ${cwd}/bin/bacula-sd.conf $BSCANLIBDBI -n regress -u regress -m -s -b tmp/bscan.bsr FileStorage 2>&1 > ${cwd}/tmp/bscan.log
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log1.out
@@ -275,6 +292,7 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out  
+setdebug level=10 storage=File
 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -307,6 +325,7 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out  
+setdebug level=10 storage=File
 restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -339,6 +358,7 @@ messages
 @# now do a restore
 @#
 @$out ${cwd}/tmp/log2.out  
+setdebug level=10 storage=File
 restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -352,6 +372,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 1
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -361,7 +382,7 @@ rm -rf ${cwd}/tmp/bacula-restores
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log1.out
-setdebug  level=1 client
+setdebug  level=1 client=$CLIENT
 run job=backup fileset=FS_TESTJOB2 yes
 wait
 messages
@@ -390,7 +411,7 @@ run_bconsole
 
 grep yyy ${cwd}/tmp/log3.out > /dev/null
 if [ $? != 0 ] ; then
-    print_debug "Can't find xxx file into 'list files' output (${cwd}/tmp/log3.out)"
+    print_debug "Can't find yyy file into 'list files' output (${cwd}/tmp/log3.out)"
     dstat=2
 fi
 
@@ -402,4 +423,3 @@ fi
 
 stop_bacula
 end_test
-