]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/plugin-test
ebl tweak output
[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=150 client=$CLIENT
23 estimate job=$JobName level=Full
24 setdebug level=50 client=$CLIENT
25 run job=$JobName storage=File1 yes
26 wait
27 status client=$CLIENT
28 messages
29 quit
30 END_OF_DATA
31
32
33 run_bacula
34
35 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36 messages
37 @# 
38 @# now do a restore
39 @#
40 @$out ${cwd}/tmp/log2.out
41 setdebug level=50 client=$CLIENT
42 restore where=${cwd}/tmp  select all storage=File1 done
43 yes
44 wait
45 setdebug level=0 client=$CLIENT
46 messages
47 @$out
48 quit
49 END_OF_DATA
50
51 run_bconsole
52
53 stop_bacula
54
55 # ****FIXME**** test if the restore of the two files is OK
56
57 #
58 # Remove plugin so we can try the restore without the plugin
59 #
60 mv -f ${cwd}/bin/plugins/bpipe-fd.so ${cwd}/bin/plugins/bpipe-fd.sox
61
62 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
63 @$out ${cwd}/tmp/log2.out
64 @# remove plugin
65 @exec "sh -c 'rm -f ${cwd}/bin/plugins/bpipe-fd.so'"
66 @# 
67 @# now do a restore without the plugin
68 @#
69 @$out ${cwd}/tmp/log2.out
70 @#setdebug level=50 client=$CLIENT
71 restore where=${cwd}/tmp  select all storage=File1 done
72 yes
73 wait
74 messages
75 @$out
76 quit
77 END_OF_DATA
78
79 run_bacula -d50
80 run_bconsole
81
82 check_for_zombie_jobs storage=File1
83 stop_bacula
84 #
85 # Restore plugin
86 #
87 mv -f ${cwd}/bin/plugins/bpipe-fd.sox ${cwd}/bin/plugins/bpipe-fd.so
88
89 check_two_logs
90 #
91 # ****FIXME**** test that all three files are restored correctly
92 #
93 diff ${cwd}/${file} ${cwd}/tmp/${file}
94 dstat=$?
95 end_test