]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/test-plugin-test
regress: tweak the message in the update_win32()
[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 # Build and install the test plugin
12 cd ${cwd}/build/src/plugins/fd
13 make
14 make install-test-plugin
15 cd ${cwd}
16
17 scripts/cleanup
18 scripts/copy-plugin-confs
19 file=encrypt-bug.jpg
20 rm -rf ${cwd}/tmp/*
21 echo "${cwd}/build/src" >${cwd}/tmp/file-list
22
23 start_test
24
25 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
26 @$out /dev/null
27 messages
28 @$out ${cwd}/tmp/log1.out
29 label storage=File1 volume=TestVolume001
30 setdebug level=100 client=$CLIENT
31 estimate job=$JobName level=Full
32 @#setdebug level=150 client=$CLIENT
33 @#setdebug level=150 storage=File1
34 run job=$JobName storage=File1 yes
35 wait
36 status client=$CLIENT
37 messages
38 quit
39 END_OF_DATA
40
41
42 run_bacula
43
44 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
45 messages
46 @# 
47 @# now do a restore
48 @#
49 @$out ${cwd}/tmp/log2.out
50 setdebug level=50 client=$CLIENT
51 restore where=${cwd}/tmp  select all storage=File1 done
52 yes
53 wait
54 setdebug level=0 client=$CLIENT
55 messages
56 quit
57 END_OF_DATA
58
59 run_bconsole
60
61 stop_bacula
62
63 exit 0
64
65 # ****FIXME**** test if the restore of the two files is OK
66
67 #
68 # Remove plugin so we can try the restore without the plugin
69 #
70 mv -f ${cwd}/bin/plugins/test-plugin-fd.so ${cwd}/bin/plugins/test-plugin-fd.sox
71
72 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
73 @$out ${cwd}/tmp/log2.out
74 @# remove plugin
75 @exec "sh -c 'rm -f ${cwd}/bin/plugins/test-plugin-fd.so'"
76 @# 
77 @# now do a restore without the plugin
78 @#
79 @$out ${cwd}/tmp/log2.out
80 @#setdebug level=50 client=$CLIENT
81 restore where=${cwd}/tmp  select all storage=File1 done
82 yes
83 wait
84 messages
85 quit
86 END_OF_DATA
87
88 run_bacula -d50
89 run_bconsole
90
91 check_for_zombie_jobs storage=File1
92 stop_bacula
93 #
94 # Restore plugin
95 #
96 mv -f ${cwd}/bin/plugins/test-plugin-fd.sox ${cwd}/bin/plugins/test-plugin-fd.so
97
98 check_two_logs
99 #
100 # ****FIXME**** test that all three files are restored correctly
101 #
102 diff ${cwd}/${file} ${cwd}/tmp/${file}
103 dstat=$?
104 end_test