]> git.sur5r.net Git - bacula/bacula/commitdiff
Update tests
authorKern Sibbald <kern@sibbald.com>
Sun, 4 Sep 2005 15:49:18 +0000 (15:49 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 4 Sep 2005 15:49:18 +0000 (15:49 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2376 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tests
regress/scripts/bacula-dir-win32-tape.conf
regress/scripts/do_sed
regress/tests/decremental-test [deleted file]
regress/tests/differential-test [new file with mode: 0755]
regress/tests/span-vol-test
regress/tests/verify-vol-test

index c93003c3ca880454f1aac304fbfef19b02ce50fe..be1bf010458c9ae90a5ebe7e016ad15439451e38 100755 (executable)
@@ -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
index 84898c71900135d35a166d87becf132a38ff7ba3..7877b8da3fa7bb80adf5e39b65e7418a410440fe 100644 (file)
@@ -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"
index 35a59479021898c31278e641b4ee73917517d5a3..c4effe98f98220d2d389d6dbeb50356066c07ada 100755 (executable)
@@ -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 (executable)
index 865001e..0000000
+++ /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 <<END_OF_DATA 2>&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 <<END_OF_DATA 2>&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 <<END_OF_DATA 2>&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 (executable)
index 0000000..916cec5
--- /dev/null
@@ -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 <<END_OF_DATA >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 <<END_OF_DATA >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 <<END_OF_DATA >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
index d4abc69450e90ca572dad196b72b97b00158151e..4dd5c22fd1ce2439646323ac237a2031c07dbcf1 100755 (executable)
@@ -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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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
index e464d3af4735ef82863925ac86c0426b6488ddad..2df75d62f815b8669fb8f72a4b85e6b542b0becf 100755 (executable)
@@ -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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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