]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new tape tests
authorKern Sibbald <kern@sibbald.com>
Tue, 25 Nov 2003 17:24:30 +0000 (17:24 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 25 Nov 2003 17:24:30 +0000 (17:24 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@815 91ce42f0-d328-0410-95d8-f526ca767f89

21 files changed:
regress/all-non-root-2tape-tests [new file with mode: 0755]
regress/all-non-root-tape-tests
regress/all-root-tests
regress/scripts/.cvsignore
regress/scripts/bacula-dir-tape.conf.in
regress/scripts/bacula-sd-2tape.conf.in [new file with mode: 0644]
regress/scripts/bacula-sd-tape.conf.in
regress/scripts/cleanup-2tape.in [new file with mode: 0755]
regress/scripts/cleanup-tape.in
regress/scripts/copy-2tape-confs [new file with mode: 0755]
regress/scripts/do_sed
regress/scripts/freebsd_tape_options
regress/tests/bsr-opt-test
regress/tests/four-concurrent-jobs-tape [new file with mode: 0755]
regress/tests/four-jobs-tape [new file with mode: 0755]
regress/tests/incremental-2tape [new file with mode: 0755]
regress/tests/incremental-tape [new file with mode: 0755]
regress/tests/incremental-test
regress/tests/lib-tape-root [new file with mode: 0755]
regress/tests/two-volume-tape
regress/tests/usr-tape-root [new file with mode: 0755]

diff --git a/regress/all-non-root-2tape-tests b/regress/all-non-root-2tape-tests
new file mode 100755 (executable)
index 0000000..5201731
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Run all tape tests
+#
+tests/test0
+tests/two-volume-tape
+tests/incremental-2tape
+echo " "
+echo " "
+echo "2 Tape Test results"
+cat test.out
+scripts/cleanup
index 3fc6308a567bc46e5bc084dbddfab06e4ef073b5..3bf232766c730fffb5cfdff25d96ce614315c75e 100755 (executable)
@@ -5,8 +5,10 @@
 tests/test0
 tests/backup-bacula-tape
 tests/small-file-size-tape
-tests/two-volume-tape
 tests/restore-by-file-tape
+tests/incremental-tape
+tests/four-concurrent-jobs-tape
+tests/four-jobs-tape
 echo " "
 echo " "
 echo "Test results"
index ce7f7ae5332150ab599e9b3812877fe747a7c838..3f077bba4ce92ffdc31ebc61748783a5ecf9e44e 100755 (executable)
@@ -6,5 +6,6 @@ rm -f test.out
 tests/dev-test-root
 tests/etc-test-root
 tests/lib-test-root
+tests/usr-tape-root
 cat test.out
 scripts/cleanup
index e4e5fdaa822f2c8183de13fb7a4849d52d6187a4..8d7e0007c7e35d4a8c3345d1efe80c7efa8e1f50 100644 (file)
@@ -2,6 +2,7 @@ bacula-dir.conf
 bacula-fd.conf
 bacula-sd.conf
 console.conf
+bconsole.conf
 test-bacula-dir.conf
 test-bacula-fd.conf
 test-bacula-sd.conf
@@ -9,5 +10,7 @@ test-console.conf
 testa-bacula-dir.conf
 bacula-dir-tape.conf
 bacula-sd-tape.conf
+bacula-sd-2tape.conf
 cleanup-tape
+cleanup-2tape
 prepare-two-tapes
index bc22c35a4e487386ba28c5e7eba408cc732422bb..5907f322b51c0d774f9f8dc5d4d38293837b1b67 100644 (file)
@@ -94,6 +94,7 @@ Storage {
   Device = DDS-4                      # must be same as Device in Storage daemon
   Media Type = DDS-4                  # must be same as MediaType in Storage daemon
   AutoChanger = yes
+  Maximum Concurrent Jobs = 4
 }
 
 
diff --git a/regress/scripts/bacula-sd-2tape.conf.in b/regress/scripts/bacula-sd-2tape.conf.in
new file mode 100644 (file)
index 0000000..bd917cc
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Default Bacula Storage Daemon Configuration file
+#
+#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
+#
+# You may need to change the name of your tape drive
+#   on the "Archive Device" directive in the Device
+#   resource.  If you change the Name and/or the 
+#   "Media Type" in the Device resource, please ensure
+#   that dird.conf has corresponding changes.
+#
+
+Storage {                             # definition of myself
+  Name = @hostname@-sd
+  SDPort = 8103                  # Director's port      
+  WorkingDirectory = "@working_dir@"
+  Pid Directory = "@piddir@"
+  Subsys Directory = "@subsysdir@"
+}
+
+#
+# List Directors who are permitted to contact Storage daemon
+#
+Director {
+  Name = @hostname@-dir
+  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+}
+
+#
+# Devices supported by this Storage daemon
+# To connect, the Director's bacula-dir.conf must have the
+#  same Name and MediaType. 
+#
+
+Device {
+  Name = DDS-4                     # 
+  Media Type = DDS-4
+  Changer Device = @autochanger@
+  Changer Command ="@scriptdir@/mtx-changer %c %o %S %a"
+  Archive Device = @tape_drive@
+  AutomaticMount = yes;               # when device opened, read it
+  AlwaysOpen = yes;
+  RemovableMedia = yes;
+  @@sbindir@/tape_options
+# Maximum File Size = 1000000
+}
+
+# 
+# Send all messages to the Director, 
+# mount messages also are sent to the email address
+#
+Messages {
+  Name = Standard
+  director = @hostname@-dir = all
+}
index bd917ccfa80326d4a3feaaa95ef181c04629ff78..6019e19b9e391edac54ed9b24f032a9e0807ffea 100644 (file)
@@ -35,8 +35,6 @@ Director {
 Device {
   Name = DDS-4                     # 
   Media Type = DDS-4
-  Changer Device = @autochanger@
-  Changer Command ="@scriptdir@/mtx-changer %c %o %S %a"
   Archive Device = @tape_drive@
   AutomaticMount = yes;               # when device opened, read it
   AlwaysOpen = yes;
diff --git a/regress/scripts/cleanup-2tape.in b/regress/scripts/cleanup-2tape.in
new file mode 100755 (executable)
index 0000000..06583b5
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Cleanup left over files -- both before and after test run
+#
+rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
+rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
+rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
+
+if ! test x@autochanger@ = x/dev/null; then
+   drive=`bin/mtx-changer @autochanger@ loaded`
+   if ! test x$drive = x2; then
+      bin/mtx-changer @autochanger@ unload
+      bin/mtx-changer @autochanger@ load 2
+   fi
+   mt -f @tape_drive@ rewind
+   mt -f @tape_drive@ weof
+fi
+
+
+#
+# If we have an autochanger always load tape in slot 1
+#
+if ! test x@autochanger@ = x/dev/null; then
+   drive=`bin/mtx-changer @autochanger@ loaded`
+   if ! test x$drive = x1; then
+      bin/mtx-changer @autochanger@ unload
+      bin/mtx-changer @autochanger@ load 1
+   fi
+fi
+
+mt -f @tape_drive@ rewind
+mt -f @tape_drive@ weof
index 64ad92f31b26fb4d78eb35e56418b290c43b10ee..debc2a98409e31fcd3f96769c9dcd0a29c9af577 100755 (executable)
@@ -6,16 +6,5 @@ rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
 rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
 rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
 
-#
-# If we have an autochanger always load tape in slot 1
-#
-if ! test x@autochanger@ = x/dev/null; then
-   drive=`bin/mtx-changer @autochanger@ loaded`
-   if ! test x$drive = x1; then
-      bin/mtx-changer @autochanger@ unload
-      bin/mtx-changer @autochanger@ load 1
-   fi
-fi
-
 mt -f @tape_drive@ rewind
 mt -f @tape_drive@ weof
diff --git a/regress/scripts/copy-2tape-confs b/regress/scripts/copy-2tape-confs
new file mode 100755 (executable)
index 0000000..dbf9466
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
+/bin/cp -f scripts/bacula-sd-2tape.conf bin/bacula-sd.conf
+/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
+/bin/cp -f scripts/test-console.conf bin/bconsole.conf
index 0a119f43ef9a232ec9c1ea8ef9de5507861dcee7..cb92d783446399e1d6ce827010b050df9792f09d 100755 (executable)
@@ -34,11 +34,13 @@ sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-
 sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
 sed -f ${out} ${cwd}/scripts/bacula-dir-tape.conf.in >${cwd}/scripts/bacula-dir-tape.conf
 sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
+sed -f ${out} ${cwd}/scripts/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf
 sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
+sed -f ${out} ${cwd}/scripts/cleanup-2tape.in >${cwd}/scripts/cleanup-2tape
 sed -f ${out} ${cwd}/scripts/prepare-two-tapes.in >${cwd}/scripts/prepare-two-tapes
 cp ${cwd}/bin/bacula-sd.conf /tmp/bac$$
 sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf
-chmod 777 ${cwd}/scripts/cleanup-tape ${cwd}/scripts/prepare-two-tapes
+chmod 777 ${cwd}/scripts/cleanup-*tape ${cwd}/scripts/prepare-two-tapes
 rm -f /tmp/bac$$
 cp ${cwd}/bin/mtx-changer /tmp/bac$$
 sed "s%^MTX.*$%MTX=${4}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
index c17288ba243ed7732ec9598af114184b1417210f..fa037b4aa7d518655cb52ef03bcaf8cf28864310 100644 (file)
@@ -1,3 +1,4 @@
 Hardware End of Medium = no
+Fast Forward Space File = no
 BSF at EOM = yes
 Backward Space Record = no
index 8e1d315076a872966f6d317e114364b19fd7bcda..fb19d53c125efcf17f966c4d754ba44078df22b0 100755 (executable)
@@ -48,7 +48,12 @@ messages
 quit
 END_OF_DATA
 bin/bacula stop 2>&1 >/dev/null
-grep TestVolume001 working/restore.bsr 2>&1 >/dev/null
+#
+# This test is not really reliable. What we want to do is
+#   to select files on only one Volume, then insure here
+#   that only one Volume is chosen.
+#
+grep TestVolume002 working/restore.bsr 2>&1 >/dev/null
 bsrstat=$?
 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
 bstat=$?
diff --git a/regress/tests/four-concurrent-jobs-tape b/regress/tests/four-concurrent-jobs-tape
new file mode 100755 (executable)
index 0000000..d3ede9a
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Run two jobs at the same time
+#
+cwd=`pwd`
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "${cwd}/build" >/tmp/file-list
+
+echo " "
+echo " "
+echo " === Starting four-concurent-jobs-tape  ==="
+echo " === Starting four-concurent-jobs-tape  ===" >>working/log
+echo " "
+
+#bin/bacula start 2>&1 >/dev/null
+bin/bacula start
+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 level=Full Storage=DDS-4 yes
+run job=NightlySave level=Full Storage=DDS-4 yes
+run job=NightlySave level=Full Storage=DDS-4 yes
+run job=NightlySave level=Full Storage=DDS-4 yes
+@sleep 2
+status dir
+@sleep 5
+messages
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+
+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 "  !!!!! four-concurent-jobs-tape Bacula source failed!!! !!!!! "
+   echo "  !!!!! four-concurent-jobs-tape failed!!! !!!!! " >>test.out
+   echo " "
+   exit 1
+else
+   echo "  ===== four-concurent-jobs-tape Bacula source OK ===== "
+   echo "  ===== four-concurent-jobs-tape OK ===== " >>test.out
+   scripts/cleanup
+   exit 0
+fi
diff --git a/regress/tests/four-jobs-tape b/regress/tests/four-jobs-tape
new file mode 100755 (executable)
index 0000000..b5f21b4
--- /dev/null
@@ -0,0 +1,119 @@
+#!/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`
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "${cwd}/build" >/tmp/file-list
+
+echo " "
+echo " "
+echo " === Starting four-jobs-tape  ==="
+echo " === Starting four-jobs-tape  ===" >>working/log
+echo " "
+
+bin/bacula start 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+estimate job=NightlySave listing
+estimate job=NightlySave listing
+estimate job=NightlySave listing
+messages
+@output tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0
+run job=NightlySave yes
+wait
+messages
+quit
+END_OF_DATA
+echo "Backup 1 done"
+# make some files for the incremental to pick up
+touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+   
+#
+# run a second job
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+run job=NightlySave level=Incremental yes
+wait
+messages
+quit
+END_OF_DATA
+echo "Backup 2 done"
+touch ${cwd}/build/src/dird/*.c
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+#
+# run a third job
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+run job=NightlySave level=Incremental yes
+wait
+messages
+quit
+END_OF_DATA
+echo "Backup 3 done"
+# make some files for the incremental to pick up
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+#
+# run a fourth job
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+run job=NightlySave level=Incremental yes
+wait
+messages
+quit
+END_OF_DATA
+echo "Backup 4 done"
+# 
+# now do several restores to ensure we cleanup between jobs
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+restore where=${cwd}/tmp/bacula-restores select all
+yes
+wait
+restore where=${cwd}/tmp/bacula-restores select all
+yes
+wait
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+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 "  !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
+   echo "  !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== four-jobs-tape Bacula source OK ===== "
+   echo "  ===== four-jobs-tape OK ===== " >>test.out
+   scripts/cleanup
+fi
diff --git a/regress/tests/incremental-2tape b/regress/tests/incremental-2tape
new file mode 100755 (executable)
index 0000000..783ec8b
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then create some           
+#   new files, do an Incremental and restore those two files.
+#
+# This script uses the autochanger and two tapes
+#
+cwd=`pwd`
+bin/bacula stop  2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+scripts/copy-2tape-confs
+scripts/cleanup-2tape
+echo "${cwd}/tmp/build" >/tmp/file-list
+if test ! -d ${cwd}/tmp/build ; then
+   mkdir ${cwd}/tmp/build
+fi
+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 incremental-2tape test ==="
+echo " === Starting incremental-2tape 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=1
+label storage=DDS-4 volume=TestVolume002 slot=2
+run job=NightlySave yes
+wait
+messages
+quit
+END_OF_DATA
+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 Incremental on the second Volume
+update volume=TestVolume001 VolStatus=Used
+run level=Incremental job=NightlySave yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores 
+7
+<${cwd}/tmp/restore-list
+
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+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 "  !!!!! incremental-2tape test Bacula source failed!!! !!!!! "
+   echo "  !!!!! incremental-2tape test failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== incremental-2tape test Bacula source OK ===== "
+   echo "  ===== incremental-2tape test OK ===== " >>test.out
+   scripts/cleanup
+fi
diff --git a/regress/tests/incremental-tape b/regress/tests/incremental-tape
new file mode 100755 (executable)
index 0000000..43eb3f4
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then create some           
+#   new files, do an Incremental and restore those two files.
+#
+cwd=`pwd`
+bin/bacula stop  2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "${cwd}/tmp/build" >/tmp/file-list
+if test ! -d ${cwd}/tmp/build ; then
+   mkdir ${cwd}/tmp/build
+fi
+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 incremental-tape test ==="
+echo " === Starting incremental-tape 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
+quit
+END_OF_DATA
+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
+run level=Incremental job=NightlySave yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores 
+7
+<${cwd}/tmp/restore-list
+
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+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 "  !!!!! incremental-tape test Bacula source failed!!! !!!!! "
+   echo "  !!!!! incremental-tape test failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== incremental-tape test Bacula source OK ===== "
+   echo "  ===== incremental-tape test OK ===== " >>test.out
+   scripts/cleanup
+fi
index 29605f8c7ea0baba9df299ba48932836825608e7..3123ccbf615073850fb777696a91b6227efc7898 100755 (executable)
@@ -27,7 +27,7 @@ bin/bacula start 2>&1 >/dev/null
 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
 @output /dev/null
 messages
-@tee    tmp/log1.out
+@output tmp/log1.out
 label storage=File volume=TestVolume001
 label storage=File volume=TestVolume002
 run job=CompressedTest yes
@@ -40,7 +40,7 @@ echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
 @output /dev/null
 messages
-@tee    tmp/log1.out
+@output tmp/log1.out
 @# Force Incremental on the second Volume
 update volume=TestVolume001 VolStatus=Used
 run level=Incremental job=CompressedTest yes
@@ -49,7 +49,7 @@ messages
 @# 
 @# now do a restore
 @#
-@tee    tmp/log2.out
+@output tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores 
 7
 <${cwd}/tmp/restore-list
diff --git a/regress/tests/lib-tape-root b/regress/tests/lib-tape-root
new file mode 100755 (executable)
index 0000000..ea9667c
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Run a simple backup of the /lib directory
+#   then restore it.
+#
+cwd=`pwd`
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "/lib" >/tmp/file-list
+echo " "
+echo " "
+echo " === Starting lib-tape-root test ==="
+echo " "
+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 all
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+bin/bacula stop 2>&1 >/dev/null
+cd /
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
+cd ${cwd}/tmp/bacula-restores
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
+cd ${cwd}/tmp
+sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
+sort <1 >original
+#
+sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
+sort <1 >restored
+rm -f 1
+#
+cd ${cwd}
+diff tmp/original tmp/restored 2>&1 1>/dev/nul
+if [ $? != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  ===== lib-tape-root failed!!! ===== "
+   echo "  ===== lib-tape-root failed!!! ===== " >>test.out
+   echo " "
+else
+   echo "  ===== lib-tape-root OK ===== "
+   echo "  ===== lib-tape-root OK ===== " >>test.out
+   scripts/cleanup
+fi
index 4e61cf846ddbc781eecbeee48f1d8ae1b2f7146e..cb0aa64fd2b6da5d205d1bba127b0006c08d84f7 100755 (executable)
@@ -5,7 +5,7 @@
 #
 cwd=`pwd`
 bin/bacula stop  2>&1 >/dev/null
-scripts/copy-tape-confs
+scripts/copy-2tape-confs
 scripts/prepare-two-tapes
 echo "${cwd}/build" >/tmp/file-list
 bin/drop_sqlite_tables
diff --git a/regress/tests/usr-tape-root b/regress/tests/usr-tape-root
new file mode 100755 (executable)
index 0000000..95206c8
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Run a simple backup of the /usr directory
+#   then restore it.
+#
+cwd=`pwd`
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "/usr" >/tmp/file-list
+echo " "
+echo " "
+echo " === Starting usr-tape-root test ==="
+echo " "
+echo " "
+bin/bacula start 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@tee /dev/null
+messages
+@tee tmp/log1.out
+label storage=DDS-4 Volume=TestVolume001 slot=0
+run job=NightlySave yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@tee tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all
+yes
+wait
+messages
+@tee
+quit
+END_OF_DATA
+bin/bacula stop 2>&1 >/dev/null
+cd /
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
+cd ${cwd}/tmp/bacula-restores
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
+cd ${cwd}/tmp
+sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
+sort <1 >original
+#
+sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
+sort <1 >restored
+rm -f 1
+#
+cd ${cwd}
+diff tmp/original tmp/restored 2>&1 1>/dev/nul
+if [ $? != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  ===== usr-tape-root failed!!! ===== "
+   echo "  ===== usr-tape-root failed!!! ===== " >>test.out
+   echo " "
+else
+   echo "  ===== usr-tape-root OK ===== "
+   echo "  ===== usr-tape-root OK ===== " >>test.out
+   scripts/cleanup
+fi