diff options
-rw-r--r-- | cpp/src/CMakeLists.txt | 10 | ||||
-rw-r--r-- | cpp/src/cluster.cmake | 9 | ||||
-rw-r--r-- | cpp/src/tests/CMakeLists.txt | 14 | ||||
-rw-r--r-- | cpp/src/tests/cluster.cmake | 86 | ||||
-rwxr-xr-x | cpp/src/tests/clustered_replication_test | 20 | ||||
-rwxr-xr-x | cpp/src/tests/federated_cluster_test | 11 | ||||
-rwxr-xr-x | cpp/src/tests/federated_topic_test | 2 | ||||
-rwxr-xr-x | cpp/src/tests/reliable_replication_test | 15 | ||||
-rwxr-xr-x | cpp/src/tests/replication_test | 20 | ||||
-rwxr-xr-x | cpp/src/tests/run_acl_tests | 8 | ||||
-rwxr-xr-x | cpp/src/tests/run_cli_tests | 4 | ||||
-rwxr-xr-x | cpp/src/tests/run_cluster_tests | 5 | ||||
-rwxr-xr-x | cpp/src/tests/run_failover_soak | 3 | ||||
-rwxr-xr-x | cpp/src/tests/run_federation_tests | 4 | ||||
-rwxr-xr-x | cpp/src/tests/ssl_test | 7 | ||||
-rwxr-xr-x | cpp/src/tests/start_cluster | 2 | ||||
-rwxr-xr-x | cpp/src/tests/start_cluster_hosts | 2 | ||||
-rwxr-xr-x | cpp/src/tests/stop_broker | 2 | ||||
-rwxr-xr-x | cpp/src/tests/stop_cluster | 2 | ||||
-rw-r--r-- | cpp/src/tests/test_env.sh.in | 28 | ||||
-rwxr-xr-x | cpp/src/tests/test_watchdog | 25 | ||||
-rw-r--r-- | cpp/src/tests/testlib.py | 4 |
22 files changed, 192 insertions, 91 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index dc084662dd..49ebe1e31e 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -888,18 +888,18 @@ install (TARGETS replicating_listener # can process the messages from a replication queue (populated on the # source system by the replicating listener plugin above) and take the # corresponding action on the local queues -add_library (replicating_exchange MODULE +add_library (replication_exchange MODULE qpid/replication/constants.h qpid/replication/ReplicationExchange.cpp qpid/replication/ReplicationExchange.h ) -target_link_libraries (replicating_exchange qpidbroker) -set_target_properties (replicating_exchange PROPERTIES PREFIX "") +target_link_libraries (replication_exchange qpidbroker) +set_target_properties (replication_exchange PROPERTIES PREFIX "") if (CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(replicating_exchange PROPERTIES + set_target_properties(replication_exchange PROPERTIES LINK_FLAGS -Wl,--no-undefined) endif (CMAKE_COMPILER_IS_GNUCXX) -install (TARGETS replicating_exchange +install (TARGETS replication_exchange DESTINATION ${QPIDD_MODULE_DIR} COMPONENT ${QPID_COMPONENT_BROKER}) diff --git a/cpp/src/cluster.cmake b/cpp/src/cluster.cmake index c8758a27e4..910d75e768 100644 --- a/cpp/src/cluster.cmake +++ b/cpp/src/cluster.cmake @@ -134,9 +134,12 @@ if (BUILD_CLUSTER) add_library (cluster MODULE ${cluster_SOURCES}) target_link_libraries (cluster ${LIBCPG} ${CMAN_LIB} qpidbroker qpidclient ${Boost_FILESYSTEM_LIBRARY}) - - set_target_properties (cluster PROPERTIES - PREFIX "") + set_target_properties (cluster PROPERTIES PREFIX "") + + # Create a second shared library for linking with test executables, + # cmake will not allow a module to be linked with an executable. + add_library (cluster_shared SHARED ${cluster_SOURCES}) + target_link_libraries (cluster_shared ${LIBCPG} ${CMAN_LIB} qpidbroker qpidclient ${Boost_FILESYSTEM_LIBRARY}) if (CMAKE_COMPILER_IS_GNUCXX) set_target_properties(cluster PROPERTIES diff --git a/cpp/src/tests/CMakeLists.txt b/cpp/src/tests/CMakeLists.txt index fce9c3516a..1d67d22e7c 100644 --- a/cpp/src/tests/CMakeLists.txt +++ b/cpp/src/tests/CMakeLists.txt @@ -169,7 +169,9 @@ remember_location(unit_test) add_library (shlibtest MODULE shlibtest.cpp) -# include(cluster.cmake) +if (BUILD_CLUSTER) + include (cluster.cmake) +endif (BUILD_CLUSTER) # FIXME aconway 2009-11-30: enable SSL #if SSL @@ -229,13 +231,6 @@ target_link_libraries (header_test qpidclient) #header_test_SOURCES=header_test.cpp TestOptions.h ConnectionOptions.h remember_location(header_test) -if (BUILD_CLUSTER) - add_executable (failover_soak failover_soak.cpp ForkedBroker.cpp ${platform_test_additions}) - target_link_libraries (failover_soak qpidclient) - #failover_soak_SOURCES=failover_soak.cpp ForkedBroker.h - remember_location(failover_soak) -endif (BUILD_CLUSTER) - add_executable (declare_queues declare_queues.cpp ${platform_test_additions}) target_link_libraries (declare_queues qpidclient) remember_location(declare_queues) @@ -294,6 +289,9 @@ if (BUILD_ACL) endif (BUILD_ACL) endif (PYTHON_EXECUTABLE) +add_library(test_store MODULE test_store.cpp) +set_target_properties (test_store PROPERTIES PREFIX "") + #EXTRA_DIST += \ # run_test vg_check \ # run-unit-tests start_broker python_tests stop_broker \ diff --git a/cpp/src/tests/cluster.cmake b/cpp/src/tests/cluster.cmake new file mode 100644 index 0000000000..cc7d154e7d --- /dev/null +++ b/cpp/src/tests/cluster.cmake @@ -0,0 +1,86 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# 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 +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# +# Cluster tests cmake fragment, to be included in CMakeLists.txt +# + +add_executable (failover_soak failover_soak.cpp ForkedBroker.cpp ${platform_test_additions}) +target_link_libraries (failover_soak qpidclient) +remember_location(failover_soak) + +set (cluster_test_SOURCES + cluster_test + unit_test + ClusterFixture + ForkedBroker + PartialFailure + ClusterFailover + InitialStatusMap + StoreStatus + ) +add_executable (cluster_test cluster_test ${cluster_test_SOURCES} ${platform_test_additions}) +target_link_libraries (cluster_test ${qpid_test_boost_libs} qpidclient qpidbroker cluster_shared) +remember_location(cluster_test) + +add_test (cluster_test ${CMAKE_CURRENT_SOURCE_DIR}/run_cluster_test${test_script_suffix}) +add_test (cluster_tests ${CMAKE_CURRENT_SOURCE_DIR}/run_cluster_tests${test_script_suffix}) +add_test (cluster_read_credit ${CMAKE_CURRENT_SOURCE_DIR}/cluster_read_credit${test_script_suffix}) +add_test (cluster_test_watchdog ${CMAKE_CURRENT_SOURCE_DIR}/test_watchdog${test_script_suffix}) +add_test (federated_cluster_test ${CMAKE_CURRENT_SOURCE_DIR}/federated_cluster_test${test_script_suffix}) +add_test (clustered_replication_test ${CMAKE_CURRENT_SOURCE_DIR}/clustered_replication_test${test_script_suffix}) + +# FIXME aconway 2009-12-01: translate to cmake +# # Clean up after cluster_test and start_cluster +# CLEANFILES += cluster_test.acl cluster.ports + +# EXTRA_DIST += \ +# ais_check \ +# run_cluster_test \ +# cluster_read_credit \ +# test_watchdog \ +# start_cluster \ +# stop_cluster \ +# restart_cluster \ +# cluster_python_tests \ +# cluster_python_tests_failing.txt \ +# federated_cluster_test \ +# clustered_replication_test \ +# run_cluster_tests \ +# run_long_cluster_tests \ +# testlib.py \ +# cluster_tests.py \ +# long_cluster_tests.py \ +# cluster_tests.fail + +# LONG_TESTS += \ +# run_long_cluster_tests \ +# start_cluster \ +# cluster_python_tests \ +# stop_cluster + +# qpidtest_PROGRAMS += cluster_test + +# cluster_test_SOURCES = \ + +# cluster_test_LDADD=$(lib_client) $(lib_broker) ../cluster.la -lboost_unit_test_framework + +# qpidtest_SCRIPTS += run_cluster_tests cluster_tests.py run_long_cluster_tests long_cluster_tests.py testlib.py cluster_tests.fail + +# endif diff --git a/cpp/src/tests/clustered_replication_test b/cpp/src/tests/clustered_replication_test index c7719b8424..174f93382d 100755 --- a/cpp/src/tests/clustered_replication_test +++ b/cpp/src/tests/clustered_replication_test @@ -32,19 +32,19 @@ fail() { stop_brokers() { if [[ $PRIMARY1 ]] ; then - ../qpidd -q --port $PRIMARY1 + $QPIDD_EXEC --no-module-dir -q --port $PRIMARY1 unset PRIMARY1 fi if [[ $PRIMARY2 ]] ; then - ../qpidd -q --port $PRIMARY2 + $QPIDD_EXEC --no-module-dir -q --port $PRIMARY2 unset PRIMARY2 fi if [[ $DR1 ]] ; then - ../qpidd -q --port $DR1 + $QPIDD_EXEC --no-module-dir -q --port $DR1 unset DR1 fi if [[ $DR2 ]] ; then - ../qpidd -q --port $DR2 + $QPIDD_EXEC --no-module-dir -q --port $DR2 unset DR2 fi } @@ -57,14 +57,14 @@ if test -d $PYTHON_DIR; then DR_CLUSTER=DR_$(hostname)_$$ GENERAL_OPTS="--auth no --no-module-dir --no-data-dir --daemon --port 0 --log-to-stderr false" - PRIMARY_OPTS="--load-module $QPID_MODULE_DIR/replicating_listener.so --create-replication-queue true --replication-queue REPLICATION_QUEUE --load-module $QPID_MODULE_DIR/cluster.so --cluster-name $PRIMARY_CLUSTER" - DR_OPTS="--load-module $QPID_MODULE_DIR/replication_exchange.so --load-module $QPID_MODULE_DIR/cluster.so --cluster-name $DR_CLUSTER" + PRIMARY_OPTS="--load-module $REPLICATING_LISTENER_LIB --create-replication-queue true --replication-queue REPLICATION_QUEUE --load-module $CLUSTER_LIB --cluster-name $PRIMARY_CLUSTER" + DR_OPTS="--load-module $REPLICATION_EXCHANGE_LIB --load-module $CLUSTER_LIB --cluster-name $DR_CLUSTER" rm -f repl*.tmp #cleanup any files left from previous run #start first node of primary cluster and set up test queue echo Starting primary cluster - PRIMARY1=$(with_ais_group ../qpidd $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.1.tmp) || fail "Could not start node" + PRIMARY1=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.1.tmp) || fail "Could not start PRIMARY1" $PYTHON_COMMANDS/qpid-config -a "localhost:$PRIMARY1" add queue test-queue --generate-queue-events 2 $PYTHON_COMMANDS/qpid-config -a "localhost:$PRIMARY1" add queue control-queue --generate-queue-events 1 @@ -74,12 +74,12 @@ if test -d $PYTHON_DIR; then #add new node to primary cluster, testing correct transfer of state: echo Adding node to primary cluster - PRIMARY2=$(with_ais_group ../qpidd $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.2.tmp) + PRIMARY2=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.2.tmp) || fail "Could not start PRIMARY2 " #start DR cluster, set up test queue there and establish replication bridge echo Starting DR cluster - DR1=$(with_ais_group ../qpidd $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.1.tmp) - DR2=$(with_ais_group ../qpidd $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.2.tmp) + DR1=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.1.tmp) || fail "Could not start DR1" + DR2=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.2.tmp) || fail "Could not start DR2" $PYTHON_COMMANDS/qpid-config -a "localhost:$DR1" add queue test-queue $PYTHON_COMMANDS/qpid-config -a "localhost:$DR1" add queue control-queue diff --git a/cpp/src/tests/federated_cluster_test b/cpp/src/tests/federated_cluster_test index 89bb711c3e..70bec5e703 100755 --- a/cpp/src/tests/federated_cluster_test +++ b/cpp/src/tests/federated_cluster_test @@ -33,15 +33,15 @@ fail() { stop_brokers() { if [[ $BROKER_A ]] ; then - ../qpidd -q --port $BROKER_A + ../qpidd --no-module-dir -q --port $BROKER_A unset BROKER_A fi if [[ $NODE_1 ]] ; then - ../qpidd -q --port $NODE_1 + ../qpidd --no-module-dir -q --port $NODE_1 unset NODE_1 fi if [[ $NODE_2 ]] ; then - ../qpidd -q --port $NODE_2 + ../qpidd --no-module-dir -q --port $NODE_2 unset NODE_2 fi if [ -f cluster.ports ]; then @@ -51,13 +51,14 @@ stop_brokers() { start_brokers() { #start single node... - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --log-enable info+ > fed.port.tmp - BROKER_A=`cat fed.port.tmp` + BROKER_A=`../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --log-enable info+` || fail "BROKER_A failed to start" #...and start cluster $srcdir/start_cluster 2 || fail "Could not start cluster" NODE_1=$(head -1 cluster.ports) NODE_2=$(tail -1 cluster.ports) + test -n "$NODE_1" || fail "NODE_1 failed to start" + test -n "$NODE_2" || fail "NODE_2 failed to start" } setup() { diff --git a/cpp/src/tests/federated_topic_test b/cpp/src/tests/federated_topic_test index 7d56f602e9..b1063c7e8c 100755 --- a/cpp/src/tests/federated_topic_test +++ b/cpp/src/tests/federated_topic_test @@ -62,7 +62,7 @@ start_brokers() { stop_brokers() { for p in $PORT_A $PORT_B $PORT_C; do - ${MY_DIR}/../qpidd -q --port $p + $QPIDD_EXEC --no-module-dir -q --port $p done } diff --git a/cpp/src/tests/reliable_replication_test b/cpp/src/tests/reliable_replication_test index 165ece82e0..f57d11a263 100755 --- a/cpp/src/tests/reliable_replication_test +++ b/cpp/src/tests/reliable_replication_test @@ -28,28 +28,23 @@ trap stop_brokers EXIT stop_brokers() { if [[ $BROKER_A ]] ; then - ../qpidd -q --port $BROKER_A + $QPIDD_EXEC --no-module-dir -q --port $BROKER_A unset BROKER_A fi if [[ $BROKER_B ]] ; then - ../qpidd -q --port $BROKER_B + $QPIDD_EXEC --no-module-dir -q --port $BROKER_B unset BROKER_B fi } setup() { rm -f replication-source.log replication-dest.log - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replicating_listener.so --replication-queue replication --create-replication-queue true --log-enable trace+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd-repl.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATING_LISTENER_LIB --replication-queue replication --create-replication-queue true --log-enable trace+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd-repl.port BROKER_A=`cat qpidd-repl.port` - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replication_exchange.so --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd-repl.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd-repl.port BROKER_B=`cat qpidd-repl.port` - #../qpidd --port 5555 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replicating_listener.so --replication-queue replication --create-replication-queue true --log-enable trace+ --log-to-file replication-source.log --log-to-stderr 0 & - #BROKER_A=5555 - - #../qpidd --port 6666 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replication_exchange.so --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 & - #BROKER_B=6666 echo "Testing replication from port $BROKER_A to port $BROKER_B" $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add exchange replication replication @@ -78,7 +73,7 @@ bounce_link() { echo "Route re-established" } -if test -d ${PYTHON_DIR} && test -e $QPID_MODULE_DIR/replicating_listener.so && test -e $QPID_MODULE_DIR/replication_exchange.so ; then +if test -d ${PYTHON_DIR} && test -e $REPLICATING_LISTENER_LIB && test -e $REPLICATION_EXCHANGE_LIB ; then setup for i in `seq 1 100000`; do echo Message $i; done > replicated.expected send & diff --git a/cpp/src/tests/replication_test b/cpp/src/tests/replication_test index e47aeb2b03..691fd20b0c 100755 --- a/cpp/src/tests/replication_test +++ b/cpp/src/tests/replication_test @@ -27,22 +27,22 @@ trap stop_brokers INT TERM QUIT stop_brokers() { if [ x$BROKER_A != x ]; then - ../qpidd -q --port $BROKER_A + $QPIDD_EXEC --no-module-dir -q --port $BROKER_A unset BROKER_A fi if [ x$BROKER_B != x ]; then - ../qpidd -q --port $BROKER_B + $QPIDD_EXEC --no-module-dir -q --port $BROKER_B unset BROKER_B fi } -if test -d ${PYTHON_DIR} && test -f $QPID_MODULE_DIR/replicating_listener.so && test -f $QPID_MODULE_DIR/replication_exchange.so; then +if test -d ${PYTHON_DIR} && test -f "$REPLICATING_LISTENER_LIB" && test -f "$REPLICATION_EXCHANGE_LIB"; then rm -f queue-*.repl replication-*.log #cleanup from any earlier runs - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replicating_listener.so --replication-queue replication --create-replication-queue true --log-enable info+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATING_LISTENER_LIB --replication-queue replication --create-replication-queue true --log-enable info+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd.port BROKER_A=`cat qpidd.port` - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replication_exchange.so --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port BROKER_B=`cat qpidd.port` echo "Running replication test between localhost:$BROKER_A and localhost:$BROKER_B" @@ -97,7 +97,7 @@ if test -d ${PYTHON_DIR} && test -f $QPID_MODULE_DIR/replicating_listener.so && ./receiver --port $BROKER_B --queue queue-e --messages 1 > /dev/null #shutdown broker A then check that broker Bs versions of the queues are as expected - ../qpidd -q --port $BROKER_A + $QPIDD_EXEC --no-module-dir -q --port $BROKER_A unset BROKER_A #validate replicated queues: @@ -118,10 +118,10 @@ if test -d ${PYTHON_DIR} && test -f $QPID_MODULE_DIR/replicating_listener.so && # now check offsets working (enqueue based on position being set, not queue abs position) - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replicating_listener.so --replication-queue replication --create-replication-queue true --log-enable info+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATING_LISTENER_LIB --replication-queue replication --create-replication-queue true --log-enable info+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd.port BROKER_A=`cat qpidd.port` - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replication_exchange.so --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port BROKER_B=`cat qpidd.port` $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add exchange replication replication @@ -147,9 +147,9 @@ if test -d ${PYTHON_DIR} && test -f $QPID_MODULE_DIR/replicating_listener.so && ./receiver --port $BROKER_B --queue queue-d --messages 1 > /dev/null # now check offsets working - ../qpidd -q --port $BROKER_B + $QPIDD_EXEC --no-module-dir -q --port $BROKER_B unset BROKER_B - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $QPID_MODULE_DIR/replication_exchange.so --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port + $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port BROKER_B=`cat qpidd.port` $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-e diff --git a/cpp/src/tests/run_acl_tests b/cpp/src/tests/run_acl_tests index 0cefff2958..7112f621a1 100755 --- a/cpp/src/tests/run_acl_tests +++ b/cpp/src/tests/run_acl_tests @@ -26,20 +26,20 @@ DATA_DIR=`pwd`/data_dir trap stop_brokers INT TERM QUIT start_brokers() { - ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module $QPID_MODULE_DIR/acl.so --acl-file policy.acl --auth no > qpidd.port + ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module $ACL_LIB --acl-file policy.acl --auth no > qpidd.port LOCAL_PORT=`cat qpidd.port` } stop_brokers() { - ../qpidd -q --port $LOCAL_PORT + $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORT } test_loading_acl_from_absolute_path(){ POLICY_FILE=$srcdir/policy.acl rm -f temp.log - PORT=`../qpidd --daemon --port 0 --no-module-dir --no-data-dir --auth no --load-module $QPID_MODULE_DIR/acl.so --acl-file $POLICY_FILE -t --log-to-file temp.log 2>/dev/null` + PORT=`../qpidd --daemon --port 0 --no-module-dir --no-data-dir --auth no --load-module $ACL_LIB --acl-file $POLICY_FILE -t --log-to-file temp.log 2>/dev/null` ACL_FILE=`grep "notice Read ACL file" temp.log | sed 's/^.*Read ACL file //'` - ../qpidd -q --port $PORT + $QPIDD_EXEC --no-module-dir -q --port $PORT if test "$ACL_FILE" != "\"$POLICY_FILE\""; then echo "unable to load policy file from an absolute path"; return 1; diff --git a/cpp/src/tests/run_cli_tests b/cpp/src/tests/run_cli_tests index d47bb70406..34ce3c4f1a 100755 --- a/cpp/src/tests/run_cli_tests +++ b/cpp/src/tests/run_cli_tests @@ -34,8 +34,8 @@ start_brokers() { } stop_brokers() { - ../qpidd -q --port $LOCAL_PORT - ../qpidd -q --port $REMOTE_PORT + $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORT + $QPIDD_EXEC --no-module-dir -q --port $REMOTE_PORT } if test -d ${PYTHON_DIR} ; then diff --git a/cpp/src/tests/run_cluster_tests b/cpp/src/tests/run_cluster_tests index 997cddf1e2..6064f28751 100755 --- a/cpp/src/tests/run_cluster_tests +++ b/cpp/src/tests/run_cluster_tests @@ -22,8 +22,7 @@ source ./test_env.sh source $srcdir/ais_check -TEST_EXEC=$QPID_PYTHON_COMMANDS/qpid-python-test -test -x $TEST_EXEC || { echo Skipping test, $TEST_EXEC not found; exit 0; } +test -x $QPID_PYTHON_TEST || { echo Skipping test, $QPID_PYTHON_TEST not found; exit 0; } # Delete old cluster test data OUTDIR=brokertest.tmp @@ -34,6 +33,6 @@ mkdir -p $OUTDIR CLUSTER_TESTS_IGNORE=${CLUSTER_TESTS_IGNORE:--i cluster_tests.StoreTests.* -I $srcdir/cluster_tests.fail} CLUSTER_TESTS=${CLUSTER_TESTS:-$*} -with_ais_group $TEST_EXEC -DOUTDIR=$OUTDIR -m cluster_tests $CLUSTER_TESTS_IGNORE $CLUSTER_TESTS || exit 1 +with_ais_group $QPID_PYTHON_TEST -DOUTDIR=$OUTDIR -m cluster_tests $CLUSTER_TESTS_IGNORE $CLUSTER_TESTS || exit 1 rm -rf $OUTDIR #exit 0 diff --git a/cpp/src/tests/run_failover_soak b/cpp/src/tests/run_failover_soak index 9c53e6162c..69551a51c2 100755 --- a/cpp/src/tests/run_failover_soak +++ b/cpp/src/tests/run_failover_soak @@ -24,7 +24,8 @@ source ./test_env.sh host=127.0.0.1 -MODULES=${MODULES:-$QPID_MODULE_DIR} +unset QPID_NO_MODULE_DIR # failover_soak uses --module-dir, dont want clash +MODULES=${MODULES:-$moduledir} MESSAGES=${MESSAGES:-1000000} REPORT_FREQUENCY=${REPORT_FREQUENCY:-20000} VERBOSITY=${VERBOSITY:-10} diff --git a/cpp/src/tests/run_federation_tests b/cpp/src/tests/run_federation_tests index 4c3b53ede2..8d7954a533 100755 --- a/cpp/src/tests/run_federation_tests +++ b/cpp/src/tests/run_federation_tests @@ -33,8 +33,8 @@ start_brokers() { } stop_brokers() { - ../qpidd -q --port $LOCAL_PORT - ../qpidd -q --port $REMOTE_PORT + $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORT + $QPIDD_EXEC --no-module-dir -q --port $REMOTE_PORT } if test -d ${PYTHON_DIR} ; then diff --git a/cpp/src/tests/ssl_test b/cpp/src/tests/ssl_test index 2ce1d0bb81..528833076e 100755 --- a/cpp/src/tests/ssl_test +++ b/cpp/src/tests/ssl_test @@ -20,7 +20,6 @@ # # Run a simple test over SSL - source ./test_env.sh CONFIG=$(dirname $0)/config.null @@ -47,12 +46,12 @@ delete_certs() { } start_broker() { - PORT=`../qpidd --daemon --transport ssl --port 0 --ssl-port 0 --no-data-dir --no-module-dir --auth no --config $CONFIG --load-module $QPID_MODULE_DIR/ssl.so --ssl-cert-db $CERT_DIR --ssl-cert-password-file $CERT_PW_FILE --ssl-cert-name $TEST_HOSTNAME` + PORT=`../qpidd --daemon --transport ssl --port 0 --ssl-port 0 --no-data-dir --no-module-dir --auth no --config $CONFIG --load-module $SSL_LIB --ssl-cert-db $CERT_DIR --ssl-cert-password-file $CERT_PW_FILE --ssl-cert-name $TEST_HOSTNAME` } stop_broker() { if [[ $PORT ]] ; then - ../qpidd -q --port $PORT + $QPIDD_EXEC --no-module-dir -q --port $PORT fi } @@ -76,7 +75,7 @@ create_certs || error "Could not create test certificate" start_broker || error "Could not start broker" echo "Running SSL test on port $PORT" export QPID_NO_MODULE_DIR=1 -export QPID_LOAD_MODULE=$QPID_MODULE_DIR/sslconnector.so +export QPID_LOAD_MODULE=$SSLCONNECTOR_LIB export QPID_SSL_CERT_DB=${CERT_DIR} export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE} ./perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME --summary diff --git a/cpp/src/tests/start_cluster b/cpp/src/tests/start_cluster index 90291acad4..bc35a2eddc 100755 --- a/cpp/src/tests/start_cluster +++ b/cpp/src/tests/start_cluster @@ -30,7 +30,7 @@ rm -f cluster*.log cluster.ports qpidd.port SIZE=${1:-3}; shift CLUSTER=$HOSTNAME.$$ -OPTS="-d --no-module-dir --load-module $QPID_MODULE_DIR/cluster.so --cluster-name=$CLUSTER --auth=no --log-enable notice+ --log-enable debug+:cluster $@" +OPTS="-d --no-module-dir --load-module $CLUSTER_LIB --cluster-name=$CLUSTER --auth=no --log-enable notice+ --log-enable debug+:cluster $@" for (( i=0; i<SIZE; ++i )); do DDIR=`mktemp -d /tmp/start_cluster.XXXXXXXXXX` diff --git a/cpp/src/tests/start_cluster_hosts b/cpp/src/tests/start_cluster_hosts index 7680da01ad..778b4248da 100755 --- a/cpp/src/tests/start_cluster_hosts +++ b/cpp/src/tests/start_cluster_hosts @@ -52,7 +52,7 @@ while getopts "kp:n:q:r" ARG ; do done shift `expr $OPTIND - 1` test -n "$PORT" && PORTOPT="-p $PORT" -test "$KILL" = yes && KILL="$QPIDD -q $PORTOPT ;" +test "$KILL" = yes && KILL="$QPIDD --no-module-dir -q $PORTOPT ;" CLUSTER=${*:-$CLUSTER} # Use args or env test -z "$CLUSTER" && { echo Must specify at least one host; exit 1; } diff --git a/cpp/src/tests/stop_broker b/cpp/src/tests/stop_broker index 2f45309a2b..248fd1fc5c 100755 --- a/cpp/src/tests/stop_broker +++ b/cpp/src/tests/stop_broker @@ -25,7 +25,7 @@ QPID_PORT=`cat qpidd.port` export QPID_PORT rm -f qpidd.port -../qpidd --quit || ERROR=1 +../qpidd --no-module-dir --quit || ERROR=1 # Check qpidd.log. egrep 'warning\|error\|critical' qpidd.log && { diff --git a/cpp/src/tests/stop_cluster b/cpp/src/tests/stop_cluster index 24b556a63b..d598a2255a 100755 --- a/cpp/src/tests/stop_cluster +++ b/cpp/src/tests/stop_cluster @@ -23,7 +23,7 @@ PORTS=`cat cluster.ports` for PORT in $PORTS ; do - ../qpidd -qp $PORT || ERROR="$ERROR $PORT" + $QPIDD_EXEC --no-module-dir -qp $PORT || ERROR="$ERROR $PORT" done rm -f cluster.ports qpidd.port diff --git a/cpp/src/tests/test_env.sh.in b/cpp/src/tests/test_env.sh.in index 0b4520ac4a..32c010b9be 100644 --- a/cpp/src/tests/test_env.sh.in +++ b/cpp/src/tests/test_env.sh.in @@ -20,13 +20,12 @@ absdir() { echo `cd $1 && pwd`; } # Environment variables substituted by configure/cmake. -export srcdir=@abs_srcdir@ -export builddir=@abs_builddir@ -export top_srcdir=@abs_top_srcdir@ -export top_builddir=@abs_top_builddir@ - -export QPID_MODULE_DIR=$top_builddir/src@builddir_lib_suffix@ -export QPID_TEST_MODULE_DIR=$builddir@builddir_lib_suffix@ +srcdir=@abs_srcdir@ +builddir=@abs_builddir@ +top_srcdir=@abs_top_srcdir@ +top_builddir=@abs_top_builddir@ +moduledir=$top_builddir/src@builddir_lib_suffix@ +testmoduledir=$builddir@builddir_lib_suffix@ # Python paths and directories export PYTHON_DIR=$builddir/python @@ -41,8 +40,9 @@ export QPID_CONFIG_EXEC=$PYTHON_COMMANDS/qpid-config export QPID_ROUTE_EXEC=$PYTHON_COMMANDS/qpid-route export QPID_CLUSTER_EXEC=$PYTHON_COMMANDS/qpid-cluster -# qpidd executable +# Executables export QPIDD_EXEC=$top_builddir/src/qpidd +export QPID_WATCHDOG_EXEC=$top_builddir/src/qpidd_watchdog # Test executables export QPID_TEST_EXEC_DIR=$builddir @@ -50,19 +50,19 @@ export RECEIVER_EXEC=$QPID_TEST_EXEC_DIR/receiver export SENDER_EXEC=$QPID_TEST_EXEC_DIR/sender # Modules -export TEST_STORE_LIB=$QPID_TEST_MODULE_DIR/test_store.so -export REPLICATING_LISTENER_LIB=$QPID_MODULE_DIR/replicating_listener.so -export REPLICATION_EXCHANGE_LIB=$QPID_MODULE_DIR/replication_exchange.so +export TEST_STORE_LIB=$testmoduledir/test_store.so -# Optional modules, set only if present -exportmodule() { test -f $QPID_MODULE_DIR/$2 && eval "export $1=$QPID_MODULE_DIR/$2"; } +exportmodule() { test -f $moduledir/$2 && eval "export $1=$moduledir/$2"; } exportmodule ACL_LIB acl.so exportmodule CLUSTER_LIB cluster.so -exportmodule SSL_CONNECTOR_LIB ssl_connector.so +exportmodule REPLICATING_LISTENER_LIB replicating_listener.so +exportmodule REPLICATION_EXCHANGE_LIB replication_exchange.so +exportmodule SSLCONNECTOR_LIB sslconnector.so exportmodule SSL_LIB ssl.so exportmodule WATCHDOG_LIB watchdog.so exportmodule XML_LIB xml.so # Qpid options +export QPID_NO_MODULE_DIR=1 # Don't accidentally load installed modules export QPID_DATA_DIR= # Default to no data dir, not ~/.qpidd diff --git a/cpp/src/tests/test_watchdog b/cpp/src/tests/test_watchdog index c2f33501b8..2e9967ee24 100755 --- a/cpp/src/tests/test_watchdog +++ b/cpp/src/tests/test_watchdog @@ -1,10 +1,29 @@ #!/bin/sh + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# 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 +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + # Tests for the watchdog plug-in # Start a broker with watchdog, freeze it with kill -STOP, verify that it is killed. -export QPID_WATCHDOG_EXE=$PWD/../qpidd_watchdog -PORT=`../qpidd -dp0 --no-data-dir --auth=no --no-module-dir --load-module $PWD/../.libs/watchdog.so --log-to-file=qpidd_watchdog.log --watchdog-interval 1` -PID=`../qpidd -cp $PORT` +PORT=`$QPIDD_EXEC -dp0 --no-data-dir --auth=no --no-module-dir --load-module $WATCHDOG_LIB --log-to-file=qpidd_watchdog.log --watchdog-interval 1` +PID=`$QPIDD_EXEC --no-module-dir -cp $PORT` kill -STOP $PID sleep 2 diff --git a/cpp/src/tests/testlib.py b/cpp/src/tests/testlib.py index 1402ba792c..fe57a84a81 100644 --- a/cpp/src/tests/testlib.py +++ b/cpp/src/tests/testlib.py @@ -118,7 +118,7 @@ class TestBase(unittest.TestCase): def stopBroker(self, nodeTuple, ignoreFailures = False): """Stop a broker using qpidd -q""" try: - ret = os.spawnl(os.P_WAIT, self._qpiddExec, self._qpiddExec, "--port=%d" % nodeTuple[self.PORT], "--quit") + ret = os.spawnl(os.P_WAIT, self._qpiddExec, self._qpiddExec, "--port=%d" % nodeTuple[self.PORT], "--quit", "--no-module-dir") if ret != 0: raise Exception("stopBroker(): port=%d: qpidd -q returned %d" % (nodeTuple[self.PORT], ret)) try: @@ -763,4 +763,4 @@ class TestBaseCluster(TestBase): msgList = TestBaseCluster.TestHelper.sendMsgs(self, "", numMsgs, nodeNumber, msgSize, wait) for ml in self._txMsgs.itervalues(): ml.extend(msgList) -
\ No newline at end of file + |