diff --git a/BasicSanity.sh b/BasicSanity.sh index 0d1a3f6a73..084e50a8d5 100755 --- a/BasicSanity.sh +++ b/BasicSanity.sh @@ -1,59 +1,78 @@ #!/bin/bash test_home=`dirname $0` valgrind="" verbose="" tests="" if [ "$test_home" = "." ]; then test_home="$PWD" fi function info() { printf "$*\n" } function error() { printf " * ERROR: $*\n" } info "Test home is:\t$test_home" while true ; do case "$1" in all) tests="pengine lrmd fencing cli"; shift;; pengine|lrmd|fencing|cli) tests="$tests $1"; shift;; -V|--verbose) verbose="-V"; shift;; -v|--valgrind) valgrind="-v"; shift;; --) shift ; break ;; "") break;; *) echo "unknown option: $1"; exit 1;; esac done if [ -z "$tests" ]; then tests="pengine lrmd fencing cli" fi +failed="" for t in $tests; do info "Executing the $t regression tests" info "============================================================" if [ -e $test_home/$t/regression.py ]; then # Fencing, lrmd chmod a+x $test_home/$t/regression.py - sudo $test_home/$t/regression.py $verbose + $test_home/$t/regression.py $verbose + rc=$? elif [ -e $test_home/$t ]; then # pengine, cli $test_home/$t/regression.sh $verbose $valgrind + rc=$? elif [ $t = cli -a -e $test_home/tools ]; then # Running cli tests from the source tree $test_home/tools/regression.sh $verbose $valgrind + rc=$? else error "Cannot find $t test in $test_home" - exit 1 + rc=1 fi + + if [ $rc != 0 ]; then + info "$t regression tests failed: $rc" + failed="$failed $t" + fi + + info "============================================================" + info "" + info "" done +if [ -z $failed ]; then + exit 0 +fi + +error "regression tests for $failed failed" +exit 1