[rhmessaging-commits] rhmessaging commits: r3443 - in store/trunk/cpp/tests: cluster and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Jun 10 15:19:04 EDT 2009


Author: kpvdr
Date: 2009-06-10 15:19:04 -0400 (Wed, 10 Jun 2009)
New Revision: 3443

Modified:
   store/trunk/cpp/tests/cluster/run_cluster_tests
   store/trunk/cpp/tests/run_python_tests
Log:
Connected the installed qpid cluster tests to the store

Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests	2009-06-10 12:37:10 UTC (rev 3442)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests	2009-06-10 19:19:04 UTC (rev 3443)
@@ -32,7 +32,7 @@
 if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
     cat <<EOF
 
-    =========== WARNING: NOT RUNNING AIS TESTS ==============
+    ========== WARNING: NOT RUNNING CLUSTER TESTS ============
 
     Tests that depend on the openais library (used for clustering)
     will not be run because:
@@ -46,31 +46,86 @@
     exit 0;			# A warning, not a failure.
 fi
 
-# Execute command with the ais group set.
-with_ais_group() {
-    id -nG | grep '\<ais\>' >/dev/null || { echo "You are not a member of the ais group."; exit 1; }
-    echo $* | newgrp ais
-}
-
 # QPID_DIR is defined for source tree builds because of the --with-qpid-checkout config parameter
-CLUSTER_EXEC=cluster_test
+CPP_CLUSTER_EXEC=cluster_test
+PYTHON_CLUSTER_EXEC=cluster.py
 if test "${QPID_DIR}" -a -d ${QPID_DIR} ;  then
 	# Source tree path
 	CLUSTER_DIR=${QPID_DIR}/cpp/src/tests
+	export PYTHONPATH=${QPID_DIR}/python:${abs_srcdir}
+	export QPIDD_EXEC=${QPID_DIR}/cpp/src/qpidd
+	export CLUSTER_LIB=${QPID_DIR}/cpp/src/.libs/cluster.so
+	export QPID_CONFIG_EXEC=${QPID_DIR}/python/commands/qpid-config
+	export QPID_ROUTE_EXEC=${QPID_DIR}/python/commands/qpid-route
+	export RECEIVER_EXEC=${QPID_DIR}/cpp/src/tests/receiver
+	export SENDER_EXEC=${QPID_DIR}/cpp/src/tests/sender
 else
 	# Path from known installed locations
-	CLUSTER_PATH=`which ${CLUSTER_EXEC}`
+	CLUSTER_PATH=/usr/libexec/qpid/tests/cluster_test
 	if test -z ${CLUSTER_PATH} ; then
-		echo "No executable \"${CLUSTER_EXEC}\" found in path"
+		echo "No executable \"${CPP_CLUSTER_EXEC}\" found in path"
 		exit 1
 	else
 		CLUSTER_DIR=${CLUSTER_PATH%/*}
 	fi
+	export PYTHONPATH=${abs_srcdir}
+	export QPIDD_EXEC=/usr/sbin/qpidd
+	export CLUSTER_LIB=/usr/lib/qpid/daemon/cluster.so
+	export QPID_CONFIG_EXEC=/usr/bin/qpid-config
+	export QPID_ROUTE_EXEC=/usr/bin/qpid-route
+	export RECEIVER_EXEC=/usr/libexec/qpid/test/receiver
+	export SENDER_EXEC=/usr/libexec/qpid/test/sender
 fi
+export STORE_LIB=${abs_srcdir}/../../lib/.libs/msgstore.so
 
-# Run the tests
-srcdir=`dirname $0`
+# Run the C++ cluster tests
+pwd=`pwd`
 cd ${CLUSTER_DIR}
-pwd
-with_ais_group ./${CLUSTER_EXEC} || ERROR=1
-exit $ERROR
+sg ais -c "./${CPP_CLUSTER_EXEC}"
+RETCODE=$?
+if test x${RETCODE} != x0; then 
+    exit 1;
+#fi
+
+# --- Check for Python, then run python cluster tests ---
+
+if python -c "import qpid" ; then
+	PYTHON_TESTS=python_tests
+	FAILING_PYTHON_TESTS=${abs_srcdir}/failing_python_tests.txt
+else
+    cat <<EOF
+
+	===========  WARNING: PYTHON TESTS DISABLED ==============
+	
+	Unable to load python qpid module - skipping python tests.
+	
+    PYTHONPATH=${PYTHONPATH}"
+
+	===========================================================
+
+EOF
+    exit
+fi
+
+#Make sure temp dir exists if this is the first to use it
+TEST_DIR=${abs_srcdir}
+TMP_STORE_DIR=${TEST_DIR}/test_tmp
+if ! test -d ${TMP_STORE_DIR} ; then
+   	mkdir -p ${TMP_STORE_DIR}/cluster
+else
+    # Delete old cluster test dirs
+    rm -rf "${TMP_STORE_DIR}/cluster"
+    mkdir -p "${TMP_STORE_DIR}/cluster"
+fi
+export TMP_STORE_DIR
+
+sg ais -c "./${PYTHON_CLUSTER_EXEC} -v"
+RETCODE=$?
+if test x${RETCODE} != x0; then 
+    exit 1;
+fi
+
+# Delete cluster store dir if test was successful.
+rm -rf ${TMP_STORE_DIR}
+
+exit 0

Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests	2009-06-10 12:37:10 UTC (rev 3442)
+++ store/trunk/cpp/tests/run_python_tests	2009-06-10 19:19:04 UTC (rev 3443)
@@ -67,32 +67,6 @@
     mkdir -p "${TMP_STORE_DIR}/cluster"
 fi
 
-# Check AIS requirements
-id -nG | grep '\<ais\>' >/dev/null || NOGROUP="You are not a member of the ais group."
-ps -u root | grep 'aisexec\|corosync' >/dev/null || NOAISEXEC="The aisexec or corosync daemon is not running as root"
-
-if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
-    cat <<EOF
-
-    ========= WARNING: CLUSTERING TESTS DISABLED ==============
-
-    Tests that depend on the openais library (used for clustering)
-    will not be run because:
-
-    $NOGROUP
-    $NOAISEXEC
-
-    ===========================================================
-
-EOF
-    exit
-else
-	export RUN_CLUSTER_TESTS=1
-	if test -z ${LIBCLUSTER} ; then
-		 export LIBCLUSTER=${QPID_DIR}/cpp/src/.libs/cluster.so
-	fi
-fi
-
 if test -z ${QPIDD} ; then
 	export QPIDD=${QPID_DIR}/cpp/src/qpidd
 fi




More information about the rhmessaging-commits mailing list