]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new tests
authorKern Sibbald <kern@sibbald.com>
Thu, 15 Apr 2004 09:32:53 +0000 (09:32 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 15 Apr 2004 09:32:53 +0000 (09:32 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1198 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tape-tests
regress/all-non-root-tests
regress/scripts/bacula-dir-tape.conf.in
regress/scripts/bacula-sd-2tape.conf.in
regress/scripts/bacula-sd-tape.conf.in
regress/scripts/bacula-sd.conf.in
regress/scripts/test-bacula-dir.conf.in
regress/scripts/test-bacula-fd.conf.in
regress/scripts/test-bacula-sd.conf.in
regress/tests/fixed-block-size-tape [new file with mode: 0755]
regress/tests/query-test [new file with mode: 0755]

index 3bf232766c730fffb5cfdff25d96ce614315c75e..53b3f2945b3a7d179fbb676abec87864c0f26c80 100755 (executable)
@@ -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"
index f7e235552e71d45494ee52fbddf520af960b220c..3cd0fb92febc4d612076fc97fa09d1e27e5ec3db 100755 (executable)
@@ -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"
index 0d6aadce12c9649a746150936d9d334a541b1c68..8868a24a4d6e7d75f1f226fd8f09c01f13b595d5 100644 (file)
@@ -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"
index 32327cc39b3a6ea67bb8a17b9657eabfe63efbf7..0bfc6326c2bc9b186bb60a2ee43a2f27118cfa95 100644 (file)
@@ -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
index 9504a33833eac229a1501f8e34eb878d39cce801..b794de4c2518455666ddc68ec76b8b07099a95a8 100644 (file)
@@ -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
index 745f713248dbce9064c0f81d03c82edfa106e302..c035ea9d5d73937b03c150360b5cdefd69cdb8d9 100644 (file)
@@ -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
index 38af2f88c2e520b8e3592a35f9e4a6cd848e6668..1474f3ef8a7758dd53013dcb4b154cefbed82544 100644 (file)
@@ -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.3
 #
 #  You might also want to change the default email address
 #   from root to your address.  See the "mail" and "operator"
index 1423c69bb8b9d4fbe1c939d240569e4d2141dfd9..18791199988b3cb8ada5669ad8c7aa349340e40f 100644 (file)
@@ -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
index 9e40f501dc0686668b7b8e286d2863c290709925..390e0fb0ac34a932f2407c709f47ab017e1980e8 100644 (file)
@@ -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 (executable)
index 0000000..4bfd9ad
--- /dev/null
@@ -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 <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0
+run job=NightlySave yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+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 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 (executable)
index 0000000..7f371ff
--- /dev/null
@@ -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 <<END_OF_DATA
+@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
+@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
+@output /dev/null
+messages
+@output tmp/log1.out
+run level=incremental job=CompressedTest yes
+wait
+messages
+@#
+@# Now do the queries
+@#
+query
+1
+query
+2
+ficheriro1.txt
+query
+3
+${cwd}/tmp/build/
+ficheriro1.txt
+Client1
+query
+7
+TestVolume001
+query
+8
+1
+query
+9
+Client1
+query
+10
+Default
+query
+11
+query
+12
+query
+13
+1
+@# 
+@# 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 "  !!!!! 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