]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/remote-fd-test
regress: tweak remote-fd-test
[bacula/bacula] / regress / tests / remote-fd-test
1 #!/bin/sh
2 #
3 # What to test
4 # ------------
5 # - Normal backup
6 # - Weird backup
7 # - Restore
8 # - Accurate backup
9 # - Compression
10 # - Checksum
11 # - TLS/Encryption
12 # - compare files
13 # - runscript
14 #
15 # How to use this test
16 # --------------------
17 #
18 #
19 TestName="remote-fd-test"
20 JobName=backup
21 . scripts/functions
22
23 scripts/cleanup
24 scripts/copy-test-confs
25
26 change_jobname NightlySave $JobName
27 change_jobname MonsterSave AccurateTest
28
29 start_test
30
31 echo $REMOTE_FILE/save > $tmp/file-list
32
33 ssh $REMOTE_ADDR test -x /opt/bacula/bin/bacula-fd
34 if [ $? != 0 ]; then
35     print_debug "ERROR: Need to install bacula on $REMOTE_ADDR"
36     echo "ERROR: Need to install bacula on $REMOTE_ADDR"
37     exit 1
38 fi
39
40 $bperl -e remote_stop
41 $bperl -e remote_init
42 $bperl -e remote_config
43
44 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'clientrunbeforejob', '$REMOTE_FILE/save/test.sh', 'Job', 'CompressedTest')"
45 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'accurate', 'yes', 'Job', 'AccurateTest')"
46 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_ADDR', 'Client')"
47 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'password', '$REMOTE_PASSWORD', 'Client')"
48 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_STORE_ADDR', 'Storage')"
49
50 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
51 @output
52 messages
53 @$out ${cwd}/tmp/log1.out
54 status client
55 label storage=File volume=TestVolume001
56 run job=$JobName storage=File yes
57 wait
58 messages
59 @# 
60 @# now do a restore
61 @#
62 @$out ${cwd}/tmp/log2.out
63 restore where=$REMOTE_FILE/restore select all done storage=File
64 yes
65 wait
66 messages
67 @$out ${cwd}/tmp/log3.out
68 @#
69 @# make some runscript tests
70 @#
71 run job=CompressedTest storage=File yes
72 wait
73 messages
74 @$out ${cwd}/tmp/log1.out
75 @#
76 @# make some accurate tests
77 @#
78 run job=AccurateTest storage=File yes
79 wait
80 messages
81 run job=AccurateTest storage=File yes
82 wait
83 messages
84 @output
85 quit
86 END_OF_DATA
87
88 run_bacula
89 check_for_zombie_jobs storage=File
90 stop_bacula
91
92 check_two_logs
93
94 grep 'this is a script' $tmp/log3.out > /dev/null
95 if [ $? != 0 ]; then
96     print_debug "ERROR: Can't find runscript output"
97     bstat=1
98 fi
99
100 $bperl -e remote_diff
101 if [ $? != 0 ]; then
102     dstat=1
103 fi
104
105 $bperl -e remote_stop
106
107 end_test