From 86bbb37e121212bd67b1546114ce0fe550fea617 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 7 Aug 2009 14:27:34 +0200 Subject: [PATCH] tweak the multi-storage-test to handle kern's firewall --- regress/tests/multi-storage-test | 49 +++++++++++++++----------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/regress/tests/multi-storage-test b/regress/tests/multi-storage-test index ea90f07f77..048dee3fb2 100755 --- a/regress/tests/multi-storage-test +++ b/regress/tests/multi-storage-test @@ -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 ${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 @@ -46,10 +53,11 @@ 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 <${cwd}/tmp/bconcmds @@ -76,22 +84,11 @@ END_OF_DATA 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 -- 2.39.5