]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/plugin-test
Fix typo in db_password for bscan tests
[bacula/bacula] / regress / tests / plugin-test
1 #!/bin/sh
2 #
3 # Attempt to backup and restore a file with the bpipe plugin
4 #
5 TestName="plugin-test"
6 JobName=pluginTest
7 . scripts/functions
8
9 scripts/cleanup
10 scripts/copy-plugin-confs
11 file=encrypt-bug.jpg
12 rm -rf ${cwd}/tmp/*
13 echo "${cwd}/README" >${cwd}/tmp/file-list
14
15 start_test
16
17 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
18 @output /dev/null
19 messages
20 @$out ${cwd}/tmp/log1.out
21 label storage=File1 volume=TestVolume001
22 @#setdebug level=50 client=$CLIENT
23 run job=$JobName storage=File1 yes
24 wait
25 messages
26 quit
27 END_OF_DATA
28
29
30 run_bacula
31
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 messages
34 @# 
35 @# now do a restore
36 @#
37 @$out ${cwd}/tmp/log2.out
38 setdebug level=50 client=$CLIENT
39 restore where=${cwd}/tmp  select all storage=File1 done
40 yes
41 wait
42 setdebug level=0 client=$CLIENT
43 messages
44 @$out
45 quit
46 END_OF_DATA
47
48 run_bconsole
49
50 stop_bacula
51
52 # ****FIXME**** test if the restore of the two files is OK
53
54 #
55 # Remove plugin so we can try the restore without the plugin
56 #
57 mv -f ${cwd}/bin/plugins/bpipe-fd.so ${cwd}/bin/plugins/bpipe-fd.sox
58
59 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
60 @$out ${cwd}/tmp/log2.out
61 @# remove plugin
62 @exec "sh -c 'rm -f ${cwd}/bin/plugins/bpipe-fd.so'"
63 @# 
64 @# now do a restore without the plugin
65 @#
66 @$out ${cwd}/tmp/log2.out
67 @#setdebug level=50 client=$CLIENT
68 restore where=${cwd}/tmp  select all storage=File1 done
69 yes
70 wait
71 messages
72 @$out
73 quit
74 END_OF_DATA
75
76 run_bacula -d50
77 run_bconsole
78
79 check_for_zombie_jobs storage=File1
80 stop_bacula
81 #
82 # Restore plugin
83 #
84 mv -f ${cwd}/bin/plugins/bpipe-fd.sox ${cwd}/bin/plugins/bpipe-fd.so
85
86 check_two_logs
87 #
88 # ****FIXME**** test that all three files are restored correctly
89 #
90 diff ${cwd}/${file} ${cwd}/tmp/${file}
91 dstat=$?
92 end_test