From: Kern Sibbald Date: Thu, 9 Oct 2003 14:46:09 +0000 (+0000) Subject: Add new tape and new disk tests X-Git-Tag: Release-7.0.0~9965 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8bc30084d9ce886e786c9d3b8150f427b600baa6;p=bacula%2Fbacula Add new tape and new disk tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@738 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/all-non-root-tape-tests b/regress/all-non-root-tape-tests index 13fffb0056..3fc6308a56 100755 --- a/regress/all-non-root-tape-tests +++ b/regress/all-non-root-tape-tests @@ -6,6 +6,7 @@ tests/test0 tests/backup-bacula-tape tests/small-file-size-tape tests/two-volume-tape +tests/restore-by-file-tape echo " " echo " " echo "Test results" diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests index b673c81542..fd9a976a34 100755 --- a/regress/all-non-root-tests +++ b/regress/all-non-root-tests @@ -22,6 +22,7 @@ tests/recycle-test tests/span-vol-test tests/restore-by-file-test tests/restore2-by-file-test +tests/four-jobs-test echo " " echo " " echo "Test results" diff --git a/regress/scripts/cleanup b/regress/scripts/cleanup index 664066a34d..4e13d2bf59 100755 --- a/regress/scripts/cleanup +++ b/regress/scripts/cleanup @@ -7,3 +7,4 @@ rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume* rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out rm -rf /tmp/sed_tmp /tmp/file-list rm -rf tmp/build tmp/restore-list tmp/restore2-list +rm -rf working/log diff --git a/regress/tests/.cvsignore b/regress/tests/.cvsignore new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/regress/tests/.cvsignore @@ -0,0 +1 @@ +1 diff --git a/regress/tests/four-jobs-test b/regress/tests/four-jobs-test new file mode 100755 index 0000000000..8a1ae5bcc9 --- /dev/null +++ b/regress/tests/four-jobs-test @@ -0,0 +1,121 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory using the compressed option +# then backup four times, each with incremental then finally restore. +# It should require at least 4 different bsrs. +# +cwd=`pwd` +scripts/copy-test-confs +scripts/cleanup +echo "${cwd}/build" >/tmp/file-list +bin/bacula stop 2>&1 >/dev/null +bin/drop_sqlite_tables +bin/make_sqlite_tables + +echo " " +echo " " +echo " === Starting four-jobs-test ===" +echo " === Starting four-jobs-test ===" >>working/log +echo " " + +bin/bacula start 2>&1 >/dev/null +bin/console -c bin/console.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 " !!!!! four-jobs-test Bacula source failed!!! !!!!! " + echo " !!!!! four-jobs-test failed!!! !!!!! " >>test.out + echo " " +else + echo " ===== four-jobs-test Bacula source OK ===== " + echo " ===== four-jobs-test OK ===== " >>test.out + scripts/cleanup +fi diff --git a/regress/tests/restore-by-file-tape b/regress/tests/restore-by-file-tape new file mode 100755 index 0000000000..a0358b2809 --- /dev/null +++ b/regress/tests/restore-by-file-tape @@ -0,0 +1,119 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory +# to a tape where the maximum tape file size is set to 1M +# then restore a few files from it. +# +cwd=`pwd` +bin/bacula stop 2>&1 >/dev/null +scripts/copy-tape-confs +scripts/cleanup-tape +echo "${cwd}/build" >/tmp/file-list +sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list +bin/drop_sqlite_tables +bin/make_sqlite_tables +cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 +sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf + +echo " " +echo " " +echo " === Starting restore-by-file-tape test ===" +echo " === Starting restore-by-file-tape test ===" >>working/log +echo " " + +bin/bacula start 2>&1 >/dev/null +bin/console -c bin/console.conf <&1 >/dev/null +bin/bacula start 2>&1 >/dev/null +for i in `cat ${cwd}/tmp/restore2-list`; do + diff $i ${cwd}/tmp/bacula-restores$i + if [ $? != 0 ] ; then + dstat=1 + fi +done +grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null +bstat=$? +grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null +rstat=$? +if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then + echo " " + echo " " + echo " !!!!! restore-by-file-tape test Bacula source failed!!! !!!!! " + echo " !!!!! restore-by-file-tape test failed!!! !!!!! " >>test.out + echo " " + bin/bacula stop 2>&1 >/dev/null + exit 1 +fi +rm -rf ${cwd}/tmp/bacula-restores +# +# Now do a second backup and restore +# +bin/console -c bin/console.conf <&1 >/dev/null +for i in `cat ${cwd}/tmp/restore2-list`; do + diff $i ${cwd}/tmp/bacula-restores$i + if [ $? != 0 ] ; then + dstat=1 + fi +done +grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null +bstat=$? +grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null +rstat=$? +if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then + echo " " + echo " " + echo " !!!!! restore-by-file-tape test Bacula source failed!!! !!!!! " + echo " !!!!! restore-by-file-tape test failed!!! !!!!! " >>test.out + echo " " +else + echo " ===== restore-by-file-tape test Bacula source OK ===== " + echo " ===== restore-by-file-tape test OK ===== " >>test.out +# scripts/cleanup +fi diff --git a/regress/tests/restore2-by-file-test b/regress/tests/restore2-by-file-test index 0b39d0a51f..5e419e746d 100755 --- a/regress/tests/restore2-by-file-test +++ b/regress/tests/restore2-by-file-test @@ -7,7 +7,7 @@ cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "${cwd}/build" >/tmp/file-list -sed s%\^%${cwd}% ${cwd}/scripts/flist >>${cwd}/tmp/restore2-list +sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list bin/bacula stop 2>&1 >/dev/null bin/drop_sqlite_tables bin/make_sqlite_tables diff --git a/regress/tests/small-file-size-tape b/regress/tests/small-file-size-tape index 743cc17ff8..9d16fef59b 100755 --- a/regress/tests/small-file-size-tape +++ b/regress/tests/small-file-size-tape @@ -10,10 +10,8 @@ scripts/cleanup-tape echo "${cwd}/build" >/tmp/file-list bin/drop_sqlite_tables bin/make_sqlite_tables -out="tmp/sed_tmp" -echo "s%# Maximum File Size% Maximum File Size%g" >${out} cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 -sed -f ${out} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf +sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf echo " " echo " "