X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fbackup-bacula-test;h=0815c38316630e96ac76638ddf4c295e2928a681;hb=414ee85d83197d4f61499f9542455695fa7da276;hp=e382cafa22bd05614048ae980a0b774dd1b5337f;hpb=d283b70144ce6e198d752c5027a9d931c4ef4167;p=bacula%2Fbacula diff --git a/regress/tests/backup-bacula-test b/regress/tests/backup-bacula-test index e382cafa22..0815c38316 100755 --- a/regress/tests/backup-bacula-test +++ b/regress/tests/backup-bacula-test @@ -3,37 +3,36 @@ # Run a simple backup of the Bacula build directory # then restore it. # -cwd=`pwd` -scripts/copy-confs +TestName="backup-bacula-test" +JobName=backup +. scripts/functions + scripts/cleanup +scripts/copy-confs -echo " " -echo " " -echo " === Starting Backup Bacula Test ===" -echo " === Starting Backup Bacula Test ===" >>working/log -echo " " +change_jobname Client1 $JobName +start_test -#bin/bacula start 2>&1 >/dev/null -bin/bacula start -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds @output /dev/null messages -@output tmp/log1.out -label volume=TestVolume001 -run job=Client1 yes +@$out ${cwd}/tmp/log1.out +label volume=TestVolume001 storage=File pool=Default +@#setdebug level=100 storage=File +run job=$JobName yes status storage=File status storage=File status storage=File status storage=File status storage=File status storage=File -sleep 1 +@sleep 1 status storage=File status storage=File status storage=File status storage=File status storage=File -sleep 1 +@sleep 1 status storage=File status storage=File status storage=File @@ -44,36 +43,50 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out ${cwd}/tmp/log1.out +@#setdebug level=100 storage=File +run job=$JobName yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select all done yes wait messages -@output +@$out quit END_OF_DATA -scripts/check_for_zombie_jobs storage=File -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=$? -diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! Backup Bacula Test failed!!! !!!!! " - echo " !!!!! Backup Bacula Test failed!!! !!!!! " >>test.out - if [ $bstat != 0 -o $rstat != 0 ] ; then - echo " !!!!! Bad Job termination status !!!!! " - echo " !!!!! Bad Job termination status !!!!! " >>test.out - else - echo " !!!!! Restored files differ !!!!! " - echo " !!!!! Restored files differ !!!!! " >>test.out - fi - echo " " -else - echo " ===== Backup Bacula Test OK ===== " - echo " ===== Backup Bacula Test OK ===== " >>test.out - scripts/cleanup -fi + +# +# Now do a second backup after making a few changes +# +touch ${cwd}/build/src/dird/*.c +echo "test test" > ${cwd}/build/src/dird/xxx +# + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +check_restore_diff +end_test