diff options
Diffstat (limited to 'cpp/src/tests/ais_check')
| -rwxr-xr-x | cpp/src/tests/ais_check | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/cpp/src/tests/ais_check b/cpp/src/tests/ais_check index df40899065..156a8b1ebe 100755 --- a/cpp/src/tests/ais_check +++ b/cpp/src/tests/ais_check @@ -1,16 +1,39 @@ #!/bin/sh -test `id -ng` = "ais" || { +# Check for requirements, run AIS tests if found. +# + +test `id -ng` = "ais" || BADGROUP=yes +ps -u root | grep aisexec > /dev/null 2>&1 || NOAISEXEC=yes + +if test -n "$BADGROUP" -o -n "$NOAISEXEC"; then cat <<EOF - =========================== NOTICE============================== - You do not appear to have you group ID set to "ais". + =========== WARNING: NOT RUNNING AIS TESTS ============== + + Tests that depend on the openais library (used for clustering) + will not be run because: + +EOF + test -n"$BADGROUP" || cat <<EOF + You do not appear to have you group ID set to "ais". Make ais your + primary group, or run "newgrp ais" before running the tests. + +EOF + test -n "$NOAISEXEC" || cat <<EOF + The aisexec daemon is not running. Make sure /etc/ais/openais.conf + is a valid configuration and aisexec is run by root. +EOF - Cluster tests that require the openais library will fail.Make sure - you are a member of group ais and run "newgrp ais" before running - the tests. + cat <<EOF - ================================================================ + ========================================================== EOF -exit 1; -} + exit 0; # A warning, not a failure. +fi + +FAILED=0 +for test in `cat ais_tests`; do + $srcdir/$test || FAILED=`expr $FAILED + 1` +done +exit $FAILED |
