Author: aconway
Date: Fri Jul 27 07:01:36 2007
New Revision: 560234

URL: http://svn.apache.org/viewvc?view=rev&rev=560234
Log:

        * src/tests/ais_check, cluster.mk: Run AIS tests only if:
         - CLUSTER makefile conditional set by configure.
         - Effective gid == ais
         - aisexec is running
        Otherwise print a warning. 

        * src/tests/EventChannelConnectionTest.cpp
        * src/qpid/cluster/doxygen_overview.h
        Removed unused files.

Removed:
    incubator/qpid/trunk/qpid/cpp/src/tests/EventChannelConnectionTest.cpp
Modified:
    incubator/qpid/trunk/qpid/cpp/src/tests/ais_check
    incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/ais_check
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/ais_check?view=diff&rev=560234&r1=560233&r2=560234
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/ais_check (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/ais_check Fri Jul 27 07:01:36 2007
@@ -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

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk?view=diff&rev=560234&r1=560233&r2=560234
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk Fri Jul 27 07:01:36 2007
@@ -12,16 +12,23 @@
 # Cluster tests.
 # 
 
+# ais_check runs ais if the conditions to run AIS tests
+# are met, otherwise it prints a warning.
 TESTS+=ais_check
 EXTRA_DIST+=ais_check
+AIS_TESTS=
 
-TESTS+=Cpg
+ais_check: ais_tests
+ais_tests:
+       echo $(AIS_TESTS) >$@
+
+AIS_TESTS+=Cpg
 check_PROGRAMS+=Cpg
 Cpg_SOURCES=Cpg.cpp
 Cpg_LDADD=$(lib_cluster) -lboost_unit_test_framework
 
 # TODO aconway 2007-07-26: Fix this test.
-#TESTS+=Cluster
+#AIS_TESTS+=Cluster
 check_PROGRAMS+=Cluster
 Cluster_SOURCES=Cluster.cpp Cluster.h
 Cluster_LDADD=$(lib_cluster) -lboost_unit_test_framework
@@ -31,7 +38,7 @@
 Cluster_child_LDADD=$(lib_cluster) -lboost_test_exec_monitor
 
 # TODO aconway 2007-07-03: In progress
-#TESTS+=cluster_client
+#AIS_TESTS+=cluster_client
 check_PROGRAMS+=cluster_client
 cluster_client_SOURCES=cluster_client.cpp
 cluster_client_LDADD=$(lib_client) -lboost_unit_test_framework


Reply via email to