]> git.sur5r.net Git - bacula/bacula/commitdiff
Update
authorKern Sibbald <kern@sibbald.com>
Fri, 20 Jun 2008 15:51:31 +0000 (15:51 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 20 Jun 2008 15:51:31 +0000 (15:51 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7196 91ce42f0-d328-0410-95d8-f526ca767f89

regress/DartTestfile.txt.in
regress/all-tape-tests
regress/tests/two-vol-manual-tape [new file with mode: 0755]
regress/tests/weird-files-test
regress/tests/weird-files2-test

index d84930c9667a22da93964387f75303dae6f2ae26..c955a9fb029582d1e9e3e9421a2838d71fc9862c 100644 (file)
@@ -78,6 +78,7 @@ ADD_TEST(tape:verify-vol-tape "@regressdir@/tests/verify-vol-tape")
 ADD_TEST(changer:incremental-changer "@regressdir@/tests/incremental-changer")
 ADD_TEST(changer:two-pool-changer "@regressdir@/tests/two-pool-changer")
 ADD_TEST(changer:two-volume-changer "@regressdir@/tests/two-volume-changer")
+ADD_TEST(changer:two-vol-manual-tape "@regressdir@/tests/two-vol-manual-tape")
 ADD_TEST(changer:vol-duration-changer "@regressdir@/tests/vol-duration-changer")
 
 ADD_TEST(2drive-changer:2drive-incremental-changer "@regressdir@/tests/2drive-incremental-changer")
index ab43bb28dec8e8cfff41d4225db6b192fbe7fa9e..366f8eec041436f94ef9b5ca90a45bce5233ec04 100755 (executable)
@@ -28,5 +28,6 @@ nice tests/restore-by-file-tape
 nice tests/small-file-size-tape
 nice tests/truncate-bug-tape
 nice tests/verify-vol-tape
+nice tests/two-vol-manual-tape
 echo "End all non-root tape tests"
 echo "End all non-root tape tests" >>test.out
diff --git a/regress/tests/two-vol-manual-tape b/regress/tests/two-vol-manual-tape
new file mode 100755 (executable)
index 0000000..888cfd8
--- /dev/null
@@ -0,0 +1,122 @@
+#!/bin/sh
+#
+# Run a job with a limited tape size so that the tape fills up.
+#  Then manually unload the tape and load a new one, label
+#  it.
+#
+TestName="two-vol-manual-tape"
+JobName=twovolmanualtape
+. scripts/functions
+
+require_tape_drive
+require_autochanger
+
+scripts/cleanup
+scripts/copy-tape-confs
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+# Get a tape in the drive either from slot 1 or slot 2
+slot=`bin/mtx-changer ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1`
+case $slot in
+ 0)
+    bin/mtx-changer ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
+    slot=$SLOT1
+    ;;
+ $SLOT1)
+    slot=$SLOT1
+    ;;
+ $SLOT2)
+    slot=$SLOT2
+    ;;
+ default)
+    mt -f ${TAPE_DRIVE} rewind                
+    bin/mtx-changer ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
+    bin/mtx-changer ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
+    slot=$SLOT1
+    ;;
+esac
+mt -f ${TAPE_DRIVE} rewind
+mt -f ${TAPE_DRIVE} weof
+
+
+change_jobname $JobName
+start_test
+
+# Write out bconsole commands
+cat <<END_OF_DATA >tmp/bconcmds
+@out /dev/null
+messages
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
+update Volume=TestVolume001 MaxVolBytes=4000000 pool=Default drive=0
+sql                               
+select * from Storage;
+select VolumeName,InChanger,StorageId from Media;
+
+@#setdebug level=150 storage=DDS-4
+run job=$JobName yes
+@# This sleep must be long enough for the first tape to fill (4MB)
+@#  otherwise the following mtx-changer commands will fail
+@sleep 80
+sql                               
+select * from Storage;
+select VolumeName,InChanger,StorageId from Media;
+
+unmount storage=DDS-4
+list volumes
+status storage=DDS-4
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+# load the other slot
+mt -f ${TAPE_DRIVE} rewind
+case $slot in
+ $SLOT1)
+    bin/mtx-changer ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
+    bin/mtx-changer ${AUTOCHANGER} load $SLOT2 ${TAPE_DRIVE} $DRIVE1
+    ;;
+ $SLOT2)
+    bin/mtx-changer ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
+    bin/mtx-changer ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
+    ;;
+ default)
+    echo "Something went wrong. Expected $SLOT1 or $SLOT2, got $slot"
+    exit 1
+esac
+
+mt -f ${TAPE_DRIVE} rewind
+mt -f ${TAPE_DRIVE} weof
+
+# second half of job -- write on next tape
+cat <<END_OF_DATA >tmp/bconcmds
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0
+mount storage=DDS-4
+@# 
+@# now do a restore
+@#
+@#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+@#yes
+wait
+list volumes
+messages
+@$out
+quit
+END_OF_DATA
+
+# run second half
+run_bconsole
+
+touch tmp/log2.out
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+#check_restore_diff
+dstat=0   # no diff
+rstat=0   # no restore
+end_test
index dbd88e00af9ae883e75215b3195ce2055680aae1..920ca7c60a8d822cc1aa87736df84559e7572ffe 100755 (executable)
@@ -72,7 +72,7 @@ ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored
 cd ${cwd}
 
 check_two_logs
-#diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
-diff ${cwd}/tmp/original ${cwd}/tmp/restored                
+#diff -u ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+diff -u ${cwd}/tmp/original ${cwd}/tmp/restored                
 dstat=$?
 end_test
index 8e3b6eaa50cdb0826394d2b18a2097199d88fc29..9a8e1dce3b0964b587ec0b36f456efc6a5f4af84 100755 (executable)
@@ -76,7 +76,7 @@ stop_bacula
 bin/testls weird-files2 >${cwd}/tmp/restored
 
 check_two_logs
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+diff -u ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
 #diff -u ${cwd}/tmp/original ${cwd}/tmp/restored
 dstat=$?