]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/test-plugin-test
c1fe9aad22eda38d2a1fe07c9f72f85ff6823658
[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 # ****FIXME**** test if the restore of the two files is OK
57
58 #
59 # Remove plugin so we can try the restore without the plugin
60 #
61 mv -f ${cwd}/bin/plugins/test-plugin-fd.so ${cwd}/bin/plugins/test-plugin-fd.sox
62
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
64 @$out ${cwd}/tmp/log2.out
65 @# remove plugin
66 @exec "sh -c 'rm -f ${cwd}/bin/plugins/test-plugin-fd.so'"
67 @# 
68 @# now do a restore without the plugin
69 @#
70 @$out ${cwd}/tmp/log2.out
71 @#setdebug level=50 client=$CLIENT
72 restore where=${cwd}/tmp  select all storage=File1 done
73 yes
74 wait
75 messages
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/test-plugin-fd.sox ${cwd}/bin/plugins/test-plugin-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