3 TestName="reload-client-address-test"
11 # Zap out any schedule in default conf file so that
12 # it doesn't start during our test
15 echo "s% Schedule =%# Schedule =%g" >${outf}
16 cp $scripts/bacula-dir.conf $tmp/1
17 sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
19 change_jobname BackupClient1 $JobName
22 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.1", "Client")'
23 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Enabled", "yes", "Client")'
25 cat <<END_OF_DATA >$tmp/bconcmds
39 print_debug "Changing 127.0.0.1 to 127.0.0.2 for the Client"
40 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.2", "Client")'
42 cat <<END_OF_DATA >$tmp/bconcmds
52 print_debug "Disable client"
54 client=`awk '/Name=/ { gsub(/Name=/, "", $2); print $2; exit }' $tmp/log0.out`
56 cat <<END_OF_DATA >$tmp/bconcmds
58 disable client=$client
72 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Enabled", "no", "Client")'
74 cat <<END_OF_DATA >$tmp/bconcmds
79 enabled client=$client
85 grep "127.0.0.1" $tmp/log0.out > /dev/null
87 print_debug "ERROR: Should find 127.0.0.1 in $tmp/log0.out"
91 grep "127.0.0.2" $tmp/log2.out > /dev/null
93 print_debug "ERROR: Should find 127.0.0.2 in $tmp/log2.out"
97 grep "127.0.0.2" $tmp/log3.out > /dev/null
99 print_debug "ERROR: Should find 127.0.0.2 in $tmp/log3.out"
103 grep "Enabled=0" $tmp/log3.out > /dev/null
104 if [ $? -ne 0 ]; then
105 print_debug "ERROR: Should find Enabled=0 in $tmp/log3.out"
109 grep "Enabled=0" $tmp/log4.out > /dev/null
110 if [ $? -ne 0 ]; then
111 print_debug "ERROR: Should find Enabled=0 in $tmp/log4.out"
115 grep "Enabled=1" $tmp/log5.out > /dev/null
116 if [ $? -ne 0 ]; then
117 print_debug "ERROR: Should find Enabled=1 in $tmp/log5.out"