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