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.confs
16 if (/SDPort = /) { $_ =~ s/(\d+)/1810$sd/;}
17 if (/Name = .+?-sd/) { $_ =~ s/-sd/-sd$sd/;}
18 if (/WorkingDirectory/) { $_ =~ s/"$/$sd"/; }
19 if (/Pid Directory/) { $_ =~ s/"$/$sd"/; }
21 ' $conf/bacula-sd.conf > $conf/bacula-sd$sd.conf
22 mkdir -p ${working}$sd
23 sed 's/bacula-sd.conf/bacula-sd$sd.conf/' $scripts/bacula-ctl-sd \
24 > $tmp/bacula-ctl-sd$sd
25 chmod +x $tmp/bacula-ctl-sd$sd
28 # Patch up bacula-dir.conf
30 if (/^Storage {/) { $in=1; $nb++; }
32 if (/SDPort = (\d+)/ && $in) {if ($nb == 2) { $_ = " SDPort = 18102\n"; }}
33 if (/SDPort = (\d+)/ && $in) {if ($nb == 3) { $_ = " SDPort = 18103\n"; }}
34 if (/SDPort = (\d+)/ && $in) {if ($nb == 4) { $_ = " SDPort = 18104\n"; }}
36 ' $conf/bacula-dir.conf > $tmp/1
37 cp $tmp/1 $conf/bacula-dir.conf
41 echo "${cwd}/build" >${cwd}/tmp/file-list
43 change_jobname $JobName
46 # Write out bconsole commands
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
50 @$out ${cwd}/tmp/log1.out
51 label storage=tape volume=TestVolume001 Pool=Default slot=1 drive=0
52 label storage=File volume=TestVolume002 Pool=Default
53 run job=$JobName storage=tape yes
61 $tmp/bacula-ctl-sd$sd start &> /dev/null
66 echo "ficheriro1.txt" >${cwd}/build/po/ficheriro1.txt
67 echo "ficheriro2.txt" >${cwd}/build/po/ficheriro2.txt
70 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
73 @$out ${cwd}/tmp/log1.out
74 @# Force Incremental on the second Volume
75 run level=Incremental storage=File job=$JobName yes
81 @$out ${cwd}/tmp/log2.out
82 setdebug trace=1 level=110 client
83 setdebug trace=1 level=110 director
84 restore where=${cwd}/tmp/bacula-restores select all done yes
96 check_for_zombie_jobs storage=File
97 check_for_zombie_jobs storage=tape
101 $tmp/bacula-ctl-sd$sd stop &> /dev/null