scripts/copy-2disk-confs
scripts/prepare-disk-changer
+# create a new bacula-sd.conf
+perl -ne '
+if (/SDPort = /) { $_ =~ s/(\d+)/1$1/;}
+if (/Name = .+?-sd/) { $_ =~ s/-sd/-sd2/;}
+if (/WorkingDirectory/) { $_ =~ s/"$/2"/; }
+print;
+' $conf/bacula-sd.conf > $conf/bacula-sd2.conf
+
+mkdir ${working}2
+
perl -ne '
if (/^Storage {/) { $in=1; $nb++; }
if (/^}/) { $in=0 }
-if (/Address / && $in) {$_ = "Address = 127.0.0.$nb\n"; }
+if (/SDPort = (\d+)/ && $in) {if ($nb == 2) { $_ = " SDPort = 1$1\n"; }}
print;
' $conf/bacula-dir.conf > $tmp/1
cp $tmp/1 $conf/bacula-dir.conf
+
+sed 's/bacula-sd.conf/bacula-sd2.conf/' $scripts/bacula-ctl-sd \
+ > $tmp/bacula-ctl-sd
+chmod +x $tmp/bacula-ctl-sd
+
disable_pluguins
-echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
-if test ! -d ${cwd}/tmp/build ; then
- mkdir ${cwd}/tmp/build
-fi
-cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
-cd ${cwd}/tmp
-echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
-echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
-cd ${cwd}
+echo "${cwd}/build" >${cwd}/tmp/file-list
change_jobname $JobName
start_test
quit
END_OF_DATA
+$tmp/bacula-ctl-sd start &> /dev/null
run_bacula
-echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
-echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
+echo "ficheriro1.txt" >${cwd}/build/po/ficheriro1.txt
+echo "ficheriro2.txt" >${cwd}/build/po/ficheriro2.txt
cat <<END_OF_DATA >${cwd}/tmp/bconcmds
run_bconsole
check_for_zombie_jobs storage=File
+check_for_zombie_jobs storage=DDS-4
stop_bacula
+$tmp/bacula-ctl-sd stop &> /dev/null
check_two_logs
-check_restore_tmp_build_diff
-
-#
-# This script seems to more or less randomly fail, so we
-# add extra code here to produce a "dump" in the event of
-# an error.
-#
-if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
- cat ${cwd}/tmp/log1.out
- echo " "
- cat ${cwd}/tmp/log2.out
- echo " "
- diff -r ${cwd}/tmp/build ${cwd}/tmp/bacula-restores${cwd}/tmp/build
-fi
+check_restore_diff
end_test