X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fincremental-test;h=b7dca5200050f745cad4e73eca595b3f446dd0c0;hb=a47d15cbcf6e8d54a7c9604b4e4ea897f7ee0056;hp=0c442894e1c4cb27964ab64c36c10e21b31748cd;hpb=bd1975d9d3da8162240c6e2895d1a97a209c7c92;p=bacula%2Fbacula diff --git a/regress/tests/incremental-test b/regress/tests/incremental-test index 0c442894e1..b7dca52000 100755 --- a/regress/tests/incremental-test +++ b/regress/tests/incremental-test @@ -3,84 +3,172 @@ # Run a simple backup of the Bacula build directory then create some # new files, do an Incremental and restore those two files. # -cwd=`pwd` -scripts/copy-test-confs -scripts/cleanup -echo "${cwd}/tmp/build" >/tmp/file-list -mkdir ${cwd}/tmp/build -cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build -cd ${cwd}/tmp -echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list -echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list +TestName="incremental-test" +JobName=Incremental +. scripts/functions + +${rscripts}/cleanup +${rscripts}/copy-test-confs +echo "${tmpsrc}" >${tmp}/file-list +mkdir -p ${tmpsrc} +cp -p ${src}/src/dird/*.c ${tmpsrc} +cd ${tmp} +echo "${tmpsrc}/ficheriro1.txt" >restore-list +echo "${tmpsrc}/ficheriro2.txt" >>restore-list cd ${cwd} -bin/bacula stop 2>&1 >/dev/null -cd bin -./drop_bacula_tables >/dev/null 2>&1 -./make_bacula_tables >/dev/null 2>&1 -./grant_bacula_privileges 2>&1 >/dev/null -cd .. - -echo " " -echo " " -echo " === Starting incremental-test ===" -echo " === Starting incremental-test ===" >>working/log -echo " " - -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +@#setdebug level=100 storage=File +@#setdebug level=200 client +@#setdebug level=100 director label storage=File volume=TestVolume001 label storage=File volume=TestVolume002 -run job=CompressedTest yes +run job=$JobName yes wait messages quit END_OF_DATA -echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt -echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt -bin/bconsole -c bin/bconsole.conf <${tmpsrc}/ficheriro1.txt +cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt + +cat <${tmp}/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out ${tmp}/log1.out @# Force Incremental on the second Volume update volume=TestVolume001 VolStatus=Used -run level=Incremental job=CompressedTest yes +run level=Differential job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +sleep 1 +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run level=Incremental job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +sleep 1 +cd ${tmpsrc} +cp -f ficheriro2.txt 1 +sed "s%a%b%g" 1 >ficheriro2.txt +rm -f 1 +cd ${cwd} +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run level=Differential job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +sleep 1 +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run level=Incremental job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +sleep 1 +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run level=Incremental job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole + +sleep 1 +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +run level=Incremental job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bconsole +sleep 1 +touch ${tmpsrc}/ficheriro1.txt +touch ${tmpsrc}/ficheriro2.txt + +cat <${tmp}/bconcmds +@$out /dev/null +messages +@$out ${tmp}/log1.out +setdebug level=200 storage=File +run level=Incremental job=$JobName yes wait messages @# @# now do a restore @# -@output tmp/log2.out -restore where=${cwd}/tmp/bacula-restores -7 -<${cwd}/tmp/restore-list - +@$out ${tmp}/log2.out +setdebug level=10 storage=File +restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list yes wait +status storage=File messages -@output quit END_OF_DATA -bin/bacula stop 2>&1 >/dev/null -grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null -bstat=$? -grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null -rstat=$? + +run_bconsole +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs # # Delete .c files because we will only restored the txt files # -rm -f tmp/build/*.c -diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! incremental-test Bacula source failed!!! !!!!! " - echo " !!!!! incremental-test failed!!! !!!!! " >>test.out - echo " " -else - echo " ===== incremental-test Bacula source OK ===== " - echo " ===== incremental-test OK ===== " >>test.out - scripts/cleanup -fi +rm -f ${tmpsrc}/*.c +check_restore_tmp_build_diff +end_test