]> git.sur5r.net Git - bacula/bacula/commitdiff
Fail tests requiring tape drive if none present
authorKern Sibbald <kern@sibbald.com>
Mon, 24 Mar 2008 21:17:09 +0000 (21:17 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 24 Mar 2008 21:17:09 +0000 (21:17 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6674 91ce42f0-d328-0410-95d8-f526ca767f89

31 files changed:
regress/DartTestfile.txt.in
regress/prototype.conf
regress/scripts/cleanup-tape.in
regress/scripts/functions
regress/tests/2drive-incremental-2t2d-tape
regress/tests/2drive-incremental-2t2da-tape
regress/tests/ansi-label-1t1d-tape
regress/tests/backup-bacula-1t1d-tape
regress/tests/backup-win32-tape
regress/tests/bscan-1t1d-tape
regress/tests/bscan-fast-tape
regress/tests/btape-fill-full-tape
regress/tests/eighty-simultaneous-jobs-tape
regress/tests/eot-fail-tape
regress/tests/fixed-block-size-1t1d-tape
regress/tests/four-concurrent-jobs-1t1d-tape
regress/tests/four-jobs-1t1d-tape
regress/tests/incremental-1t1d-tape
regress/tests/incremental-2media-tape
regress/tests/memory-bug-tape
regress/tests/relabel-1t1d-tape
regress/tests/restore-by-file-1t1d-tape
regress/tests/restore-seek-tape
regress/tests/small-file-size-1t1d-tape
regress/tests/truncate-bug-1t1d-tape
regress/tests/two-pool-2t1da-tape
regress/tests/two-volume-tape
regress/tests/verify-vol-1t1d-tape
regress/tests/vol-duration-2t1da-tape
regress/tests/win32-backup-tape
regress/tests/win32-to-linux-tape

index 05b0d50a3d23032c0dee02c14a96ea7fac88a5c4..a5bdb1731dc27441a496979cafe2f834603513ef 100644 (file)
@@ -43,7 +43,7 @@ ADD_TEST(all-non-root:2drive-concurrent-test "@regressdir@/tests/2drive-concurre
 ADD_TEST(all-non-root:2drive-incremental-2disk "@regressdir@/tests/2drive-incremental-2disk")
 ADD_TEST(all-non-root-2tape:incremental-2tape "@regressdir@/tests/incremental-2tape")
 ADD_TEST(all-non-root-2tape:two-volume-tape "@regressdir@/tests/two-volume-tape")
-ADD_TEST(all-non-root-tape:2drive-incremental-2t2da-tape "@regressdir@/tests/2drive-incremental-2t2da-tape")
+ADD_TEST(all-non-root-2drive-tape:2drive-incremental-2t2da-tape "@regressdir@/tests/2drive-incremental-2t2da-tape")
 ADD_TEST(all-non-root-tape:ansi-label-1t1d-tape "@regressdir@/tests/ansi-label-1t1d-tape")
 ADD_TEST(all-non-root-tape:backup-bacula-1t1d-tape "@regressdir@/tests/backup-bacula-1t1d-tape")
 ADD_TEST(all-non-root-tape:bscan-1t1d-tape "@regressdir@/tests/bscan-1t1d-tape")
index c5381a28d16b07ace7d3819f5307a23ebcbd0503..b0ba660fcd0623a5a0bbc8e4ec900f83d6e4eee9 100644 (file)
@@ -9,9 +9,12 @@ SMTP_HOST="localhost"
 SQLITE3_DIR=${HOME}/bacula/depkgs/sqlite3
 SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
 
+# set to /dev/null if you do not have a tape drive
 TAPE_DRIVE="/dev/nst0"
+
 # if you don't have an autochanger set AUTOCHANGER to /dev/null
 AUTOCHANGER="/dev/sg0"
+
 # For two drive tests -- set to /dev/null if you do not have it 
 TAPE_DRIVE1="/dev/null"
 
@@ -56,4 +59,3 @@ BASEPORT=8101
 #  test machines, add some indication of the machine.
 #
 SITE_NAME=<your-name>-bacula-${HOST}
-
index 98ed537766fead1e88c5b059154e9100fdf565b9..1fbefe6d490d302816caee89ae35a27213bab91f 100755 (executable)
@@ -4,5 +4,9 @@
 #
 scripts/cleanup
 
+a=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
+if test $a = 0 ; then
+  bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
+fi
 mt -f @tape_drive@ rewind
 mt -f @tape_drive@ weof
index 78fbffda284411b9b32e10aa2b9cacc687d43641..6518f0f034e444c67b5cc90bfa1a496629977669 100644 (file)
@@ -25,13 +25,37 @@ if [ $MUID != 0 ] ; then
 fi
 }
 
+require_tape_drive() 
+{
+if test x${TAPE_DRIVE} = x/dev/null ; then
+   echo "$TestName test needs a tape drive, but has none."
+   exit 1
+fi
+}
+
+require_second_drive()
+{ 
+if test x${TAPE_DRIVE1} = x/dev/null ; then
+   echo "$JobName needs second drive, but has none."
+   exit 1
+fi
+}
+
+require_autochanger()
+{
+if test x${AUTOCHANGER} = x/dev/null ; then
+   echo "$TestName needs an autochanger, but has none."
+   exit 1
+fi
+}
+
+
 skip_if_no_autochanger()
 {
 if test x${AUTOCHANGER} = x/dev/null ; then
    echo "$TestName test skipped. No autochanger."
    exit
 fi
-
 }
 
 set_debug()
index 613d4a2ba38f2d935a6ad7758652723405c83a39..f9ec1e669c2e931785f20ce7cc64fc75a4ab17f0 100755 (executable)
@@ -3,16 +3,15 @@
 # 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
+# This script uses the autochanger and two drives
 #
 TestName="2drive-incremental-2t2da-tape"
 JobName="2drive2tape"
 . scripts/functions
 
-if test x${TAPE_DRIVE1} = x/dev/null ; then
-   echo "Skipping 2drive-incremental-2tape test. No second drive."
-   exit
-fi
+require_tape_drive
+require_autochanger
+require_second_drive
 
 
 scripts/copy-2drive-confs
index 613d4a2ba38f2d935a6ad7758652723405c83a39..fd09b9b21f878e0dedd5ec3c3bb781bdd1b7a01d 100755 (executable)
@@ -3,17 +3,15 @@
 # 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
+# This script uses the autochanger and two drives
 #
 TestName="2drive-incremental-2t2da-tape"
 JobName="2drive2tape"
 . scripts/functions
 
-if test x${TAPE_DRIVE1} = x/dev/null ; then
-   echo "Skipping 2drive-incremental-2tape test. No second drive."
-   exit
-fi
-
+require_tape_drive
+require_autochanger
+require_second_drive
 
 scripts/copy-2drive-confs
 scripts/cleanup-2drive
index d574b058ae8cc906d85a0e64f7c207002b6b04d1..141316a6bcd30a96efe6ba245a761e07cb03b751 100755 (executable)
@@ -12,6 +12,8 @@ TestName="ansi-label-1t1d-tape"
 JobName=backuptape
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 /bin/cp -f scripts/ansi-sd-tape.conf bin/bacula-sd.conf
 scripts/cleanup-tape
index dd67072039dfe13844fdf4aaf5425122ff3c0921..4a80a8f201a88b77e214f9ef170dbf5d198711bb 100755 (executable)
@@ -10,6 +10,8 @@ TestName="backup-bacula-1t1d-tape"
 JobName=backuptape
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index 2c67ddce85eb4a6b8d7bad4e020a4362e2909f84..36c556caa8bef4d0811ab96aae6b9e317651cc13 100755 (executable)
@@ -8,6 +8,8 @@ TestName="backup-win32-tape"
 JobName=backupwintape
 . scripts/functions
 
+require_tape_drive_drive
+
 scripts/cleanup-tape
 scripts/copy-win32-confs
 
index 8c09fadf4d955c90d19932a80ebe17d5e7179527..e6a070d8bf36bdaea632116efaa02fad400b6fbd 100755 (executable)
@@ -9,6 +9,8 @@ TestName="bscan-1t1d-tape"
 JobName=bscantape
 . scripts/functions
 
+require_tape_drive
+
 copy_tape_confs
 
 echo "${cwd}/build" >tmp/file-list
index 7e2b38e3296a278d568737e5e8e0aa786797de56..110c007f7d174f1ce41b86ee4cdde3a60e0e7aa6 100755 (executable)
@@ -9,6 +9,8 @@ TestName="bscan-tape"
 JobName=bscantape
 . scripts/functions
 
+require_tape_drive
+
 copy_tape_confs
 
 echo "${cwd}/build" >${cwd}/tmp/file-list
index 7c32d04cda3a71666b7a0765b9869664ec7b6b8b..dc3fcec98cd5cbebe73bc8c9f1e231182e776c5f 100755 (executable)
@@ -6,6 +6,8 @@ TestName="btape-fill-full-tape"
 JobName=AutoLabel
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index 3fe631fceb72516cbc396036308f0800ced429b9..4b79c09143c0b81b5f1b704e1195c6335b674835 100755 (executable)
@@ -6,6 +6,8 @@ TestName="eighty-simultaneous-jobs-tape"
 JobName=EightySimultaneousJobs
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
 
index 33bf4035b11bee0492cb41da998d78617273d471..44c36d07b9caea0670f17366f3f6a69666c4f57c 100755 (executable)
@@ -7,6 +7,8 @@ TestName="eot-fail-tape"
 JobName=eotfailtape
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
  
index 0e6ea48f727c89957db8100343151cd1afe201a7..e34c3f53057a33777fe799a3dade2dd9e39a71b2 100755 (executable)
@@ -8,6 +8,8 @@ TestName="fixed-block-size-1t1d-tape"
 JobName=fixedblocksize
 . scripts/functions
 
+require_tape_drive
+
 copy_tape_confs
 
 echo "${cwd}/build" >${cwd}/tmp/file-list
index 738d8178ae57adcad6c1e8c03f6b16eebc32c748..b4fcc2a8e1a7521e5980657ab63c9e9cc2ccfbc1 100755 (executable)
@@ -6,6 +6,8 @@ TestName="four-concurrent-jobs-1t1d-tape"
 JobName=FourConcurrentJobs
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
 
index 2a912e2f9f4a3be97c75964c6d4708e187847f4e..3a850186a1e33b2c1f675f5a77f895f408124ea1 100755 (executable)
@@ -8,6 +8,8 @@ TestName="four-jobs-1t1d-tape"
 JobName=fourjobstape
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
 echo "${cwd}/build" >${cwd}/tmp/file-list
index 75dc046a9dcd44ef9c76e4570381e90713ff66ba..2e83c7a45d7e26aabc8e09458860045695d976ef 100755 (executable)
@@ -7,6 +7,8 @@ TestName="incremental-1t1d-tape"
 JobName=IncTape
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index 65014880f827dd4e660a05202e4926a0740c4eda..62ecc5e34008ece93472dfe18bd3e26a729dcfa7 100755 (executable)
@@ -10,6 +10,8 @@ TestName="incremental-2media-tape"
 JobName=Inc2mediaTape
 . scripts/functions
 
+require_tape_drive
+require_second_drive
 
 scripts/cleanup
 # Get conf files
index 6ae57fed6ebbc43210b5d5f5de8a2bf97e7a114a..15f5c8915818cc77fd99590dd1dab2e3d8f96b05 100755 (executable)
@@ -9,6 +9,8 @@ TestName="four-concurrent-jobs-tape"
 JobName=FourConcurrentJobs
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
 
index a4bca3f26a5124f309fb2f01fc29a764d2b0979b..d929db335892e6a1380bd17eea643a482905d935 100755 (executable)
@@ -8,6 +8,8 @@ TestName="relabel-1t1d-tape"
 JobName=Relabeltape
 . scripts/functions
 
+require_tape_drive
+
 scripts/cleanup-tape
 scripts/copy-tape-confs
 
index 7dea206fe0c1ac0a163a7ef6edf3e315f58e611a..e88f5d87c85b2a0f640713a2171bd3113caf857f 100755 (executable)
@@ -9,6 +9,9 @@
 TestName="restore-by-file-1t1d-tape"
 JobName=restorebyfile
 . scripts/functions
+
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index 7d5b17b0d2bd7e31dd09ed0ebf8a8deff10d6c77..041c278debe474065e11b3635e8d4727f3500a03 100755 (executable)
@@ -10,6 +10,8 @@ TestName="restore-seek-tape"
 JobName=restore-tape-seek
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index 658832339afde255227ffa6340c965037a85e851..a677de65415fe496a04d49fb54de69c1e1dde299 100755 (executable)
@@ -7,6 +7,8 @@ TestName="small-file-size-1t1d-tape"
 JobName=smallfilesize
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index ac28b281e1474c37a43cb9d45ef0ff5ae82fe508..97a58fa96d3a8058488507e72456b80bbb6f2a05 100755 (executable)
@@ -6,6 +6,8 @@ TestName="truncate-bug-1t1d-tape"
 JobName=truncatebug
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index b90634f0b70c54a76f706430dc897f3e196f2adc..6559790c2bf1e92e359d4cd53c0c092482beea66 100755 (executable)
@@ -11,7 +11,8 @@ TestName="two-pool-2t1da-tape"
 JobName=twopooltape
 . scripts/functions
 
-skip_if_no_autochanger
+require_tape_drive
+require_autochanger
 
 scripts/cleanup
 scripts/copy-2tape-confs
index e20af2510caff16bc9ecc1dae7810b34aff4658d..2cb84214d7cfce18145b6f37bad4cab2f5b528c6 100755 (executable)
@@ -9,10 +9,8 @@ TestName="two-volume-tape"
 JobName=twovoltape
 . scripts/functions
 
-if test x${AUTOCHANGER} = x/dev/null ; then
-   echo "${TestName} test skipped. No autochanger."
-   exit
-fi
+require_tape_drive
+require_autochanger
 
 scripts/cleanup
 scripts/copy-2tape-confs
index 1670ed18798a01322ec43e3eb6561323a54cc51e..40065ad2ecf4c158735582bf026e4f3a2bc1875d 100755 (executable)
@@ -7,6 +7,8 @@ TestName="verify-vol-1t1d-tape"
 JobName=VerifyVol
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
index fb2d1cd456ce1d65d126c1f069d0c04bc0693ea0..a1438469766fd68eef8bde8d5aee7e0894668dc4 100755 (executable)
@@ -13,7 +13,8 @@ TestName="vol-duration-2t1da-tape"
 JobName=VolDuration
 . scripts/functions
 
-skip_if_no_autochanger
+require_tape_drive
+require_autochanger
 
 scripts/cleanup
 scripts/copy-2tape-confs
index 299fdd4873b0a8dfc91920bce0c884ff8879d66c..4afd093536f032cde4f0888187ab43cc3fe00900 100755 (executable)
@@ -8,6 +8,8 @@ TestName="win32-backup-tape"
 JobName=win32tape
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-win32-confs
 scripts/cleanup-tape
 
index 05abd857160dbab1f23a3eeb4c9f92c491548d0e..366a88e1d61e0291a1659d30b2b7c1522d393a60 100755 (executable)
@@ -8,6 +8,8 @@ TestName="win32-to-linux-tape"
 JobName=AutoLabel
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-win32-confs
 scripts/cleanup-tape