]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/source-addr-test
regress: add function to create many dirs
[bacula/bacula] / regress / tests / source-addr-test
index bf8640aca3a6ecdf7dc0307d37b32cfe904ec975..644e4a3d1f1ef8fa278b264817c08ab9b97f40fe 100755 (executable)
@@ -38,8 +38,6 @@ if [ "$IP" = '' ]; then
     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 
@@ -55,14 +53,14 @@ DIRPORT=$BASEPORT
 FDPORT=$(($BASEPORT + 1))
 SDPORT=$(($BASEPORT + 2))
 
-change_jobname Client1 $JobName
+change_jobname BackupClient1 $JobName
 start_test
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
-@output /dev/null
+@$out /dev/null
 messages
 @$out ${cwd}/tmp/log1.out
-@#label volume=TestVolume001 storage=File pool=Default
+@#label volume=TestVolume001 storage=File pool=File
 @#setdebug level=100 storage=File
 run job=$JobName yes
 @sleep 3
@@ -72,26 +70,33 @@ END_OF_DATA
 
 run_bacula
 
-print_debug "Connections to SD sourced from ${IP}:"
+print_debug "Detecting connections to SD sourced from ${IP}"
 netstat -tan | grep -E "127.0.0.1(.|:)$SDPORT .* ${IP}" > $tmp/log3.out
 if [ $? -ne 0 ]; then
    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}:"
+print_debug "and connections to FD sourced from ${IP}"
 netstat -tan | grep -E "127.0.0.1(.|:)$FDPORT .* ${IP}" >> $tmp/log3.out
 if [ $? -ne 0 ]; then
    stat=2
    print_debug "Couldn't detect a connection to the FD sourced from SourceAddress ${IP}"
 fi
 
+if [ "$stat" = 2 ] ; then
+   netstat -tan
+fi
+
+if [ "$debug" = 1 ] ; then
+    cat $tmp/log3.out
+fi
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
-@output /dev/null
+@$out /dev/null
 messages
 @$out ${cwd}/tmp/log1.out
-label volume=TestVolume001 storage=File pool=Default
+label volume=TestVolume001 storage=File pool=File
 @#setdebug level=100 storage=File
 wait
 messages
@@ -103,7 +108,6 @@ restore where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
 messages
-@$out
 quit
 END_OF_DATA