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