]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/reload-client-address-test
regress: Add test to reproduce #3284 with reload command
[bacula/bacula] / regress / tests / reload-client-address-test
1 #!/bin/sh
2 #
3 TestName="reload-client-address-test"
4 JobName=backup
5 . scripts/functions
6
7 scripts/cleanup
8 scripts/copy-confs
9
10 #
11 # Zap out any schedule in default conf file so that
12 #  it doesn't start during our test
13 #
14 outf="$tmp/sed_tmp"
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
18
19 change_jobname BackupClient1 $JobName
20 start_test
21
22 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.1", "Client")'
23
24 cat <<END_OF_DATA >$tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out $tmp/log0.out
28 show client
29 @$out $tmp/log1.out
30 run job=$JobName yes
31 wait
32 messages
33 quit
34 END_OF_DATA
35
36 run_bacula
37
38 print_debug "Changing 127.0.0.1 to 127.0.0.2 for the Client"
39 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "127.0.0.2", "Client")'
40
41 cat <<END_OF_DATA >$tmp/bconcmds
42 @$out $tmp/log2.out
43 reload
44 messages
45 show client
46 quit
47 END_OF_DATA
48
49 run_bconsole
50
51 cat <<END_OF_DATA >$tmp/bconcmds
52 @$out $tmp/log3.out
53 show client
54 quit
55 END_OF_DATA
56
57 run_bconsole
58
59 grep "127.0.0.1" $tmp/log0.out
60 if [ $? -ne 0 ]; then
61     print_debug "ERROR: Should find 127.0.0.1 in $tmp/log0.out"
62     estat=1
63 fi
64
65 grep "127.0.0.2" $tmp/log2.out
66 if [ $? -ne 0 ]; then
67     print_debug "ERROR: Should find 127.0.0.2 in $tmp/log2.out"
68     estat=1
69 fi
70
71 grep "127.0.0.2" $tmp/log3.out
72 if [ $? -ne 0 ]; then
73     print_debug "ERROR: Should find 127.0.0.2 in $tmp/log3.out"
74     estat=1
75 fi
76
77
78 stop_bacula
79
80 end_test