From: Kern Sibbald Date: Wed, 7 Apr 2010 13:03:14 +0000 (+0200) Subject: Make test-plugin-test script X-Git-Tag: Release-7.0.0~1972 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c2f86a01f669fb2c5d8becc7ee10dd2d95296e3;p=bacula%2Fbacula Make test-plugin-test script --- diff --git a/regress/tests/test-plugin-test b/regress/tests/test-plugin-test new file mode 100755 index 0000000000..c1fe9aad22 --- /dev/null +++ b/regress/tests/test-plugin-test @@ -0,0 +1,95 @@ +#!/bin/sh +# +# Run test-plugin-fd. Note, this plugin is for testing +# new features and probably should not be run in normal +# testing +# +TestName="test-plugin-test" +JobName=TestpluginTest +. scripts/functions + +scripts/cleanup +scripts/copy-plugin-confs +file=encrypt-bug.jpg +rm -rf ${cwd}/tmp/* +echo "${cwd}/README" >${cwd}/tmp/file-list + +start_test + +cat <${cwd}/tmp/bconcmds +@$out /dev/null +messages +@$out ${cwd}/tmp/log1.out +label storage=File1 volume=TestVolume001 +setdebug level=150 client=$CLIENT +estimate job=$JobName level=Full +setdebug level=50 client=$CLIENT +run job=$JobName storage=File1 yes +wait +status client=$CLIENT +messages +quit +END_OF_DATA + + +run_bacula + +cat <${cwd}/tmp/bconcmds +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +setdebug level=50 client=$CLIENT +restore where=${cwd}/tmp select all storage=File1 done +yes +wait +setdebug level=0 client=$CLIENT +messages +quit +END_OF_DATA + +run_bconsole + +stop_bacula + +# ****FIXME**** test if the restore of the two files is OK + +# +# Remove plugin so we can try the restore without the plugin +# +mv -f ${cwd}/bin/plugins/test-plugin-fd.so ${cwd}/bin/plugins/test-plugin-fd.sox + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log2.out +@# remove plugin +@exec "sh -c 'rm -f ${cwd}/bin/plugins/test-plugin-fd.so'" +@# +@# now do a restore without the plugin +@# +@$out ${cwd}/tmp/log2.out +@#setdebug level=50 client=$CLIENT +restore where=${cwd}/tmp select all storage=File1 done +yes +wait +messages +quit +END_OF_DATA + +run_bacula -d50 +run_bconsole + +check_for_zombie_jobs storage=File1 +stop_bacula +# +# Restore plugin +# +mv -f ${cwd}/bin/plugins/test-plugin-fd.sox ${cwd}/bin/plugins/test-plugin-fd.so + +check_two_logs +# +# ****FIXME**** test that all three files are restored correctly +# +diff ${cwd}/${file} ${cwd}/tmp/${file} +dstat=$? +end_test