3 # Run backups with dummy tape driver
4 # This test setups an Autochanger with 80 slots
5 # and 5 drives (3 LTO3 and 2 LTO1)
7 # TAPE_DRIVE="$cwd/working/ach/drive0"
8 # TAPE_DRIVE1="$cwd/working/ach/drive0"
9 # AUTOCHANGER="$cwd/working/ach/conf"
11 # AUTOCHANGER_SCRIPT=disk-changer
14 TestName="vtape-round-robin-changer"
21 scripts/copy-tape-confs
22 cp $rscripts/bacula-dir-vtape.conf $conf/bacula-dir.conf
23 cp $rscripts/bacula-sd-vtape.conf $conf/bacula-sd.conf
24 scripts/prepare-fake-autochanger
26 echo "${cwd}/build" >${cwd}/tmp/file-list
30 clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf`
32 # Catalog record for cleaning tape "CLN01" successfully created.
35 # Write out bconsole commands
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
39 @$out ${cwd}/tmp/log6.out
40 @#setdebug level=200 storage=LTO1
41 label barcodes pool=Scratch slots=1-40 storage=LTO3 drive=0
49 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
51 run storage=LTO3 job=NightlySave spooldata=no pool=Inc yes
56 @#setdebug level=150 Storage=LTO3
57 run storage=LTO3 job=NightlySave spooldata=no level=full pool=Inc yes
59 setdebug level=0 Storage=LTO3
66 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
71 restore client=$clientname fileset="Full Set" pool=Inc where=${cwd}/tmp/bacula-restores select all done
86 # Get the first slot used
87 s=`awk '/Issuing autochanger/ { print $13;exit }' $tmp/log3.out`
89 # count how many times we unload this volume
90 # Note the second job output is in log3.out
91 nb=`grep "unload .* Slot $s" $tmp/log3.out | wc -l`
92 if [ $nb -gt 1 ]; then
94 print_debug "ERROR: Found $nb 'unload slot $s' instead of 1 for the second job in $tmp/log3.out"