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-test-changer"
21 scripts/copy-tape-confs
22 cp scripts/bacula-dir-vtape.conf bin/bacula-dir.conf
23 cp scripts/bacula-sd-vtape.conf bin/bacula-sd.conf
24 scripts/prepare-fake-autochanger
26 echo "${cwd}/build" >${cwd}/tmp/file-list
30 when1=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+30))"`
31 when2=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+45))"`
33 clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf`
35 # Catalog record for cleaning tape "CLN01" successfully created.
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
42 @$out ${cwd}/tmp/log6.out
43 @#setdebug level=200 storage=LTO1
44 label barcodes pool=Scratch slots=1-4 storage=LTO1-ANSI_6 drive=6
46 label barcodes pool=Scratch slots=5-40 storage=LTO1 drive=3
55 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
56 @$out ${cwd}/tmp/log7.out
57 label barcodes pool=Scratch slots=41-80 storage=LTO3 drive=0
61 @$out ${cwd}/tmp/log1.out
62 run storage=LTO3 when="$when1" job=NightlySave pool=Inc yes
63 run storage=LTO3 when="$when1" job=NightlySave2 pool=Full yes
64 run storage=LTO3 when="$when1" job=NightlySave1 pool=Default yes
66 run storage=LTO1 when="$when1" job=NightlySave pool=Inc yes
67 run storage=LTO1 when="$when1" job=NightlySave2 pool=Full yes
68 run storage=LTO1 when="$when1" job=NightlySave1 pool=Default yes
69 run storage=LTO1 when="$when1" job=NightlySave3 pool=Diff yes
71 run storage=LTO1-ANSI_6 when="$when2" job=NightlySave pool=Inc yes
78 check_for_zombie_jobs storage=LTO1 $clientname
79 check_for_zombie_jobs storage=LTO3 $clientname
80 check_for_zombie_jobs storage=LTO1-ANSI_6 $clientname
82 touch ${cwd}/build/po/*.po
84 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
85 @$out ${cwd}/tmp/log2.out
86 run storage=LTO1-ANSI_6 job=NightlySave3 pool=Inc yes
92 restore fileset="Full Set" pool=Diff where=${cwd}/tmp/bacula-restores select all done
101 check_for_zombie_jobs storage=LTO1 $clientname
102 check_for_zombie_jobs storage=LTO3 $clientname
103 check_for_zombie_jobs storage=LTO1-ANSI_6 $clientname
109 grep LTO1_5 tmp/log1.out > /dev/null
111 echo "AutoSelect option broken"
115 grep 'Error: Re-read' tmp/log1.out > /dev/null
117 echo "Found Re-read errors"