]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/multi-storage-test
regress: add function to create many dirs
[bacula/bacula] / regress / tests / multi-storage-test
index ea90f07f77549f44f1826385864104c2e1758fab..da2f17b1d39f160831d4bb046675b1d951bf044a 100755 (executable)
@@ -10,25 +10,32 @@ scripts/cleanup
 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 -p ${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
@@ -38,18 +45,19 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out /dev/null
 messages
 @$out ${cwd}/tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 Pool=Default slot=1 drive=0
+label storage=tape volume=TestVolume001 Pool=Default slot=1 drive=0
 label storage=File  volume=TestVolume002 Pool=Default
-run job=$JobName storage=DDS-4 yes
+run job=$JobName storage=tape yes
 wait
 messages
 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
@@ -69,29 +77,17 @@ setdebug trace=1 level=110 director
 restore where=${cwd}/tmp/bacula-restores select all done yes
 wait
 messages
-@$out
 quit
 END_OF_DATA
 
 run_bconsole
 
 check_for_zombie_jobs storage=File
+check_for_zombie_jobs storage=tape
 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