]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/four-jobs-tape
Big backport from Enterprise
[bacula/bacula] / regress / tests / four-jobs-tape
index 3212e4ca275f059cd4fa5fba5bc2ee4a470eb44f..e1747c513b8ccaeddc3467dc8e82cba6d28f085d 100755 (executable)
@@ -1,13 +1,20 @@
 #!/bin/sh
+#
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+
 #
 # Run a simple backup of the Bacula build directory using the compressed option
 #   then backup four times, each with incremental then finally restore.
 #   It should require at least 4 different bsrs.
 #
-TestName="four-jobs-1t1d-tape"
+TestName="four-jobs-tape"
 JobName=fourjobstape
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
 echo "${cwd}/build" >${cwd}/tmp/file-list
@@ -18,26 +25,19 @@ start_test
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out /dev/null
 estimate job=$JobName listing
-estimate job=$JobName listing
-estimate job=$JobName listing
+estimate job=$JobName
+estimate job=$JobName
 messages
 @$out ${cwd}/tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
+label storage=tape volume=TestVolume001 slot=0 pool=Default
 run job=$JobName yes
 wait
 messages
 quit
 END_OF_DATA
-if test "$debug" -eq 1 ; then
-  bin/bacula start
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  bin/bacula start 2>&1 >/dev/null
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
+run_bacula
 
-scripts/check_for_zombie_jobs storage=DDS-4
-echo "Backup 1 done"
+scripts/check_for_zombie_jobs storage=tape
 # make some files for the incremental to pick up
 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
@@ -54,16 +54,10 @@ wait
 messages
 quit
 END_OF_DATA
-if test "$debug" -eq 1 ; then
-  bin/bacula start
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  bin/bacula start 2>&1 >/dev/null
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
 
-scripts/check_for_zombie_jobs storage=DDS-4
-echo "Backup 2 done"
+run_bacula
+
+scripts/check_for_zombie_jobs storage=tape
 touch ${cwd}/build/src/dird/*.c
 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
 #
@@ -78,16 +72,10 @@ wait
 messages
 quit
 END_OF_DATA
-if test "$debug" -eq 1 ; then
-  bin/bacula start
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  bin/bacula start 2>&1 >/dev/null
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
 
-scripts/check_for_zombie_jobs storage=DDS-4
-echo "Backup 3 done"
+run_bacula
+
+scripts/check_for_zombie_jobs storage=tape
 # make some files for the incremental to pick up
 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
 #
@@ -102,16 +90,9 @@ wait
 messages
 quit
 END_OF_DATA
-if test "$debug" -eq 1 ; then
-  bin/bacula start
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  bin/bacula start 2>&1 >/dev/null
-  cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
+run_bacula
 
-scripts/check_for_zombie_jobs storage=DDS-4
-echo "Backup 4 done"
+scripts/check_for_zombie_jobs storage=tape
 # 
 # now do several restores to ensure we cleanup between jobs
 #
@@ -128,7 +109,7 @@ wait
 @# now unmount the tape and start two restores
 @#  at the same time
 @#
-unmount storage=DDS-4
+unmount storage=tape
 restore where=${cwd}/tmp/bacula-restores select all done
 yes
 restore where=${cwd}/tmp/bacula-restores select
@@ -136,15 +117,14 @@ unmark *
 mark *
 done
 yes
-mount storage=DDS-4
+mount storage=tape
 wait
 messages
-@$out
 quit
 END_OF_DATA
 
 run_bacula
-check_for_zombie_jobs storage=DDS-4
+check_for_zombie_jobs storage=tape
 stop_bacula
 
 check_two_logs