3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # This script uses the virtual disk autochanger
10 TestName="multi-storage-test"
15 scripts/copy-2disk-confs
16 scripts/prepare-disk-changer
18 # create a new bacula-sd.conf
20 if (/SDPort = /) { $_ =~ s/(\d+)/1$1/;}
21 if (/Name = .+?-sd/) { $_ =~ s/-sd/-sd2/;}
22 if (/WorkingDirectory/) { $_ =~ s/"$/2"/; }
24 ' $conf/bacula-sd.conf > $conf/bacula-sd2.conf
29 if (/^Storage \{/) { $in=1; $nb++; }
31 if (/SDPort = (\d+)/ && $in) {if ($nb == 2) { $_ = " SDPort = 1$1\n"; }}
33 ' $conf/bacula-dir.conf > $tmp/1
34 cp $tmp/1 $conf/bacula-dir.conf
37 sed 's/bacula-sd.conf/bacula-sd2.conf/' $scripts/bacula-ctl-sd \
39 chmod +x $tmp/bacula-ctl-sd
43 echo "${cwd}/build" >${cwd}/tmp/file-list
45 change_jobname $JobName
48 # Write out bconsole commands
49 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
52 @$out ${cwd}/tmp/log1.out
53 label storage=tape volume=TestVolume001 Pool=Default slot=1 drive=0
54 label storage=File volume=TestVolume002 Pool=Default
55 run job=$JobName storage=tape yes
61 $tmp/bacula-ctl-sd start &> /dev/null
64 echo "ficheriro1.txt" >${cwd}/build/po/ficheriro1.txt
65 echo "ficheriro2.txt" >${cwd}/build/po/ficheriro2.txt
68 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
71 @$out ${cwd}/tmp/log1.out
72 @# Force Incremental on the second Volume
73 run level=Incremental storage=File job=$JobName yes
79 @$out ${cwd}/tmp/log2.out
80 setdebug trace=1 level=110 client
81 setdebug trace=1 level=110 director
82 restore where=${cwd}/tmp/bacula-restores select all done yes
90 check_for_zombie_jobs storage=File
91 check_for_zombie_jobs storage=tape
93 $tmp/bacula-ctl-sd stop &> /dev/null