3 # Run backups with dummy tape driver
4 # This test setups an Autochanger with 800 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 $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 300
26 perl -Mscripts::functions \
27 -e "set_maximum_concurrent_jobs('$conf/bacula-dir.conf', 100)"
28 perl -Mscripts::functions \
29 -e "set_maximum_concurrent_jobs('$conf/bacula-sd.conf', 100)"
30 perl -Mscripts::functions \
31 -e "set_maximum_concurrent_jobs('$conf/bacula-fd.conf', 100)"
33 echo "${cwd}/build" >${cwd}/tmp/file-list
37 when1=`perl -Mscripts::functions -e "get_time(30)"`
38 when2=`perl -Mscripts::functions -e "get_time(45)"`
40 clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf`
42 perl -Mscripts::functions \
43 -e "extract_resource('$conf/bacula-dir.conf', 'Job', 'NightlySave')" > $tmp/1
45 for i in `seq 4 40`; do
46 sed "s%NightlySave%NightlySave$i%" $tmp/1 >> $conf/bacula-dir.conf
51 # Catalog record for cleaning tape "CLN01" successfully created.
54 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
55 @$out ${cwd}/tmp/log7.out
56 label barcodes pool=Scratch slots=1-300 storage=LTO3 drive=0
60 @$out ${cwd}/tmp/log1.out
61 run level=full storage=LTO3 when="$when1" job=NightlySave pool=Inc yes
62 run level=full storage=LTO3 when="$when1" job=NightlySave1 pool=Full yes
63 run level=full storage=LTO3 when="$when1" job=NightlySave2 pool=Default yes
64 run level=full storage=LTO3 when="$when1" job=NightlySave3 pool=Default yes
65 run level=full storage=LTO3 when="$when1" job=NightlySave4 pool=Inc yes
66 run level=full storage=LTO3 when="$when1" job=NightlySave5 pool=Full yes
67 run level=full storage=LTO3 when="$when1" job=NightlySave6 pool=Default yes
68 run level=full storage=LTO3 when="$when1" job=NightlySave7 pool=Default yes
69 run level=full storage=LTO3 when="$when1" job=NightlySave8 pool=Inc yes
70 run level=full storage=LTO3 when="$when1" job=NightlySave9 pool=Full yes
71 @#run level=full storage=LTO3 when="$when1" job=NightlySave10 pool=Default yes
72 @#run level=full storage=LTO3 when="$when1" job=NightlySave11 pool=Default yes
73 @#run level=full storage=LTO3 when="$when1" job=NightlySave12 pool=Inc yes
74 @#run level=full storage=LTO3 when="$when1" job=NightlySave13 pool=Full yes
75 @#run level=full storage=LTO3 when="$when1" job=NightlySave14 pool=Default yes
76 @#run level=full storage=LTO3 when="$when1" job=NightlySave15 pool=Default yes
77 @#run level=full storage=LTO3 when="$when1" job=NightlySave16 pool=Inc yes
78 @#run level=full storage=LTO3 when="$when1" job=NightlySave17 pool=Full yes
79 @#run level=full storage=LTO3 when="$when1" job=NightlySave18 pool=Default yes
80 @#run level=full storage=LTO3 when="$when1" job=NightlySave19 pool=Default yes
81 @#run level=full storage=LTO3 when="$when1" job=NightlySave20 pool=Inc yes
82 @#run level=full storage=LTO3 when="$when1" job=NightlySave21 pool=Full yes
83 @#run level=full storage=LTO3 when="$when1" job=NightlySave22 pool=Default yes
84 @#run level=full storage=LTO3 when="$when1" job=NightlySave23 pool=Default yes
85 @#run level=full storage=LTO3 when="$when1" job=NightlySave24 pool=Inc yes
86 @#run level=full storage=LTO3 when="$when1" job=NightlySave25 pool=Full yes
87 @#run level=full storage=LTO3 when="$when1" job=NightlySave26 pool=Default yes
88 @#run level=full storage=LTO3 when="$when1" job=NightlySave27 pool=Default yes
89 @#run level=full storage=LTO3 when="$when1" job=NightlySave28 pool=Inc yes
90 @#run level=full storage=LTO3 when="$when1" job=NightlySave29 pool=Full yes
91 @#run level=full storage=LTO3 when="$when1" job=NightlySave30 pool=Default yes
92 @#run level=full storage=LTO3 when="$when1" job=NightlySave31 pool=Default yes
93 @#run level=full storage=LTO3 when="$when1" job=NightlySave32 pool=Inc yes
94 @#run level=full storage=LTO3 when="$when1" job=NightlySave33 pool=Full yes
95 @#run level=full storage=LTO3 when="$when1" job=NightlySave34 pool=Default yes
96 @#run level=full storage=LTO3 when="$when1" job=NightlySave35 pool=Default yes
99 @#restore client=$clientname fileset="Full Set" pool=Inc where=${cwd}/tmp/bacula-restores1 select all done
119 check_for_zombie_jobs storage=LTO3 client=$clientname
121 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
122 @$out ${cwd}/tmp/log2.out
126 restore client=$clientname fileset="Full Set" pool=Full where=${cwd}/tmp/bacula-restores select all done
133 check_for_zombie_jobs storage=LTO3 client=$clientname
136 # remove volume vol20 from autochanger
137 grep -v vol20 ${cwd}/working/ach/barcodes > ${cwd}/tmp/1
138 cp ${cwd}/tmp/1 ${cwd}/working/ach/barcodes
140 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
141 @$out ${cwd}/tmp/log3.out
143 update slots slots=5-40 storage=LTO3 drive=3
155 RES=`awk -F'|' '/vol20 .+(Full|Append)/ { print $11 }' ${cwd}/tmp/log3.out`
157 if [ $1 -eq $2 ]; then
158 print_debug "ERROR: Error in update slots"
162 grep LTO1_5 tmp/log1.out > /dev/null
164 print_debug "ERROR: AutoSelect option broken"
168 grep 'Error: Re-read' tmp/log1.out > /dev/null
170 print_debug "ERROR: Found Re-read errors"