X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fbackup-bacula-test;h=3b33a17c5accb620175a8c96931d0a3e59c65e61;hb=a752597b2a79ba0f2dfb0ec6b6da8403464e092b;hp=511a88f149b1d7f564bb41dfd81e77a8d0976ad8;hpb=4ee91493e376603836ad60ae78da1a0e603c9755;p=bacula%2Fbacula diff --git a/regress/tests/backup-bacula-test b/regress/tests/backup-bacula-test index 511a88f149..3b33a17c5a 100755 --- a/regress/tests/backup-bacula-test +++ b/regress/tests/backup-bacula-test @@ -3,47 +3,91 @@ # Run a simple backup of the Bacula build directory # then restore it. # +debug=0 +if test "$debug" -eq 1 ; then + out="tee" +else + out="output" +fi + cwd=`pwd` scripts/copy-confs -rm -rf /tmp/TestVolume001 /tmp/bacula-restores -bin/bacula stop -bin/drop_sqlite_tables -bin/make_sqlite_tables -bin/bacula start -bin/console -c bin/console.conf <>working/log +echo " " + +cat <tmp/bconcmds +@$out /dev/null messages -@output -label -TestVolume001 -run job=NightlySave -yes +@$out tmp/log1.out +label volume=TestVolume001 +run job=Client1 yes +status storage=File +status storage=File +status storage=File +status storage=File +status storage=File +status storage=File +sleep 1 +status storage=File +status storage=File +status storage=File +status storage=File +status storage=File +sleep 1 +status storage=File +status storage=File +status storage=File +status storage=File +status storage=File wait messages @# @# now do a restore @# -restore -5 -done +@$out tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select all done yes -@sleep 1 wait -@output /dev/null messages +@$out quit END_OF_DATA -sleep 2 -bin/bacula stop -diff -ur build /tmp/bacula-restores${cwd}/build -if [ $? != 0 ] ; then + +if test "$debug" -eq 1 ; then + bin/bacula start + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + +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 " ===== Test1 Bacula source failed!!! ===== " - echo " ===== Test1 failed!!! ===== " >>test.out + 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 " ===== Test1 Bacula source OK ===== " - echo " ===== Test1 OK ===== " >>test.out + echo " ===== Backup Bacula Test OK ===== " + echo " ===== Backup Bacula Test OK ===== " >>test.out + scripts/cleanup fi -rm -rf /tmp/bacula-restores