From: Eric Bollengier Date: Wed, 27 May 2009 14:38:46 +0000 (+0000) Subject: ebl Make sure that vtape directory is created during -tape tests X-Git-Tag: Release-3.0.2~198 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4a5a3a08e77025e67d3ff096db77d8d9ed43f66a;p=bacula%2Fbacula ebl Make sure that vtape directory is created during -tape tests ebl change grep -e to grep -E to make source-addr-test working as expected git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8868 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/functions b/regress/scripts/functions index 2940e0c5dd..0cd185db8e 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -353,6 +353,9 @@ init_slot() SLOT=$2 if test -n "$DRIVE" -a -n "$SLOT"; then if test ! -c $DRIVE -a ! -b $DRIVE -a x$USE_VTAPE != x ; then + if [ ! -d "$dir" ]; then + mkdir -p "$dir" + fi dir=`dirname $DRIVE` touch $dir/slot$SLOT fi diff --git a/regress/tests/source-addr-test b/regress/tests/source-addr-test index 060b9110c5..bf8640aca3 100755 --- a/regress/tests/source-addr-test +++ b/regress/tests/source-addr-test @@ -31,10 +31,15 @@ if [ $os = 'FreeBSD' ]; then elif [ $os = 'Linux' ]; then INTERFACE=eth0 IP=`ifconfig ${INTERFACE} | perl -ne '/inet addr:(.+?) / && print $1'` -else - echo "Can't run this test on $os" - exit 0 fi + +if [ "$IP" = '' ]; then + echo "Can't detect ip address" + exit 0 +fi + +print_debug "Detected ip address is $IP" + outf="tmp/sed_tmp" echo "s/PidDirectory/DirSourceAddress=$IP; PidDirectory/g" > $outf echo "s/Address =/Address = 127.0.0.1 #/g" >> $outf @@ -68,16 +73,16 @@ END_OF_DATA run_bacula print_debug "Connections to SD sourced from ${IP}:" -netstat -tan | grep -e "127.0.0.1(.|:)$SDPORT .* ${IP}" > $tmp/log3.out +netstat -tan | grep -E "127.0.0.1(.|:)$SDPORT .* ${IP}" > $tmp/log3.out if [ $? -ne 0 ]; then - bstat=2 + stat=2 print_debug "Couldn't detect a connection to the SD sourced from SourceAddress ${IP}" fi print_debug "Connections to FD sourced from ${IP}:" -netstat -tan | grep -e "127.0.0.1(.|:)$FDPORT .* ${IP}" >> $tmp/log3.out +netstat -tan | grep -E "127.0.0.1(.|:)$FDPORT .* ${IP}" >> $tmp/log3.out if [ $? -ne 0 ]; then - bstat=2 + stat=2 print_debug "Couldn't detect a connection to the FD sourced from SourceAddress ${IP}" fi @@ -107,4 +112,10 @@ check_for_zombie_jobs storage=File stop_bacula check_two_logs check_restore_diff + +if [ "$stat" = 2 ]; then + print_debug `cat $tmp/log3.out` + bstat=$stat +fi + end_test