From: Eric Bollengier Date: Tue, 14 Nov 2017 13:20:18 +0000 (+0100) Subject: regress: Add test to reproduce #3284 with reload command X-Git-Tag: Release-9.0.6~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5de97c8320401f42d48574a2e31630facc1aceb4;p=bacula%2Fbacula regress: Add test to reproduce #3284 with reload command --- diff --git a/regress/tests/reload-client-address-test b/regress/tests/reload-client-address-test new file mode 100755 index 0000000000..db020265d2 --- /dev/null +++ b/regress/tests/reload-client-address-test @@ -0,0 +1,80 @@ +#!/bin/sh +# +TestName="reload-client-address-test" +JobName=backup +. scripts/functions + +scripts/cleanup +scripts/copy-confs + +# +# Zap out any schedule in default conf file so that +# it doesn't start during our test +# +outf="$tmp/sed_tmp" +echo "s% Schedule =%# Schedule =%g" >${outf} +cp $scripts/bacula-dir.conf $tmp/1 +sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf + +change_jobname BackupClient1 $JobName +start_test + +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.1", "Client")' + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log0.out +show client +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bacula + +print_debug "Changing 127.0.0.1 to 127.0.0.2 for the Client" +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.2", "Client")' + +cat <$tmp/bconcmds +@$out $tmp/log2.out +reload +messages +show client +quit +END_OF_DATA + +run_bconsole + +cat <$tmp/bconcmds +@$out $tmp/log3.out +show client +quit +END_OF_DATA + +run_bconsole + +grep "127.0.0.1" $tmp/log0.out +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find 127.0.0.1 in $tmp/log0.out" + estat=1 +fi + +grep "127.0.0.2" $tmp/log2.out +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find 127.0.0.2 in $tmp/log2.out" + estat=1 +fi + +grep "127.0.0.2" $tmp/log3.out +if [ $? -ne 0 ]; then + print_debug "ERROR: Should find 127.0.0.2 in $tmp/log3.out" + estat=1 +fi + + +stop_bacula + +end_test