]> git.sur5r.net Git - bacula/bacula/commitdiff
New tape test
authorKern Sibbald <kern@sibbald.com>
Tue, 5 Jul 2005 19:13:02 +0000 (19:13 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 5 Jul 2005 19:13:02 +0000 (19:13 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2176 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tape-tests
regress/scripts/copy-2tape-confs
regress/scripts/copy-tape-confs
regress/scripts/regress-config
regress/tests/backup-bacula-test
regress/tests/four-concurrent-jobs-tape
regress/tests/relabel-tape [new file with mode: 0755]

index a3b69bff5220cf94f2378bf0bf88eecaf99255df..83a6acc2a8d1c85f33d2257f08e0a17fc5ef3530 100755 (executable)
@@ -14,6 +14,7 @@ tests/fixed-block-size-tape
 tests/bscan-tape
 tests/btape-fill-tape
 tests/truncate-bug-tape
+tests/relabel-tape
 echo " "
 echo " "
 echo "Test results"
index dbf94663300ac5717dc978abff5133e7610be735..d91c681b5a32783cc124ee6bebb311838f1f51a4 100755 (executable)
@@ -3,3 +3,4 @@
 /bin/cp -f scripts/bacula-sd-2tape.conf bin/bacula-sd.conf
 /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
 /bin/cp -f scripts/test-console.conf bin/bconsole.conf
+touch bin/tape_options
index 588dddc35b1b2c7eb5a9ad85d926f05bfc4f9023..b9565193ca2b17e977d903d9b1603105d418474f 100755 (executable)
@@ -3,3 +3,4 @@
 /bin/cp -f scripts/bacula-sd-tape.conf bin/bacula-sd.conf
 /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
 /bin/cp -f scripts/test-console.conf bin/bconsole.conf
+touch bin/tape_options
index 7ef93d84b0231fac4d181e789de1ac5d9ff99127..95c8883892eb6ebb3b8bdf5e728a056eba7c3383 100755 (executable)
@@ -7,6 +7,7 @@ CFLAGS="-g -O2 -Wall" \
  ./configure \
     --sbindir=$1/bin \
     --sysconfdir=$1/bin \
+    --mandir=$1/bin \
     --with-pid-dir=$1/working \
     --with-subsys-dir=$1/working \
     --enable-smartalloc \
index fd00bf7d3150b20717275b70d7eba270f84c554a..ad279addc1aa5b80d809731db9e710880ad56ca5 100755 (executable)
@@ -13,8 +13,8 @@ echo " === Starting Backup Bacula Test at `date +%R:%S` ==="
 echo " === Starting Backup Bacula Test at `date +%R:%S` ===" >>working/log
 echo " "
 
-#bin/bacula start 2>&1 >/dev/null
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
+#bin/bacula start
 bin/bconsole -c bin/bconsole.conf  <<END_OF_DATA 2>&1 >/dev/null
 #bin/bconsole -c bin/bconsole.conf  <<END_OF_DATA
 @output /dev/null
index 47ea37d0e63c11683892832bdddf1c609fba19ed..f3e86c7ac7a5054a2670602f8cf4194c79e4a696 100755 (executable)
@@ -14,11 +14,13 @@ echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ==="
 echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ===" >>working/log
 echo " "
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+#bin/bacula start 2>&1 >/dev/null
+bin/bacula start
+#bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@tee /dev/null
 messages
-@output tmp/log1.out
+@tee tmp/log1.out
 label storage=DDS-4 volume=TestVolume001 slot=0
 run job=NightlySave level=Full Storage=DDS-4 yes
 run job=NightlySave level=Full Storage=DDS-4 yes
@@ -33,7 +35,7 @@ messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out
+@tee tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
 unmark *
 mark *
@@ -41,7 +43,7 @@ done
 yes
 wait
 messages
-@output
+@tee
 quit
 END_OF_DATA
 scripts/check_for_zombie_jobs storage=DDS-4
diff --git a/regress/tests/relabel-tape b/regress/tests/relabel-tape
new file mode 100755 (executable)
index 0000000..6b3a5b6
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# 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.
+#
+cwd=`pwd`
+
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "${cwd}/build" >/tmp/file-list
+
+echo " "
+echo " "
+echo " === Starting relabel-tape at `date +%R:%S` ==="
+echo " === Starting relabel-tape at `date +%R:%S` ===" >>working/log
+echo " "
+
+bin/bacula start 2>&1 >/dev/null
+#bin/bacula start
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+#bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0
+run job=NightlySave level=Full yes
+wait
+messages
+add
+0
+TestVolume002
+0
+no
+update volume=TestVolume001
+1
+4 
+.
+run job=NightlySave level=Full yes
+@sleep 20
+unmount
+unmount
+purge volume=TestVolume001
+relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0
+list volumes
+messages
+wait
+messages
+@output
+quit
+END_OF_DATA
+echo "Backup done"
+# 
+# now do several restores to ensure we cleanup between jobs
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+@output /dev/null
+restore where=${cwd}/tmp/bacula-restores select all done
+yes
+wait
+restore where=${cwd}/tmp/bacula-restores select all done
+yes
+wait
+@output tmp/log2.out
+@#
+@# now unmount the tape and start two restores
+@#  at the same time
+@#
+unmount storage=DDS-4
+restore where=${cwd}/tmp/bacula-restores select all done
+yes
+restore where=${cwd}/tmp/bacula-restores select
+unmark *
+mark *
+done
+yes
+mount storage=DDS-4
+wait
+messages
+@output
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+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
+dstat=$?
+if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  !!!!! relabel-tape Bacula source failed!!! !!!!! "
+   echo "  !!!!! relabel-tape failed!!! !!!!! " >>test.out
+   echo "diff=$dstat backup=$bstat restore=$rstat"
+   echo " "
+else
+   echo "  ===== relabel-tape Bacula source OK ===== "
+   echo "  ===== relabel-tape OK ===== " >>test.out
+   scripts/cleanup
+fi