X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Faccurate-test;h=001d1106d585de3cb6fba8cdb978b686421b8623;hb=b76f7bc37b0fd454157e383cdf8e31672726dce3;hp=63087d52144ccedbc12cc27015a6c595f58a1611;hpb=ffa32a966cfb91081f528f12730c21637725869f;p=bacula%2Fbacula diff --git a/regress/tests/accurate-test b/regress/tests/accurate-test index 63087d5214..001d1106d5 100755 --- a/regress/tests/accurate-test +++ b/regress/tests/accurate-test @@ -7,16 +7,25 @@ # Run a accurate backup of the Bacula build directory # then restore it. # + TestName="accurate-test" JobName=backup . scripts/functions -scripts/cleanup +$rscripts/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 +cp -f $rscripts/bacula-dir.conf.accurate $conf/bacula-dir.conf +sed s/all,/all,saved,/ $conf/bacula-fd.conf > tmp/1 +cp tmp/1 $conf/bacula-fd.conf + +change_jobname BackupClient1 $JobName -change_jobname Client1 $JobName +p() { + echo "##############################################" >> ${cwd}/tmp/log1.out + echo "$*" >> ${cwd}/tmp/log1.out + echo "##############################################" >> ${cwd}/tmp/log2.out + echo "$*" >> ${cwd}/tmp/log2.out +} # cleanup rm -rf ${cwd}/build/accurate.new @@ -25,15 +34,23 @@ 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 +echo "test test" > ${cwd}/build/accurate/zzzzzz +echo "test test" > ${cwd}/build/accurate/xxxxxx +echo "test test" > ${cwd}/build/accurate/yyyyyy +echo "test test" > ${cwd}/build/accurate/xxxxxxxxx +echo "test test" > ${cwd}/build/accurate/yyyyyyyyy +echo "test test" > ${cwd}/build/accurate/zzzzzzzzz echo ${cwd}/build > ${cwd}/tmp/file-list start_test cat <${cwd}/tmp/bconcmds -@output /dev/null +@$out /dev/null messages label volume=TestVolume001 storage=File pool=Default messages @@ -50,16 +67,16 @@ 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 messages -@$out quit END_OF_DATA ################################################################ -# First : We just run full and restore to compare if all is ok +p First : We just run full and restore to compare if all is ok ################################################################ run_bconsole @@ -71,30 +88,89 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores ################################################################ -# Now do a second backup after making few changes +p 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 + +################################################################ +p 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 + +################################################################ +p Now do a 4 backup after making few changes +################################################################ +rm ${cwd}/build/accurate/zzzzzz # delete a file + +run_bconsole +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 + +################################################################ +p Now do a 5 backup after making few changes +################################################################ +rm ${cwd}/build/accurate/zzzzzzzzz run_bconsole 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 ################################################################ -# Check with bls +p Now do a backup after making few changes ################################################################ +touch ${cwd}/build/accurate/aaaaaa + +run_bconsole +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 -${cwd}/bin/bls -c ${cwd}/bin/bacula-sd.conf -V 'TestVolume001' FileStorage > tmp/bls.out -grep -- '----' tmp/bls.out | grep xxx > /dev/null +################################################################ +p Check with bls +################################################################ + +$bin/bls -c $conf/bacula-sd.conf -V 'TestVolume001' FileStorage > $tmp/bls.out +grep -- '----' $tmp/bls.out | grep xxx > /dev/null if [ $? != 0 ] ; then bstat=2 fi ################################################################ -# Now do a third backup after making few changes +p Now do a backup after making few changes ################################################################ # some files will have disappear, others have their old mtime/ctime @@ -109,7 +185,7 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores ################################################################ -# Now do an other test in differential mode +p Now do an other test in differential mode ################################################################ cat <${cwd}/tmp/bconcmds @@ -121,11 +197,11 @@ 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 messages -@$out quit END_OF_DATA @@ -138,7 +214,7 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores ################################################################ -# Now do an other test in differential mode + incremental +p Now do an other test in differential mode + incremental ################################################################ # make some changes @@ -153,11 +229,11 @@ 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 messages -@$out quit END_OF_DATA @@ -170,12 +246,38 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores ################################################################ -# Check with bscan +p Now do a backup after making few changes +################################################################ +rm ${cwd}/build/accurate/aaaaaa +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 + +################################################################ +p Now do a backup after making few changes +################################################################ +mv ${cwd}/tmp/bacula-restores ${cwd}/build/accurate/ + +run_bconsole +check_for_zombie_jobs storage=File + +check_two_logs +check_restore_diff + +rm -rf ${cwd}/tmp/bacula-restores ${cwd}/build/accurate/bacula-restores + +################################################################ +p Check with bscan ################################################################ stop_bacula -cd ${cwd}/bin +cd $bin ./drop_bacula_tables >/dev/null 2>&1 ./make_bacula_tables >/dev/null 2>&1 ./grant_bacula_privileges >/dev/null 2>&1 @@ -183,20 +285,22 @@ 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 + +$bin/bscan -c $conf/bacula-sd.conf $BSCANLIBDBI -n regress -u regress -m -s -b $tmp/bscan.bsr FileStorage 2>&1 > $tmp/bscan.log cat <${cwd}/tmp/bconcmds @$out ${cwd}/tmp/log1.out messages @# -@# now do a restore +@# now do a restore after bscan @# @$out ${cwd}/tmp/log2.out +setdebug level=10 storage=File restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done yes wait messages -@$out quit END_OF_DATA @@ -211,7 +315,7 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores ################################################################ -# Now do a test with other attributes (owner, gid, rights) +p Now do a test with other attributes: owner, gid, rights ################################################################ cat <${cwd}/tmp/bconcmds @@ -224,11 +328,11 @@ 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 messages -@$out quit END_OF_DATA @@ -242,7 +346,7 @@ rm -rf ${cwd}/tmp/bacula-restores ################################################################ -# Use the p option for verify +p Use the p option for verify ################################################################ chmod 400 ${cwd}/build/accurate/yyy @@ -256,11 +360,11 @@ 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 messages -@$out quit END_OF_DATA @@ -269,16 +373,17 @@ 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 ################################################################ -# Test strippath option +p Test strippath option ################################################################ cat <${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 @@ -307,7 +412,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 @@ -319,4 +424,3 @@ fi stop_bacula end_test -