From: Kern Sibbald Date: Sun, 4 Sep 2005 15:49:18 +0000 (+0000) Subject: Update tests X-Git-Tag: Release-1.38.0~128 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e9bb7972a60d38eabd41dd427888ad8d5d6c692;p=bacula%2Fbacula Update tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2376 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests index c93003c3ca..be1bf01045 100755 --- a/regress/all-non-root-tests +++ b/regress/all-non-root-tests @@ -11,7 +11,7 @@ tests/bscan-test tests/bsr-opt-test tests/compressed-test tests/concurrent-jobs-test -tests/decremental-test +tests/differential-test tests/four-concurrent-jobs-test tests/four-jobs-test tests/incremental-test diff --git a/regress/scripts/bacula-dir-win32-tape.conf b/regress/scripts/bacula-dir-win32-tape.conf index 84898c7190..7877b8da3f 100644 --- a/regress/scripts/bacula-dir-win32-tape.conf +++ b/regress/scripts/bacula-dir-win32-tape.conf @@ -13,7 +13,7 @@ # Director { # define myself - Name = roxie-dir + Name = localhost-dir DIRport = 8101 # where we listen for UA connections QueryFile = "/home/kern/bacula/regress/bin/query.sql" WorkingDirectory = "/home/kern/bacula/regress/working" diff --git a/regress/scripts/do_sed b/regress/scripts/do_sed index 35a5947902..c4effe98f9 100755 --- a/regress/scripts/do_sed +++ b/regress/scripts/do_sed @@ -14,6 +14,7 @@ host=`hostname | tr '.' ' ' | cut -f 1 -d ' '` if test x$host = x ; then host=localhost fi +host="localhost" # Create sed command script echo "s%@sbindir@%${cwd}/bin%g" >${out} echo "s%@scriptdir@%${cwd}/bin%g" >>${out} diff --git a/regress/tests/decremental-test b/regress/tests/decremental-test deleted file mode 100755 index 865001e4e7..0000000000 --- a/regress/tests/decremental-test +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# Run a simple backup of the Bacula build directory then create some -# new files, do a Decremental and restore those 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} - -echo " " -echo " " -echo " === Starting decremental-test at `date +%R:%S` ===" -echo " === Starting decremental-test at `date +%R:%S` ===" >>working/log -echo " " - -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null -messages -@output tmp/log1.out -label storage=File volume=TestVolume001 -label storage=File volume=TestVolume002 -run job=CompressedTest yes -wait -messages -quit -END_OF_DATA -scripts/check_for_zombie_jobs storage=File -echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt -echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null -messages -@output tmp/log1.out -@# Force decremental on the second Volume -update volume=TestVolume001 VolStatus=Used -run level=decremental job=CompressedTest yes -wait -messages -@output -END_OF_DATA -scripts/check_for_zombie_jobs storage=File -echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null -messages -@output tmp/log1.out -run level=incremental job=CompressedTest yes -wait -messages -@# -@# now do a restore -@# -@output tmp/log2.out -restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list -yes -wait -messages -@output -quit -END_OF_DATA -scripts/check_for_zombie_jobs storage=File -bin/bacula stop 2>&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 " !!!!! decremental-test Bacula source failed!!! !!!!! " - echo " !!!!! decremental-test failed!!! !!!!! " >>test.out - if [ $bstat != 0 -o $rstat != 0 ] ; then - echo " !!!!! Bad Job termination status !!!!! " - echo " !!!!! Bad Job termination status !!!!! " >>test.out - else - echo " !!!!! Restored files differ !!!!! " - echo " !!!!! Restored files differ !!!!! " >>test.out - fi - echo " " -else - echo " ===== decremental-test Bacula source OK ===== " - echo " ===== decremental-test OK ===== " >>test.out - scripts/cleanup -fi diff --git a/regress/tests/differential-test b/regress/tests/differential-test new file mode 100755 index 0000000000..916cec507f --- /dev/null +++ b/regress/tests/differential-test @@ -0,0 +1,128 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then create some +# new files, do a differential and restore those two files. +# +debug=0 +if test "$debug" -eq 1 ; then + out="tee" +else + out="output" +fi + +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} + +echo " " +echo " " +echo " === Starting differential-test at `date +%R:%S` ===" +echo " === Starting differential-test at `date +%R:%S` ===" >>working/log +echo " " + +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log1.out +label storage=File volume=TestVolume001 +label storage=File volume=TestVolume002 +run job=CompressedTest yes +wait +messages +quit +END_OF_DATA + +if test "$debug" -eq 1 ; then + bin/bacula start + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + +scripts/check_for_zombie_jobs storage=File +echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt +echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt + +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log1.out +@# Force differential on the second Volume +update volume=TestVolume001 VolStatus=Used +run level=differential job=CompressedTest yes +wait +messages +@$out +END_OF_DATA + +if test "$debug" -eq 1 ; then + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + +scripts/check_for_zombie_jobs storage=File +echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt + +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log1.out +run level=incremental job=CompressedTest yes +wait +messages +@# +@# now do a restore +@# +@$out tmp/log2.out +restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list +yes +wait +messages +@$out +quit +END_OF_DATA + +if test "$debug" -eq 1 ; then + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + +scripts/check_for_zombie_jobs storage=File +bin/bacula stop 2>&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 restore 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 " !!!!! differential-test Bacula source failed!!! !!!!! " + echo " !!!!! differential-test failed!!! !!!!! " >>test.out + if [ $bstat != 0 -o $rstat != 0 ] ; then + echo " !!!!! Bad Job termination status !!!!! " + echo " !!!!! Bad Job termination status !!!!! " >>test.out + else + echo " !!!!! Restored files differ !!!!! " + echo " !!!!! Restored files differ !!!!! " >>test.out + fi + echo " " +else + echo " ===== differential-test Bacula source OK ===== " + echo " ===== differential-test OK ===== " >>test.out + scripts/cleanup +fi diff --git a/regress/tests/span-vol-test b/regress/tests/span-vol-test index d4abc69450..4dd5c22fd1 100755 --- a/regress/tests/span-vol-test +++ b/regress/tests/span-vol-test @@ -5,6 +5,13 @@ # totally full. I.e. make sure that bsr selects all tapes # including those fully spanned. # +debug=1 +if test "$debug" -eq 1 ; then + out="tee" +else + out="output" +fi + cwd=`pwd` scripts/copy-test-confs scripts/cleanup @@ -16,18 +23,17 @@ echo " === Starting span-vol-test at `date +%R:%S` ===" echo " === Starting span-vol-test at `date +%R:%S` ===" >working/log echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out -label storage=File1 volume=TestVolume001 -label storage=File1 volume=TestVolume002 -label storage=File1 volume=TestVolume003 +@$out tmp/log1.out label storage=File1 volume=TestVolume004 -update Volume=TestVolume001 MaxVolBytes=3000000 -update Volume=TestVolume002 MaxVolBytes=3000000 +label storage=File1 volume=TestVolume003 +label storage=File1 volume=TestVolume002 +label storage=File1 volume=TestVolume001 +update Volume=TestVolume004 MaxVolBytes=3000000 update Volume=TestVolume003 MaxVolBytes=3000000 +update Volume=TestVolume002 MaxVolBytes=3000000 run job=NightlySave storage=File1 yes wait list volumes @@ -35,7 +41,7 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@$out tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=File1 unmark * mark * @@ -43,9 +49,18 @@ done yes wait messages -@output +@$out quit END_OF_DATA + +if test "$debug" -eq 1 ; then + bin/bacula start + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + scripts/check_for_zombie_jobs storage=File1 bin/bacula stop 2>&1 >/dev/null grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null diff --git a/regress/tests/verify-vol-test b/regress/tests/verify-vol-test index e464d3af47..2df75d62f8 100755 --- a/regress/tests/verify-vol-test +++ b/regress/tests/verify-vol-test @@ -3,6 +3,13 @@ # Run a simple backup of the Bacula build directory # then verify the catalog. # +debug=0 +if test "$debug" -eq 1 ; then + out="tee" +else + out="output" +fi + cwd=`pwd` scripts/copy-test-confs scripts/cleanup @@ -14,11 +21,10 @@ echo " === Starting verify Volume Test at `date +%R:%S` ===" echo " === Starting verify Volume Test at `date +%R:%S` ===" >>working/log echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out setdebug level=1 storage=File sd label storage=File volume=TestVolume001 run job=NightlySave yes @@ -27,14 +33,23 @@ messages @# @# now do a verify volume @# -@output ${cwd}/tmp/original +@$out ${cwd}/tmp/original run job=VerifyVolume yes wait messages -@output +@$out quit END_OF_DATA + +if test "$debug" -eq 1 ; then + bin/bacula start + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + sleep 2 scripts/check_for_zombie_jobs storage=File bin/bacula stop 2>&1 >/dev/null