]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/plugin-test
Improve plugin test -- more to be done
[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 -d50
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 messages
43 @$out
44 quit
45 END_OF_DATA
46
47 run_bconsole
48
49 stop_bacula
50
51 # ****FIXME**** test if the restore of the two files is OK
52
53 #
54 # Remove plugin so we can try the restore without the plugin
55 #
56 mv -f ${cwd}/bin/plugins/bpipe-fd.so ${cwd}/bin/plugins/bpipe-fd.sox
57
58 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
59 @$out ${cwd}/tmp/log2.out
60 @# remove plugin
61 @exec "sh -c 'rm -f ${cwd}/bin/plugins/bpipe-fd.so'"
62 @# 
63 @# now do a restore without the plugin
64 @#
65 @$out ${cwd}/tmp/log2.out
66 @#setdebug level=50 client=$CLIENT
67 restore where=${cwd}/tmp  select all storage=File1 done
68 yes
69 wait
70 messages
71 @$out
72 quit
73 END_OF_DATA
74
75 run_bacula -d50
76 run_bconsole
77
78 check_for_zombie_jobs storage=File1
79 stop_bacula
80 #
81 # Restore plugin
82 #
83 mv -f ${cwd}/bin/plugins/bpipe-fd.sox ${cwd}/bin/plugins/bpipe-fd.so
84
85 check_two_logs
86 #
87 # ****FIXME**** test that all three files are restored correctly
88 #
89 diff ${cwd}/${file} ${cwd}/tmp/${file}
90 dstat=$?
91 end_test