]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Add test to reproduce #3284 with reload command
authorEric Bollengier <eric@baculasystems.com>
Tue, 14 Nov 2017 13:20:18 +0000 (14:20 +0100)
committerKern Sibbald <kern@sibbald.com>
Mon, 20 Nov 2017 06:54:36 +0000 (07:54 +0100)
regress/tests/reload-client-address-test [new file with mode: 0755]

diff --git a/regress/tests/reload-client-address-test b/regress/tests/reload-client-address-test
new file mode 100755 (executable)
index 0000000..db02026
--- /dev/null
@@ -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 <<END_OF_DATA >$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 <<END_OF_DATA >$tmp/bconcmds
+@$out $tmp/log2.out
+reload
+messages
+show client
+quit
+END_OF_DATA
+
+run_bconsole
+
+cat <<END_OF_DATA >$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