summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-04-16 19:20:30 +0000
committerAlan Conway <aconway@apache.org>2012-04-16 19:20:30 +0000
commitc121e4803971122f703730eb65c8d7bfdeec916f (patch)
tree533b5ba34eadb63eca73ecb5aeaafbdcb5f6ea1c
parent0dde682105118b364773e2bee18021734edcf573 (diff)
downloadqpid-python-c121e4803971122f703730eb65c8d7bfdeec916f.tar.gz
NO-JIRA: Control running of cluster tests.
Previously cluster tests would run if cluster services were running, even if build was explicitly configured without CPG. Don't run cluster tests unless the build is configured with CPG. If the build is configured *with* CPG, you can still skip the CPG tests by setting QPID_USE_CPG=no in the environment. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1326756 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/configure.ac27
-rw-r--r--qpid/cpp/src/tests/Makefile.am17
-rw-r--r--qpid/cpp/src/tests/cluster.cmake2
-rw-r--r--qpid/cpp/src/tests/cluster.mk8
-rwxr-xr-xqpid/cpp/src/tests/cluster_python_tests3
-rwxr-xr-xqpid/cpp/src/tests/cluster_read_credit4
-rwxr-xr-xqpid/cpp/src/tests/clustered_replication_test17
-rwxr-xr-xqpid/cpp/src/tests/cpg_check.sh.in (renamed from qpid/cpp/src/tests/ais_check)18
-rwxr-xr-xqpid/cpp/src/tests/federated_cluster_test23
-rwxr-xr-xqpid/cpp/src/tests/ipv6_test3
-rw-r--r--qpid/cpp/src/tests/qpidd-empty.conf3
-rwxr-xr-xqpid/cpp/src/tests/run_cluster_authentication_soak3
-rwxr-xr-xqpid/cpp/src/tests/run_cluster_authentication_test3
-rwxr-xr-xqpid/cpp/src/tests/run_cluster_test3
-rwxr-xr-xqpid/cpp/src/tests/run_cluster_tests4
-rwxr-xr-xqpid/cpp/src/tests/run_failover_soak3
-rwxr-xr-xqpid/cpp/src/tests/run_federation_sys_tests8
-rw-r--r--qpid/cpp/src/tests/sasl.mk21
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster4
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_link_cluster3
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_queue_cluster3
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_route_cluster3
-rwxr-xr-xqpid/cpp/src/tests/ssl_test3
-rwxr-xr-xqpid/cpp/src/tests/start_cluster3
-rw-r--r--qpid/cpp/src/tests/test_env.sh.in1
25 files changed, 120 insertions, 70 deletions
diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac
index f3fa5097d0..c68fed932e 100644
--- a/qpid/cpp/configure.ac
+++ b/qpid/cpp/configure.ac
@@ -27,7 +27,7 @@ AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_USE_SYSTEM_EXTENSIONS
-AC_LANG([C++])
+AC_LANG([C++])
# Check for optional use of help2man
AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
@@ -83,14 +83,14 @@ if test x$GXX = xyes; then
gl_COMPILER_FLAGS(-Wvolatile-register-var)
gl_COMPILER_FLAGS(-Winvalid-pch)
gl_COMPILER_FLAGS(-Wno-system-headers)
- gl_COMPILER_FLAGS(-Woverloaded-virtual)
+ gl_COMPILER_FLAGS(-Woverloaded-virtual)
AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
COMPILER_FLAGS=
fi
else
AC_CHECK_DECL([__SUNPRO_CC], [SUNCC=yes], [SUNCC=no])
-
+
# Set up for sun CC compiler
if test x$SUNCC = xyes; then
if test "${enableval}" = yes; then
@@ -118,7 +118,7 @@ LIBS=$gl_saved_libs
gl_CLOCK_TIME
-# Enable Valgrind
+# Enable Valgrind
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind],
[run valgrind memory checker on tests, if available (default yes)])],
@@ -262,7 +262,7 @@ tmp_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync"
AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],)
AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],)
-AC_ARG_WITH([cpg],
+AC_ARG_WITH([cpg],
[AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])],
[case "${withval}" in
yes) # yes - require dependencies
@@ -270,7 +270,7 @@ AC_ARG_WITH([cpg],
test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or corosync-devel])
with_cpg=yes
;;
- no) with_cpg=no ;;
+ no) with_cpg=no ;;
*) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;;
esac],
[ # not specified - use if present
@@ -278,12 +278,14 @@ AC_ARG_WITH([cpg],
]
)
AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_cpg = xyes])
+AC_SUBST(USE_CPG, [$with_cpg])
+
# Clean up unnceccassary flags if we don't use clustering
AS_IF([test ! x$with_cpg = xyes], [LDFLAGS=$tmp_LDFLAGS])
AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,)
AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,)
-AC_ARG_WITH([libcman],
+AC_ARG_WITH([libcman],
[AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])],
[case "${withval}" in
yes) # yes - require dependencies
@@ -291,7 +293,7 @@ AC_ARG_WITH([libcman],
test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel or cmanlib-devel])
with_libcman=yes
;;
- no) with_libcman=no ;;
+ no) with_libcman=no ;;
*) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;;
esac],
[ # not specified - use if present and we're using with_cpg
@@ -443,9 +445,9 @@ AC_ARG_WITH([ssl],
[
with_SSL=yes
AC_PATH_PROG([NSPR_CONFIG], [nspr-config])
- AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no],
+ AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no],
[AC_PATH_PROG([NSS_CONFIG], [nss-config])
- AS_IF([test x$NSS_CONFIG = x], [with_SSL=no],
+ AS_IF([test x$NSS_CONFIG = x], [with_SSL=no],
[SSL_CFLAGS="`$NSPR_CONFIG --cflags` `$NSS_CONFIG --cflags`"
SSL_LDFLAGS="`$NSPR_CONFIG --libs` `$NSS_CONFIG --libs`"])])
]
@@ -515,11 +517,11 @@ AC_ARG_WITH([probes],
)
# Check for some syslog capabilities not present in all systems
-AC_TRY_COMPILE([#include <sys/syslog.h>],
+AC_TRY_COMPILE([#include <sys/syslog.h>],
[int v = LOG_AUTHPRIV;],
[AC_DEFINE([HAVE_LOG_AUTHPRIV], [1], [Set to 1 whether LOG_AUTHPRIV is supported.])],)
-AC_TRY_COMPILE([#include <sys/syslog.h>],
+AC_TRY_COMPILE([#include <sys/syslog.h>],
[int v = LOG_FTP;],
[AC_DEFINE([HAVE_LOG_FTP], [1], [Set to 1 whether LOG_FTP is supported.])],)
@@ -571,6 +573,7 @@ AC_CONFIG_FILES([
managementgen/Makefile
etc/Makefile
src/Makefile
+ src/tests/cpg_check.sh
src/tests/Makefile
src/tests/test_env.sh
src/tests/install_env.sh
diff --git a/qpid/cpp/src/tests/Makefile.am b/qpid/cpp/src/tests/Makefile.am
index 7a08a6d10b..66d2cdd5d5 100644
--- a/qpid/cpp/src/tests/Makefile.am
+++ b/qpid/cpp/src/tests/Makefile.am
@@ -320,7 +320,7 @@ EXTRA_DIST += \
header_test.py \
ssl_test \
config.null \
- ais_check \
+ cpg_check.sh.in \
run_federation_tests \
run_federation_sys_tests \
run_long_federation_sys_tests \
@@ -368,9 +368,15 @@ LONG_TESTS+=start_broker \
fanout_perftest shared_perftest multiq_perftest topic_perftest run_ring_queue_test \
run_msg_group_tests_soak \
stop_broker \
- run_long_federation_sys_tests \
- run_failover_soak reliable_replication_test \
- federated_cluster_test_with_node_failure
+ run_long_federation_sys_tests
+
+if HAVE_LIBCPG
+
+LONG_TESTS+= federated_cluster_test_with_node_failure \
+ run_failover_soak \
+ reliable_replication_test
+
+endif HAVE_LIBCPG
EXTRA_DIST+= \
fanout_perftest \
@@ -381,7 +387,8 @@ EXTRA_DIST+= \
reliable_replication_test \
federated_cluster_test_with_node_failure \
sasl_test_setup.sh \
- run_msg_group_tests_soak
+ run_msg_group_tests_soak \
+ qpidd-empty.conf
check-long:
$(MAKE) check TESTS="$(LONG_TESTS)" VALGRIND=
diff --git a/qpid/cpp/src/tests/cluster.cmake b/qpid/cpp/src/tests/cluster.cmake
index 3471173e97..31e2d337d1 100644
--- a/qpid/cpp/src/tests/cluster.cmake
+++ b/qpid/cpp/src/tests/cluster.cmake
@@ -55,7 +55,7 @@ add_test (clustered_replication_test ${CMAKE_CURRENT_SOURCE_DIR}/clustered_repli
# CLEANFILES += cluster_test.acl cluster.ports
# EXTRA_DIST += \
-# ais_check \
+# cpg_check.sh.in \
# run_cluster_test \
# cluster_read_credit \
# test_watchdog \
diff --git a/qpid/cpp/src/tests/cluster.mk b/qpid/cpp/src/tests/cluster.mk
index df24f021ba..852b2dda8c 100644
--- a/qpid/cpp/src/tests/cluster.mk
+++ b/qpid/cpp/src/tests/cluster.mk
@@ -29,7 +29,7 @@ CLUSTER_TEST_SCRIPTS_LIST= \
EXTRA_DIST += \
$(CLUSTER_TEST_SCRIPTS_LIST) \
- ais_check \
+ cpg_check.sh.in \
run_cluster_test \
cluster_read_credit \
test_watchdog \
@@ -54,14 +54,12 @@ if HAVE_LIBCPG
#
# Cluster tests makefile fragment, to be included in Makefile.am
-#
+#
# NOTE: Programs using the openais library must be run with gid=ais
# You should do "newgrp ais" before running the tests to run these.
-#
-
+#
-# ais_check checks pre-requisites for cluster tests and runs them if ok.
TESTS += \
run_cluster_test \
cluster_read_credit \
diff --git a/qpid/cpp/src/tests/cluster_python_tests b/qpid/cpp/src/tests/cluster_python_tests
index 8e17ffc8bc..25c7889246 100755
--- a/qpid/cpp/src/tests/cluster_python_tests
+++ b/qpid/cpp/src/tests/cluster_python_tests
@@ -20,7 +20,8 @@
#
# Skip if cluster services not running.
-. `dirname $0`/ais_check
+. cpg_check.sh
+cpg_enabled || exit 0
FAILING=`dirname $0`/cluster_python_tests_failing.txt
source `dirname $0`/python_tests
diff --git a/qpid/cpp/src/tests/cluster_read_credit b/qpid/cpp/src/tests/cluster_read_credit
index fb3b72fbaf..552ffee53b 100755
--- a/qpid/cpp/src/tests/cluster_read_credit
+++ b/qpid/cpp/src/tests/cluster_read_credit
@@ -21,7 +21,9 @@
# Regression test for http://issues.apache.org/jira/browse/QPID-2086
srcdir=`dirname $0`
-. $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
+
$srcdir/start_cluster 1 --cluster-read-max=2 || exit 1
trap $srcdir/stop_cluster EXIT
seq 1 10000 | ./sender --port `cat cluster.ports` --routing-key no-such-queue
diff --git a/qpid/cpp/src/tests/clustered_replication_test b/qpid/cpp/src/tests/clustered_replication_test
index 8c8522c2eb..5a9f143eb4 100755
--- a/qpid/cpp/src/tests/clustered_replication_test
+++ b/qpid/cpp/src/tests/clustered_replication_test
@@ -8,9 +8,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -34,11 +34,11 @@ stop_brokers() {
if [[ $PRIMARY1 ]] ; then
$QPIDD_EXEC --no-module-dir -q --port $PRIMARY1
unset PRIMARY1
- fi
+ fi
if [[ $PRIMARY2 ]] ; then
$QPIDD_EXEC --no-module-dir -q --port $PRIMARY2
unset PRIMARY2
- fi
+ fi
if [[ $DR1 ]] ; then
$QPIDD_EXEC --no-module-dir -q --port $DR1
unset DR1
@@ -50,7 +50,8 @@ stop_brokers() {
}
if test -d $PYTHON_DIR; then
- . $srcdir/ais_check
+ . cpg_check.sh
+ cpg_enabled || exit 0
#todo: these cluster names need to be unique to prevent clashes
PRIMARY_CLUSTER=PRIMARY_$(hostname)_$$
@@ -89,20 +90,20 @@ if test -d $PYTHON_DIR; then
#send more messages to primary
for i in `seq 11 20`; do echo Message$i; done | ./sender --port $PRIMARY1 --send-eos 1
- #wait for replication events to all be processed:
+ #wait for replication events to all be processed:
echo Waiting for replication to complete
echo Done | ./sender --port $PRIMARY1 --routing-key control-queue --send-eos 1
./receiver --queue control-queue --port $DR1 > /dev/null
#verify contents of test queue on dr cluster:
- echo Verifying...
+ echo Verifying...
./receiver --port $DR2 > repl.out.tmp
for i in `seq 6 20`; do echo Message$i; done | diff repl.out.tmp - || FAIL=1
if [[ $FAIL ]]; then
echo Clustered replication test failed: expectations not met!
exit 1
- else
+ else
echo Clustered replication test passed
rm -f repl*.tmp
fi
diff --git a/qpid/cpp/src/tests/ais_check b/qpid/cpp/src/tests/cpg_check.sh.in
index a865260543..ed97776218 100755
--- a/qpid/cpp/src/tests/ais_check
+++ b/qpid/cpp/src/tests/cpg_check.sh.in
@@ -7,9 +7,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,12 +18,16 @@
# under the License.
#
-srcdir=`dirname $0`
+QPID_USE_CPG=${QPID_USE_CPG:-@USE_CPG@}
-# Check AIS requirements and run tests if found.
-ps -u root | grep 'aisexec\|corosync' >/dev/null || {
- echo WARNING: Skipping cluster tests, the aisexec or corosync daemon is not running.
- exit 0; # A warning, not a failure.
+# Check if CPG is enabled
+cpg_enabled() {
+ test x$QPID_USE_CPG = xyes || return 1 # disabled
+ ps -u root | grep 'aisexec\|corosync' >/dev/null || {
+ echo WARNING: Skip cluster tests, aisexec or corosync daemon is not running.
+ return 1; # A warning, not a failure.
+ }
+ return 0
}
# Execute command with the ais group set if user is a member.
diff --git a/qpid/cpp/src/tests/federated_cluster_test b/qpid/cpp/src/tests/federated_cluster_test
index 50b877e666..f42b7501b8 100755
--- a/qpid/cpp/src/tests/federated_cluster_test
+++ b/qpid/cpp/src/tests/federated_cluster_test
@@ -8,9 +8,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ stop_brokers() {
if [[ $BROKER_A ]] ; then
../qpidd --no-module-dir -q --port $BROKER_A
unset BROKER_A
- fi
+ fi
if [[ $NODE_1 ]] ; then
../qpidd --no-module-dir -q --port $NODE_1
unset NODE_1
@@ -92,7 +92,7 @@ run_test_pull_to_cluster_two_consumers() {
wait
sort -g -k 2 fed1.out.tmp fed2.out.tmp > fed.out.tmp
diff fed.in.tmp fed.out.tmp || fail "federated link to cluster failed: expectations not met!"
-
+
rm -f fed*.tmp #cleanup
}
@@ -106,7 +106,7 @@ run_test_pull_to_cluster() {
#verify all messages are received
diff fed.in.tmp fed.out.tmp || fail "federated link to cluster failed: expectations not met!"
-
+
rm -f fed*.tmp #cleanup
}
@@ -121,22 +121,23 @@ run_test_pull_from_cluster() {
#verify all messages are received
wait
diff fed.in.tmp fed.out.tmp || fail "federated link from cluster failed: expectations not met!"
-
+
rm -f fed*.tmp #cleanup
}
if test -d ${PYTHON_DIR}; then
- . $srcdir/ais_check
+ . cpg_check.sh
+ cpg_enabled || exit 0
rm -f fed*.tmp #cleanup any files left from previous run
start_brokers
echo "brokers started"
setup
echo "setup completed"
- run_test_pull_to_cluster_two_consumers
+ run_test_pull_to_cluster_two_consumers
echo "federated link to cluster verified"
- run_test_pull_from_cluster
+ run_test_pull_from_cluster
echo "federated link from cluster verified"
if [[ $TEST_NODE_FAILURE ]] ; then
#kill first cluster node and retest
@@ -146,7 +147,7 @@ if test -d ${PYTHON_DIR}; then
echo "retesting..."
run_test_pull_to_cluster
echo "federated link to cluster verified"
- run_test_pull_from_cluster
- echo "federated link from cluster verified"
+ run_test_pull_from_cluster
+ echo "federated link from cluster verified"
fi
fi
diff --git a/qpid/cpp/src/tests/ipv6_test b/qpid/cpp/src/tests/ipv6_test
index 8fa272d514..6becfd8c96 100755
--- a/qpid/cpp/src/tests/ipv6_test
+++ b/qpid/cpp/src/tests/ipv6_test
@@ -113,7 +113,8 @@ fi
test -z $CLUSTER_LIB && exit 0 # Exit if cluster not supported.
## Test failover in a cluster using IPv6 only
-. $srcdir/ais_check # Will exit if clustering not enabled.
+. cpg_check.sh
+cpg_enabled || exit 0
pick_port() {
# We need a fixed port to set --cluster-url. Use qpidd to pick a free port.
diff --git a/qpid/cpp/src/tests/qpidd-empty.conf b/qpid/cpp/src/tests/qpidd-empty.conf
new file mode 100644
index 0000000000..bbf52bf446
--- /dev/null
+++ b/qpid/cpp/src/tests/qpidd-empty.conf
@@ -0,0 +1,3 @@
+# An empty configuration file.
+# Used when running tests to avoid picking up configuration
+# installed in the default place.
diff --git a/qpid/cpp/src/tests/run_cluster_authentication_soak b/qpid/cpp/src/tests/run_cluster_authentication_soak
index 7bc406c4ca..24befa28ba 100755
--- a/qpid/cpp/src/tests/run_cluster_authentication_soak
+++ b/qpid/cpp/src/tests/run_cluster_authentication_soak
@@ -19,8 +19,9 @@
source ./test_env.sh
-source $srcdir/ais_check
source sasl_test_setup.sh
+source cpg_check.sh
+cpg_enabled || exit 0
with_ais_group ./cluster_authentication_soak 500
diff --git a/qpid/cpp/src/tests/run_cluster_authentication_test b/qpid/cpp/src/tests/run_cluster_authentication_test
index 647200b869..844807a857 100755
--- a/qpid/cpp/src/tests/run_cluster_authentication_test
+++ b/qpid/cpp/src/tests/run_cluster_authentication_test
@@ -19,8 +19,9 @@
source ./test_env.sh
-source $srcdir/ais_check
source sasl_test_setup.sh
+source cpg_check.sh
+cpg_enabled || exit 0
with_ais_group ./cluster_authentication_soak
diff --git a/qpid/cpp/src/tests/run_cluster_test b/qpid/cpp/src/tests/run_cluster_test
index c022eea1fe..11df3d63a3 100755
--- a/qpid/cpp/src/tests/run_cluster_test
+++ b/qpid/cpp/src/tests/run_cluster_test
@@ -22,5 +22,6 @@
# Run the tests
srcdir=`dirname $0`
-. $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
with_ais_group $srcdir/run_test ./cluster_test
diff --git a/qpid/cpp/src/tests/run_cluster_tests b/qpid/cpp/src/tests/run_cluster_tests
index e136d3810a..a5cea5ff6e 100755
--- a/qpid/cpp/src/tests/run_cluster_tests
+++ b/qpid/cpp/src/tests/run_cluster_tests
@@ -20,7 +20,9 @@
#
source ./test_env.sh
-source $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
+
test -x $QPID_PYTHON_TEST || { echo Skipping test, $QPID_PYTHON_TEST not found; exit 0; }
diff --git a/qpid/cpp/src/tests/run_failover_soak b/qpid/cpp/src/tests/run_failover_soak
index 4c2e8cc188..2c56bf7d6b 100755
--- a/qpid/cpp/src/tests/run_failover_soak
+++ b/qpid/cpp/src/tests/run_failover_soak
@@ -20,7 +20,8 @@
#
source ./test_env.sh
-. $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
host=127.0.0.1
diff --git a/qpid/cpp/src/tests/run_federation_sys_tests b/qpid/cpp/src/tests/run_federation_sys_tests
index f5f772d72e..76da176914 100755
--- a/qpid/cpp/src/tests/run_federation_sys_tests
+++ b/qpid/cpp/src/tests/run_federation_sys_tests
@@ -26,12 +26,8 @@ source ./test_env.sh
MODULENAME=federation_sys
# Test for clustering
-ps -u root | grep 'aisexec\|corosync' > /dev/null
-if (( $? == 0 )); then
- CLUSTERING_ENABLED=1
-else
- echo "WARNING: No clustering detected; tests using it will be ignored."
-fi
+source cpg_check.sh
+if cpg_enabled; then CLUSTERING_ENABLED=1; fi
# Test for long test
if [[ "$1" == "LONG_TEST" ]]; then
diff --git a/qpid/cpp/src/tests/sasl.mk b/qpid/cpp/src/tests/sasl.mk
index 69b24c3f8a..11731dcf40 100644
--- a/qpid/cpp/src/tests/sasl.mk
+++ b/qpid/cpp/src/tests/sasl.mk
@@ -20,18 +20,37 @@
# Test that are only relevant if SASL is enabled.
if HAVE_SASL
+if HAVE_LIBCPG
check_PROGRAMS+=cluster_authentication_soak
cluster_authentication_soak_INCLUDES=$(PUBLIC_INCLUDES)
cluster_authentication_soak_SOURCES=cluster_authentication_soak.cpp ForkedBroker.h ForkedBroker.cpp
cluster_authentication_soak_LDADD=$(lib_client) $(lib_broker)
+endif HAVE_LIBCPG
# Note: sasl_version is not a test -- it is a tool used by tests.
check_PROGRAMS+=sasl_version
sasl_version_SOURCES=sasl_version.cpp
sasl_version_LDADD=$(lib_client)
-TESTS += run_cluster_authentication_test sasl_fed sasl_fed_ex_dynamic sasl_fed_ex_link sasl_fed_ex_queue sasl_fed_ex_route sasl_fed_ex_route_cluster sasl_fed_ex_link_cluster sasl_fed_ex_queue_cluster sasl_fed_ex_dynamic_cluster sasl_no_dir
+TESTS += sasl_fed
+ sasl_fed_ex_dynamic
+ sasl_fed_ex_link
+ sasl_fed_ex_queue
+ sasl_fed_ex_route
+ sasl_no_dir
+
+if HAVE_LIBCPG
+
+TESTS += run_cluster_authentication_test \
+ sasl_fed_ex_route_cluster \
+ sasl_fed_ex_link_cluster \
+ sasl_fed_ex_queue_cluster \
+ sasl_fed_ex_dynamic_cluster
+
LONG_TESTS += run_cluster_authentication_soak
+
+endif HAVE_LIBCPG
+
EXTRA_DIST += run_cluster_authentication_test \
sasl_fed \
sasl_fed_ex \
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster b/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster
index b0cceccecb..fd6b72a4f2 100755
--- a/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster
+++ b/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster
@@ -21,7 +21,9 @@
source ./test_env.sh
-source $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
+
with_ais_group ${srcdir}/sasl_fed_ex dynamic cluster
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_link_cluster b/qpid/cpp/src/tests/sasl_fed_ex_link_cluster
index 4139300b12..34b2aa4a5f 100755
--- a/qpid/cpp/src/tests/sasl_fed_ex_link_cluster
+++ b/qpid/cpp/src/tests/sasl_fed_ex_link_cluster
@@ -21,7 +21,8 @@
source ./test_env.sh
-source $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
with_ais_group ${srcdir}/sasl_fed_ex link cluster
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster b/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster
index f251420e08..14f36f6fc4 100755
--- a/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster
+++ b/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster
@@ -21,7 +21,8 @@
source ./test_env.sh
-source ${srcdir}/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
with_ais_group ${srcdir}/sasl_fed_ex queue cluster
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_route_cluster b/qpid/cpp/src/tests/sasl_fed_ex_route_cluster
index a5d1542def..756476056e 100755
--- a/qpid/cpp/src/tests/sasl_fed_ex_route_cluster
+++ b/qpid/cpp/src/tests/sasl_fed_ex_route_cluster
@@ -21,7 +21,8 @@
source ./test_env.sh
-source ${srcdir}/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
with_ais_group ${srcdir}/sasl_fed_ex route cluster
diff --git a/qpid/cpp/src/tests/ssl_test b/qpid/cpp/src/tests/ssl_test
index ac978d3bd0..91ff8eec1e 100755
--- a/qpid/cpp/src/tests/ssl_test
+++ b/qpid/cpp/src/tests/ssl_test
@@ -192,7 +192,8 @@ stop_brokers
test -z $CLUSTER_LIB && exit 0 # Exit if cluster not supported.
## Test failover in a cluster using SSL only
-. $srcdir/ais_check # Will exit if clustering not enabled.
+source cpg_check.sh
+cpg_enabled || exit 0
PORT1=`pick_port`; ssl_cluster_broker $PORT1
echo "Running SSL cluster broker on port $PORT1"
diff --git a/qpid/cpp/src/tests/start_cluster b/qpid/cpp/src/tests/start_cluster
index 84f98b3b2d..78fd104d9c 100755
--- a/qpid/cpp/src/tests/start_cluster
+++ b/qpid/cpp/src/tests/start_cluster
@@ -24,7 +24,8 @@
# Execute command with the ais group set.
source ./test_env.sh
-. `dirname $0`/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
rm -f cluster*.log cluster.ports qpidd.port
diff --git a/qpid/cpp/src/tests/test_env.sh.in b/qpid/cpp/src/tests/test_env.sh.in
index 5c07bcdc2e..cee36843ae 100644
--- a/qpid/cpp/src/tests/test_env.sh.in
+++ b/qpid/cpp/src/tests/test_env.sh.in
@@ -75,6 +75,7 @@ exportmodule XML_LIB xml.so
# Qpid options
export QPID_NO_MODULE_DIR=1 # Don't accidentally load installed modules
export QPID_DATA_DIR=
+export QPID_CONFIG=$srcdir/qpidd-empty.conf
# Use temporary directory if $HOME does not exist
if [ ! -e "$HOME" ]; then