X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Ftwo-vol-manual-tape;h=e5a80aa3b0024cc090a4a3c3aea5fa12ae1e40eb;hb=1da285e3f27c7466382bd72ef7a7c6621283ee80;hp=0eae8e2ed9ffdc68c26ff1eea01a42d3514efe36;hpb=0c34b1fd94f8f8f7158bf7b7ed08523337c8ddc3;p=bacula%2Fbacula diff --git a/regress/tests/two-vol-manual-tape b/regress/tests/two-vol-manual-tape index 0eae8e2ed9..e5a80aa3b0 100755 --- a/regress/tests/two-vol-manual-tape +++ b/regress/tests/two-vol-manual-tape @@ -11,33 +11,60 @@ JobName=twovolmanualtape require_tape_drive require_autochanger -scripts/cleanup-tape +scripts/cleanup scripts/copy-tape-confs echo "${cwd}/build" >${cwd}/tmp/file-list +MTX=$AUTOCHANGER_SCRIPT + +# Sleep longer if real tape +if [ x${USE_VTAPE} = xyes ] ; then + sleep=20 +else + sleep=90 +fi + +slot=0 +export slot + +# TODO -- check this +init_slot $TAPE_DRIVE $SLOT1 +init_slot $TAPE_DRIVE $SLOT2 + +load_slot1 + +init_drive ${TAPE_DRIVE} change_jobname $JobName start_test -# Write out bconsole commands +# Label second volume cat <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; +label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0 +unmount storage=DDS-4 +quit +END_OF_DATA + +run_bacula -@#setdebug level=150 storage=DDS-4 +# Load slot2 +load_other_slot $slot +init_drive ${TAPE_DRIVE} + +# label first volume, and run first half of job +cat <tmp/bconcmds +@$out tmp/log1.out +label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0 +update Volume=TestVolume001 MaxVolBytes=500000 pool=Default drive=0 +list volumes +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; - +@sleep $sleep +list volumes unmount storage=DDS-4 list volumes status storage=DDS-4 @@ -45,32 +72,15 @@ messages quit END_OF_DATA -run_bacula +run_bconsole + +load_other_slot $slot -# 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 <tmp/bconcmds @$out tmp/log1.out -label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0 mount storage=DDS-4 +@# backup should continue +wait @# @# now do a restore @# @@ -83,7 +93,7 @@ messages quit END_OF_DATA -# run second half +# run second half of backup + restore run_bconsole touch tmp/log2.out