3 # Attempt to backup and restore a file with the bpipe plugin
10 scripts/copy-plugin-confs
11 make -C $src/src/plugins/fd install-test-plugin
15 echo "${cwd}/README" >${cwd}/tmp/file-list
19 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
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
31 setdebug level=50 trace=1 client=$CLIENT
32 run job=TestPluginTest storage=File1 yes
36 setdebug level=50 trace=0 client=$CLIENT
43 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @$out ${cwd}/tmp/log2.out
49 setdebug level=50 client=$CLIENT
50 restore fileset=pluginSet where=${cwd}/tmp select all storage=File1 done
53 setdebug level=0 client=$CLIENT
62 # ****FIXME**** test if the restore of the two files is OK
65 # Remove plugin so we can try the restore without the plugin
67 mv -f ${cwd}/bin/plugins/bpipe-fd.so ${cwd}/bin/plugins/bpipe-fd.sox
69 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
70 @$out ${cwd}/tmp/log2.out
72 @exec "sh -c 'rm -f ${cwd}/bin/plugins/bpipe-fd.so'"
74 @# now do a restore without the plugin
76 @$out ${cwd}/tmp/log2.out
77 @#setdebug level=50 client=$CLIENT
78 restore fileset=pluginSet where=${cwd}/tmp select all storage=File1 done
88 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
93 @$out ${cwd}/tmp/log3.out
94 setdebug level=50 client=$CLIENT trace=1
95 restore fileset=TestPluginSet where=${cwd}/tmp select all storage=File1 done
98 setdebug level=0 client=$CLIENT trace=0
105 check_for_zombie_jobs storage=File1
110 mv -f ${cwd}/bin/plugins/bpipe-fd.sox ${cwd}/bin/plugins/bpipe-fd.so
114 # ****FIXME**** test that all three files are restored correctly
116 diff ${cwd}/${file} ${cwd}/tmp/${file}
119 # the test-plugin should create a RestoreObject, just check
120 # compare restore object before/after
123 if (/Creating RestoreObject/) {
124 @elt = split(/\s/, $_, 7);
128 } elsif (/Get RestoreObject/) {
129 @elt = split(/\s/, $_, 8);
136 if ($clen ne $glen) {
137 print "ERROR: $clen != $glen\n";
140 if ($cdata ne $gdata) {
141 print "ERROR: <$cdata> != <$gdata>\n";
144 if ($cname ne $gname) {
145 print "ERROR: $cname != $gname\n";