]> git.sur5r.net Git - bacula/bacula/commitdiff
Cleanup tests + test Termination status
authorKern Sibbald <kern@sibbald.com>
Mon, 16 Jun 2003 22:11:24 +0000 (22:11 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 16 Jun 2003 22:11:24 +0000 (22:11 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@584 91ce42f0-d328-0410-95d8-f526ca767f89

regress/tests/backup-bacula-test
regress/tests/bscan-test
regress/tests/compressed-test
regress/tests/six-vol-test
regress/tests/sparse-compressed-test
regress/tests/sparse-test
regress/tests/two-jobs-test
regress/tests/two-vol-test
regress/tests/verify-vol-test

index 5875ba6c14584e75970f0c850b5e8b57b0dd292d..123cc0eb66758f087f84e23a48d83b6b6a9657a9 100755 (executable)
@@ -16,11 +16,11 @@ echo " === Starting Backup Bacula Test ==="
 echo " === Starting Backup Bacula Test ===" >>working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
 @output /dev/null
 messages
-@output
+@output tmp/log1.out
 label
 TestVolume001
 run job=Client1
@@ -30,20 +30,23 @@ messages
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out  
 restore
 5
 done
 yes
 @sleep 1
 wait
-@output /dev/null
 messages
 quit
 END_OF_DATA
-sleep 2
-bin/bacula stop
+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=$?
 diff -r build /tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== Backup Bacula Test failed!!! ===== "
index 98278b2e550d587d574785002becda681bbfa219..8de719c964fbcd6ffc8f168eb0685ee1f069272a 100755 (executable)
@@ -19,10 +19,10 @@ echo " === Starting bscan-test  ==="
 echo " === Starting bscan-test  ===" >working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
+@output tmp/log1.out
 label storage=File1
 TestVolume001
 label storage=File1
@@ -31,11 +31,11 @@ update Volume=TestVolume001
 6
 3000000
 10
-@output
 run job=NightlySave storage=File1
 yes
 wait
 messages
+@output /dev/null
 @#
 @# now purge the Volume
 @#
@@ -45,15 +45,16 @@ delete volume=TestVolume001
 yes
 delete volume=TestVolume002
 yes
+messages
 quit
 END_OF_DATA
-bin/bacula stop
+bin/bacula stop 2>&1 >/dev/null
 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
-bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 
-bin/bacula start
+bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
+@output tmp/log2.out
 @# 
 @# now do a restore
 @#
@@ -65,9 +66,13 @@ wait
 messages
 quit
 END_OF_DATA
-bin/bacula stop
+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=$?
 diff -r build  tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== bscan-test Bacula source failed!!! ===== "
index 72792475e1de8ef0e64d64385e45de39b7230d52..feaaeb16675493ede79e6d6f1675ab725aba275a 100755 (executable)
@@ -17,11 +17,10 @@ echo " === Starting compressed-test ==="
 echo " === Starting compressed-test ===" >>working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
-@output
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=CompressedTest
@@ -31,18 +30,22 @@ messages
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out
 restore
 5
 done
 yes
 wait
-@output /dev/null
 messages
 quit
 END_OF_DATA
-bin/bacula stop
+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=$?
 diff -r build /tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== compressed-test Bacula source failed!!! ===== "
index d1a012e26d0a429dceeaba74f5881c93b7aa27f6..913069ac8d14c6755270f0028220cfbc0d8aaee7 100755 (executable)
@@ -26,10 +26,10 @@ echo " === Starting six-vol-test  ==="
 echo " === Starting six-vol-test  ===" >>working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
 messages
-@output
+@output tmp/log1.out
 run job=MultiVol storage=File
 yes
 wait
@@ -37,6 +37,7 @@ messages
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores
 5
 done
@@ -45,9 +46,13 @@ wait
 messages
 quit
 END_OF_DATA
-bin/bacula stop
+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=$?
 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== six-vol-test Bacula source failed!!! ===== "
index c209aca8ed18c62692e9548bc63bffa29e572ad2..e8513a3f358f188b3f2a3a76c81d4ee784d00289 100755 (executable)
@@ -17,11 +17,10 @@ echo " === Starting sparse-compressed-test ==="
 echo " === Starting sparse-compressed-test ===" >>working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
-@output
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=SparseCompressedTest
@@ -31,19 +30,22 @@ messages
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out   
 restore
 5
 done
 yes
 wait
-@output /dev/null
 messages
 quit
 END_OF_DATA
-
-bin/bacula stop
+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=$?
 diff -r build /tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== sparse-compressed-test Bacula source failed!!! ===== "
index f04f2f60091147356419ab5238f1e14ae60083df..beb38ce1c8779a69a783827ad4da9658e2713421 100755 (executable)
@@ -19,9 +19,8 @@ echo " "
 
 bin/bacula start
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
-@output
+@output tmp/log2.out
 label storage=File
 TestVolume001
 run job=SparseTest
@@ -31,18 +30,22 @@ messages
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out
 restore
 5
 done
 yes
 wait
-@output /dev/null
 messages
 quit
 END_OF_DATA
-bin/bacula stop
+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=$?
 diff -r build /tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== sparse-test Bacula source failed!!! ===== "
index 3966eaaba6e99149759cbed45070c7dbf7a1edc2..a3ab1df70b7cc072980b558a2deb391ce8c6790b 100755 (executable)
@@ -17,10 +17,10 @@ echo " === Starting two-jobs-test  ==="
 echo " === Starting two-jobs-test  ===" >>working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=CompressedTest
@@ -35,24 +35,25 @@ touch ${cwd}/build/src/dird/*.c
 # run a second job
 #
 bin/console -c bin/console.conf <<END_OF_DATA
+messages
+@output tmp/log1.out
 run job=CompressedTest
 yes
 wait
 messages
-@output
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out
 restore
 5
 done
 yes
 wait
-@output /dev/null
 messages
 quit
 END_OF_DATA
-bin/bacula stop
+bin/bacula stop 2>&1 >/dev/null
 diff -r build /tmp/bacula-restores${cwd}/build
 if [ $? != 0 ] ; then
    echo " "
index 25a30f3581c161b4d2f9139d740685a7e9de1abd..3b6fbf044f55d13a604702297c81c58d0839a8ca 100755 (executable)
@@ -17,9 +17,9 @@ echo " === Starting two-vol-test  ==="
 echo " === Starting two-vol-test  ===" >working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
+@output tmp/log1.out
 messages
 label storage=File1
 TestVolume001
@@ -29,7 +29,6 @@ update Volume=TestVolume001
 6
 3000000
 10
-@output
 run job=NightlySave storage=File1
 yes
 wait
@@ -37,6 +36,7 @@ messages
 @# 
 @# now do a restore
 @#
+@output tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores
 5
 done
@@ -45,9 +45,13 @@ wait
 messages
 quit
 END_OF_DATA
-bin/bacula stop
+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=$?
 diff -r build  tmp/bacula-restores${cwd}/build
-if [ $? != 0 ] ; then
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== two-vol-test Bacula source failed!!! ===== "
index a39ba27b13024b76133d0853bc8a557c0569ae94..36487d23b54f28e924b2d0d8b8a814c642c47a24 100755 (executable)
@@ -17,11 +17,10 @@ echo " === Starting verify Volume Test ==="
 echo " === Starting verify Volume Test ===" >>working/log
 echo " "
 
-bin/bacula start
+bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
-@output /dev/null
 messages
-@output
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=NightlySave
@@ -31,18 +30,19 @@ messages
 @# 
 @# now do a verify volume
 @#
+@output ${cwd}/tmp/original
 run job=VerifyVolume
 yes
 wait
-@tee ${cwd}/tmp/original
 messages
-@output
 quit
 END_OF_DATA
 sleep 2
-bin/bacula stop
-grep "Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
-if [ $? != 0 ] ; then
+bin/bacula stop 2>&1 >/dev/null
+grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
+bstat=$?
+grep "^Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
+if [ $? != 0 -o $bstat != 0 ] ; then
    echo " "
    echo " "
    echo "  ===== Verify Volume failed!!! ===== "