]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/remote-fd-test
Add Allow Duplicate Jobs to copy-uncopied-test regression test for bug #1751
[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 cfg=$conf/bacula-dir.conf
44 $bperl -e "add_attribute('$cfg', 'clientrunbeforejob', '$REMOTE_FILE/save/test.sh', 'Job', 'CompressedTest')"
45 $bperl -e "add_attribute('$cfg', 'accurate', 'yes', 'Job', 'AccurateTest')"
46 $bperl -e "add_attribute('$cfg', 'address', '$REMOTE_ADDR', 'Client')"
47 $bperl -e "add_attribute('$cfg', 'password', '$REMOTE_PASSWORD', 'Client')"
48 $bperl -e "add_attribute('$cfg', 'address', '$REMOTE_STORE_ADDR', 'Storage')"
49
50 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
51 @output
52 messages
53 @$out ${cwd}/tmp/log4.out
54 status client
55 @$out ${cwd}/tmp/log1.out
56 label storage=File volume=TestVolume001
57 run job=$JobName storage=File yes
58 wait
59 messages
60 @# 
61 @# now do a restore
62 @#
63 @$out ${cwd}/tmp/log2.out
64 restore where=$REMOTE_FILE/restore select all done storage=File
65 yes
66 wait
67 messages
68 @$out ${cwd}/tmp/log3.out
69 @#
70 @# make some runscript tests
71 @#
72 run job=CompressedTest storage=File yes
73 wait
74 messages
75 @$out ${cwd}/tmp/log1.out
76 @#
77 @# make some accurate tests
78 @#
79 run job=AccurateTest storage=File yes
80 wait
81 messages
82 run job=AccurateTest storage=File yes
83 wait
84 messages
85 @output
86 quit
87 END_OF_DATA
88
89 run_bacula
90 check_for_zombie_jobs storage=File
91 stop_bacula
92
93 check_two_logs
94
95 version=`$bin/bacula-dir -? | awk '/Version:/ { print $2 }'`
96 version_fd=`awk '/Version:/ { print $3 }' $tmp/log4.out`
97  
98 if [ "$version" != "$version_fd" ]; then
99     print_debug "ERROR: client version doesn't match $version ($version_fd)"
100     estat=1
101 fi
102
103 grep 'this is a script' $tmp/log3.out > /dev/null
104 if [ $? != 0 ]; then
105     print_debug "ERROR: Can't find runscript output"
106     bstat=1
107 fi
108
109 $bperl -e remote_diff
110 if [ $? != 0 ]; then
111     dstat=1
112 fi
113
114 $bperl -e remote_stop
115
116 end_test