From 5ce5067ef1124c6570ca5cff7f61ebc089e4f94c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 2 Sep 2009 16:16:33 +0200 Subject: [PATCH] Work on certification scripts --- regress/.gitignore | 1 + regress/tests/btape-fill-full-changer | 4 +- regress/tests/btape-fill-full-tape | 4 +- regress/tests/btape-test-changer | 9 +-- regress/tests/btape-test-tape | 8 +-- regress/tests/certify-changer | 88 +++++++++++++++++++++++++++ regress/{ => tests}/full-tape-tests | 3 + 7 files changed, 105 insertions(+), 12 deletions(-) create mode 100755 regress/tests/certify-changer rename regress/{ => tests}/full-tape-tests (93%) diff --git a/regress/.gitignore b/regress/.gitignore index ae606e1895..875f2092cf 100644 --- a/regress/.gitignore +++ b/regress/.gitignore @@ -1,3 +1,4 @@ +cert.out diff time.out 1 diff --git a/regress/tests/btape-fill-full-changer b/regress/tests/btape-fill-full-changer index b93505d46b..e4671365cf 100755 --- a/regress/tests/btape-fill-full-changer +++ b/regress/tests/btape-fill-full-changer @@ -23,14 +23,14 @@ sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf if test "$debug" -eq 1 ; then - $bin/btape -c bin/bacula-sd.conf tape <${cwd}/tmp/log1.out 2>&1 + $bin/btape -c bin/bacula-sd.conf Drive-0 <${cwd}/tmp/log1.out 2>&1 fill m diff --git a/regress/tests/btape-fill-full-tape b/regress/tests/btape-fill-full-tape index 87b8032699..bfa0b0d463 100755 --- a/regress/tests/btape-fill-full-tape +++ b/regress/tests/btape-fill-full-tape @@ -22,14 +22,14 @@ sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf if test "$debug" -eq 1 ; then - $bin/btape -c bin/bacula-sd.conf tape <${cwd}/tmp/log1.out 2>&1 + $bin/btape -c bin/bacula-sd.conf Drive-0 <${cwd}/tmp/log1.out 2>&1 fill s diff --git a/regress/tests/btape-test-changer b/regress/tests/btape-test-changer index 1388559ecc..9fa56f4c8c 100755 --- a/regress/tests/btape-test-changer +++ b/regress/tests/btape-test-changer @@ -17,13 +17,14 @@ change_jobname $JobName start_test if test "$debug" -eq 1 ; then - $bin/btape -c bin/bacula-sd.conf tape <${cwd}/tmp/log1.out 2>&1 + $bin/btape -c bin/bacula-sd.conf Drive-0 <${cwd}/bin/bacula-sd.conf if test "$debug" -eq 1 ; then - $bin/btape -c bin/bacula-sd.conf tape <${cwd}/tmp/log2.out 2>&1 + $bin/btape -c bin/bacula-sd.conf Drive-0 <${cwd}/tmp/log2.out 2>&1 test yes quit diff --git a/regress/tests/btape-test-tape b/regress/tests/btape-test-tape index 6afb786ef9..5e91e61f20 100755 --- a/regress/tests/btape-test-tape +++ b/regress/tests/btape-test-tape @@ -15,12 +15,12 @@ change_jobname $JobName start_test if test "$debug" -eq 1 ; then - $bin/btape -c bin/bacula-sd.conf tape <${cwd}/tmp/log1.out 2>&1 + $bin/btape -c bin/bacula-sd.conf Drive-0 <${cwd}/tmp/log1.out 2>&1 test quit END_OF_DATA @@ -42,12 +42,12 @@ cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf if test "$debug" -eq 1 ; then - $bin/btape -c bin/bacula-sd.conf tape <${cwd}/tmp/log2.out 2>&1 + $bin/btape -c bin/bacula-sd.conf Drive-0 <${cwd}/tmp/log2.out 2>&1 test quit END_OF_DATA diff --git a/regress/tests/certify-changer b/regress/tests/certify-changer new file mode 100755 index 0000000000..882ba13d5b --- /dev/null +++ b/regress/tests/certify-changer @@ -0,0 +1,88 @@ +#!/bin/sh +# +# Script to automate hardware certification +# This script assumes that everything is in regress/bin and that +# you have an autochanger +# +# This script was designed for Linux. For other systems, you may +# need to edit it. +# +outf=cert.out +. scripts/functions + + +echo " " >${outf} +echo "=== Start hardware certification tests at `date +%R:%S` ===" >>${outf} +echo " " >>${outf} +uname -a >>${outf} +echo " " >>${outf} +bin/bacula-dir -t -? >>${outf} 2>>${outf} +echo " " >>${outf} +echo "lsscsi:" >>${outf} +lsscsi >>${outf} +echo " " >>${outf} +echo "Changer=${AUTOCHANGER}" >>${outf} +echo "Drive=${TAPE_DRIVE}" >>${outf} +echo " " >>${outf} +echo "tapeinfo: " >>${outf} +tapeinfo -f ${AUTOCHANGER} >>${outf} +echo " " >>${outf} +echo "loaderinfo: " >>${outf} +loaderinfo -f ${AUTOCHANGER} >>${outf} +echo " " >>${outf} +echo "mtx: " >>${outf} +mtx -f ${AUTOCHANGER} status >>${outf} +echo " " >>${outf} +echo "lspci:" >>${outf} +lspci -vv >>${outf} + +# If we have an autoloader, load the tape in slot1 +if test ! x$AUTOCHANGER = x/dev/null ; then + a=`bin/mtx-changer $AUTOCHANGER loaded $SLOT1 $TAPE_DRIVE $DRIVE1` + if test $a = 0 ; then + bin/mtx-changer $AUTOCHANGER load $SLOT1 $TAPE_DRIVE $DRIVE1 + fi +fi + +# Autochanger tests +REGRESS_DEBUG=1 tests/btape-test-changer >>${outf} +nice tests/2drive-incremental-changer >>${outf} +nice tests/bad-label-changer >>${outf} +nice tests/incremental-changer >>${outf} +nice tests/two-pool-changer >>${outf} +nice tests/two-volume-changer >>${outf} +nice tests/vol-duration-changer >>${outf} + + + +# Non-autochanger tests +REGRESS_DEBUG=1 tests/btape-test-tape >>${outf} +nice tests/ansi-label-tape >>${outf} +nice tests/backup-bacula-tape >>${outf} +nice tests/bscan-tape >>${outf} +nice tests/eighty-simultaneous-jobs-tape >>${outf} +nice tests/eot-fail-tape >>${outf} +nice tests/fixed-block-size-tape >>${outf} +nice tests/four-concurrent-jobs-tape >>${outf} +nice tests/four-jobs-tape >>${outf} +nice tests/incremental-2media-tape >>${outf} +nice tests/incremental-tape >>${outf} +nice tests/memory-bug-tape >>${outf} +nice tests/relabel-tape >>${outf} +nice tests/restore-by-file-tape >>${outf} +nice tests/restore-seek-tape >>${outf} +nice tests/small-file-size-tape >>${outf} +nice tests/truncate-bug-tape >>${outf} +nice tests/verify-vol-tape >>${outf} + +# Autochanger tests +REGRESS_DEBUG=1 tests/btape-test-changer >>${outf} +nice tests/2drive-incremental-changer >>${outf} +nice tests/bad-label-changer >>${outf} +nice tests/incremental-changer >>${outf} +nice tests/two-pool-changer >>${outf} +nice tests/two-volume-changer >>${outf} +nice tests/vol-duration-changer >>${outf} + + +echo "=== End hardware certification tests at `date +%R:%S` ===" >>${outf} diff --git a/regress/full-tape-tests b/regress/tests/full-tape-tests similarity index 93% rename from regress/full-tape-tests rename to regress/tests/full-tape-tests index 378b214e6d..493ce0f780 100755 --- a/regress/full-tape-tests +++ b/regress/tests/full-tape-tests @@ -18,6 +18,7 @@ echo "Start full tape tests" echo "Start full tape tests" >>test.out # Non-autochanger tests +nicd tests/btest-test-tape nice tests/ansi-label-tape nice tests/backup-bacula-tape nice tests/bscan-tape @@ -37,6 +38,7 @@ nice tests/truncate-bug-tape nice tests/verify-vol-tape # Autochanger tests +nice tests/btest-test-changer nice tests/2drive-incremental-changer nice tests/bad-label-changer nice tests/incremental-changer @@ -46,6 +48,7 @@ nice tests/vol-duration-changer # very long # nice tests/btape-fill-full-tape +# nice tests/btape-fill-full-changer # requires manual intervention # nice tests/manual-two-vol-tape -- 2.39.5