]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/four-jobs-tape
ebl add runscript regression script (not yet works well)
[bacula/bacula] / regress / tests / four-jobs-tape
index 92e2e957651609540debfdd23f22a6bac068379e..4252ba2d7eaf3f0ede77152c50134bc8a9d1090d 100755 (executable)
@@ -4,32 +4,27 @@
 #   then backup four times, each with incremental then finally restore.
 #   It should require at least 4 different bsrs.
 #
-debug=0
-if test "$debug" -eq 1 ; then
-  out="tee"
-else
-  out="output"
-fi
-cwd=`pwd`
-scripts/copy-tape-confs
+TestName="four-jobs-tape"
+JobName=fourjobstape
+. scripts/functions
+set_debug 0
+
 scripts/cleanup-tape
+scripts/copy-tape-confs
 echo "${cwd}/build" >/tmp/file-list
 
-echo " "
-echo " "
-echo " === Starting four-jobs-tape at `date +%R:%S` ==="
-echo " === Starting four-jobs-tape at `date +%R:%S` ===" >>working/log
-echo " "
+change_jobname $JobName
+start_test
 
 cat <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
-estimate job=NightlySave listing
-estimate job=NightlySave listing
-estimate job=NightlySave listing
+estimate job=$JobName listing
+estimate job=$JobName listing
+estimate job=$JobName listing
 messages
 @$out tmp/log1.out
 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
-run job=NightlySave yes
+run job=$JobName yes
 wait
 messages
 quit
@@ -55,7 +50,7 @@ cat <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
 messages
 @$out tmp/log1.out
-run job=NightlySave level=Incremental yes
+run job=$JobName level=Incremental yes
 wait
 messages
 quit
@@ -79,7 +74,7 @@ cat <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
 messages
 @$out tmp/log1.out
-run job=NightlySave level=Incremental yes
+run job=$JobName level=Incremental yes
 wait
 messages
 quit
@@ -103,7 +98,7 @@ cat <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
 messages
 @$out tmp/log1.out
-run job=NightlySave level=Incremental yes
+run job=$JobName level=Incremental yes
 wait
 messages
 quit
@@ -148,28 +143,11 @@ messages
 @$out
 quit
 END_OF_DATA
-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
 
-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 "  !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
-   echo "  !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== four-jobs-tape Bacula source OK ===== "
-   echo "  ===== four-jobs-tape OK ===== " >>test.out
-   scripts/cleanup
-fi
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test