From 5de97c8320401f42d48574a2e31630facc1aceb4 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 14 Nov 2017 14:20:18 +0100 Subject: [PATCH] regress: Add test to reproduce #3284 with reload command --- regress/tests/reload-client-address-test | 80 ++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 regress/tests/reload-client-address-test 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 -- 2.39.5