From: Kern Sibbald Date: Thu, 15 Apr 2004 09:32:53 +0000 (+0000) Subject: Add new tests X-Git-Tag: Release-1.34.1~55 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9baec8069d17631010ce541445cacf43a3a0b906;p=bacula%2Fbacula Add new tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1198 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/all-non-root-tape-tests b/regress/all-non-root-tape-tests index 3bf232766c..53b3f2945b 100755 --- a/regress/all-non-root-tape-tests +++ b/regress/all-non-root-tape-tests @@ -9,6 +9,7 @@ tests/restore-by-file-tape tests/incremental-tape tests/four-concurrent-jobs-tape tests/four-jobs-tape +tests/fixed-block-size-tape echo " " echo " " echo "Test results" diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests index f7e235552e..3cd0fb92fe 100755 --- a/regress/all-non-root-tests +++ b/regress/all-non-root-tests @@ -26,6 +26,7 @@ tests/four-jobs-test tests/incremental-test tests/decremental-test tests/restore-disk-seek-test +tests/query-test echo " " echo " " echo "Test results" diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in index 0d6aadce12..8868a24a4d 100644 --- a/regress/scripts/bacula-dir-tape.conf.in +++ b/regress/scripts/bacula-dir-tape.conf.in @@ -5,7 +5,7 @@ # file or directory names in the Include directive of the # FileSet resource. # -# For Bacula release 1.30 (12 April 2003) -- redhat 7.3 +# For Bacula release 1.33 # # You might also want to change the default email address # from root to your address. See the "mail" and "operator" diff --git a/regress/scripts/bacula-sd-2tape.conf.in b/regress/scripts/bacula-sd-2tape.conf.in index 32327cc39b..0bfc6326c2 100644 --- a/regress/scripts/bacula-sd-2tape.conf.in +++ b/regress/scripts/bacula-sd-2tape.conf.in @@ -1,7 +1,7 @@ # # Default Bacula Storage Daemon Configuration file # -# For Bacula release 1.30 (12 April 2003) -- redhat 7.3 +# For Bacula release 1.33 # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device diff --git a/regress/scripts/bacula-sd-tape.conf.in b/regress/scripts/bacula-sd-tape.conf.in index 9504a33833..b794de4c25 100644 --- a/regress/scripts/bacula-sd-tape.conf.in +++ b/regress/scripts/bacula-sd-tape.conf.in @@ -1,7 +1,7 @@ # # Default Bacula Storage Daemon Configuration file # -# For Bacula release 1.30 (12 April 2003) -- redhat 7.3 +# For Bacula release 1.33 # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device diff --git a/regress/scripts/bacula-sd.conf.in b/regress/scripts/bacula-sd.conf.in index 745f713248..c035ea9d5d 100644 --- a/regress/scripts/bacula-sd.conf.in +++ b/regress/scripts/bacula-sd.conf.in @@ -1,7 +1,7 @@ # # Default Bacula Storage Daemon Configuration file # -# For Bacula release 1.32 (20 Sep 2003) -- redhat 9 +# For Bacula release 1.33 # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device diff --git a/regress/scripts/test-bacula-dir.conf.in b/regress/scripts/test-bacula-dir.conf.in index 38af2f88c2..1474f3ef8a 100644 --- a/regress/scripts/test-bacula-dir.conf.in +++ b/regress/scripts/test-bacula-dir.conf.in @@ -5,7 +5,7 @@ # file or directory names in the Include directive of the # FileSet resource. # -# For Bacula release 1.30 (12 April 2003) -- redhat 7.3 +# For Bacula release 1.33 # # You might also want to change the default email address # from root to your address. See the "mail" and "operator" diff --git a/regress/scripts/test-bacula-fd.conf.in b/regress/scripts/test-bacula-fd.conf.in index 1423c69bb8..1879119998 100644 --- a/regress/scripts/test-bacula-fd.conf.in +++ b/regress/scripts/test-bacula-fd.conf.in @@ -1,7 +1,7 @@ # # Default Bacula File Daemon Configuration file # -# For Bacula release 1.30 (12 April 2003) -- redhat 7.3 +# For Bacula release 1.33 # # There is not much to change here except perhaps the # File daemon Name to diff --git a/regress/scripts/test-bacula-sd.conf.in b/regress/scripts/test-bacula-sd.conf.in index 9e40f501dc..390e0fb0ac 100644 --- a/regress/scripts/test-bacula-sd.conf.in +++ b/regress/scripts/test-bacula-sd.conf.in @@ -1,7 +1,7 @@ # # Default Bacula Storage Daemon Configuration file # -# For Bacula release 1.30 (12 April 2003) -- redhat 7.3 +# For Bacula release 1.33 # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device diff --git a/regress/tests/fixed-block-size-tape b/regress/tests/fixed-block-size-tape new file mode 100755 index 0000000000..4bfd9ad258 --- /dev/null +++ b/regress/tests/fixed-block-size-tape @@ -0,0 +1,69 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory +# to a tape where we set the minimum and maximum block +# sizes. +# +cwd=`pwd` +bin/bacula stop 2>&1 >/dev/null +scripts/copy-tape-confs +scripts/cleanup-tape +echo "${cwd}/build" >/tmp/file-list +cd bin +./drop_bacula_tables >/dev/null 2>&1 +./make_bacula_tables >/dev/null 2>&1 +./grant_bacula_privileges 2>&1 >/dev/null +cd .. +cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 +echo "s%# Maximum Block Size% Maximum Block Size%" >${cwd}/tmp/2 +echo "s%# Minimum Block Size% Minimum Block Size%" >>${cwd}/tmp/2 +sed -f ${cwd}/tmp/2 ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf +rm -f ${cwd}/tmp/1 ${cwd}/tmp/2 + +echo " " +echo " " +echo " === Starting Fixed Block Size test ===" +echo " === Starting Fixed Block Size test ===" >>working/log +echo " " + +bin/bacula start 2>&1 >/dev/null +bin/bconsole -c bin/bconsole.conf <&1 >/dev/null +grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null +bstat=$? +grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null +rstat=$? +diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null +if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then + echo " " + echo " " + echo " !!!!! Fixed Block Size test Bacula source failed!!! !!!!! " + echo " !!!!! Fixed Block Size test failed!!! !!!!! " >>test.out + echo " " +else + echo " ===== Fixed Block Size test Bacula source OK ===== " + echo " ===== Fixed Block Size test OK ===== " >>test.out +# scripts/cleanup +fi diff --git a/regress/tests/query-test b/regress/tests/query-test new file mode 100755 index 0000000000..7f371ff2e6 --- /dev/null +++ b/regress/tests/query-test @@ -0,0 +1,129 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then create some +# new files, do a Decremental then a bunch of query commands +# and finally restore the two files. +# +cwd=`pwd` +scripts/copy-test-confs +scripts/cleanup +echo "${cwd}/tmp/build" >/tmp/file-list +mkdir ${cwd}/tmp/build +cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build +cd ${cwd}/tmp +echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list +echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list +cd ${cwd} +bin/bacula stop 2>&1 >/dev/null +cd bin +./drop_bacula_tables >/dev/null 2>&1 +./make_bacula_tables >/dev/null 2>&1 +./grant_bacula_privileges 2>&1 >/dev/null +cd .. + +echo " " +echo " " +echo " === Starting query-test ===" +echo " === Starting query-test ===" >>working/log +echo " " + +bin/bacula start 2>&1 >/dev/null +bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/build/ficheriro1.txt +echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt +bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/build/ficheriro2.txt +bin/bconsole -c bin/bconsole.conf <&1 >/dev/null +grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null +bstat=$? +grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null +rstat=$? +# +# Delete .c files because we will only restored the txt files +# +rm -f tmp/build/*.c +diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null +if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then + echo " " + echo " " + echo " !!!!! query-test Bacula source failed!!! !!!!! " + echo " !!!!! query-test failed!!! !!!!! " >>test.out + echo " " +else + echo " ===== query-test Bacula source OK ===== " + echo " ===== query-test OK ===== " >>test.out + scripts/cleanup +fi