3 # This script uses the virtual disk autochanger
5 TestName="multi-storage-test"
10 scripts/copy-2disk-confs
11 scripts/prepare-disk-changer
13 # create a new bacula-sd.conf
15 if (/SDPort = /) { $_ =~ s/(\d+)/1$1/;}
16 if (/Name = .+?-sd/) { $_ =~ s/-sd/-sd2/;}
17 if (/WorkingDirectory/) { $_ =~ s/"$/2"/; }
19 ' $conf/bacula-sd.conf > $conf/bacula-sd2.conf
24 if (/^Storage {/) { $in=1; $nb++; }
26 if (/SDPort = (\d+)/ && $in) {if ($nb == 2) { $_ = " SDPort = 1$1\n"; }}
28 ' $conf/bacula-dir.conf > $tmp/1
29 cp $tmp/1 $conf/bacula-dir.conf
32 sed 's/bacula-sd.conf/bacula-sd2.conf/' $scripts/bacula-ctl-sd \
34 chmod +x $tmp/bacula-ctl-sd
38 echo "${cwd}/build" >${cwd}/tmp/file-list
40 change_jobname $JobName
43 # Write out bconsole commands
44 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
47 @$out ${cwd}/tmp/log1.out
48 label storage=tape volume=TestVolume001 Pool=Default slot=1 drive=0
49 label storage=File volume=TestVolume002 Pool=Default
50 run job=$JobName storage=tape yes
56 $tmp/bacula-ctl-sd start &> /dev/null
59 echo "ficheriro1.txt" >${cwd}/build/po/ficheriro1.txt
60 echo "ficheriro2.txt" >${cwd}/build/po/ficheriro2.txt
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
66 @$out ${cwd}/tmp/log1.out
67 @# Force Incremental on the second Volume
68 run level=Incremental storage=File job=$JobName yes
74 @$out ${cwd}/tmp/log2.out
75 setdebug trace=1 level=110 client
76 setdebug trace=1 level=110 director
77 restore where=${cwd}/tmp/bacula-restores select all done yes
85 check_for_zombie_jobs storage=File
86 check_for_zombie_jobs storage=tape
88 $tmp/bacula-ctl-sd stop &> /dev/null