summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-11-12 21:22:24 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-11-12 21:22:24 +0000
commit780a3211d2b7a098455a6d8ec00067e6958119ba (patch)
tree1a8922d6e23fa3141dc8555de17a7cc8bc59c6ee
parent0630ea05003e6c530b9dde889e8296b12e67e41b (diff)
downloadqpid-python-780a3211d2b7a098455a6d8ec00067e6958119ba.tar.gz
QPID-5330: Simplify testing for presence of python testing code -
this makes it much easier not to call the python testing code when it isn't available git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1541241 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/tests/CMakeLists.txt20
-rwxr-xr-xqpid/cpp/src/tests/ipv6_test42
-rw-r--r--qpid/cpp/src/tests/legacystore/CMakeLists.txt2
-rwxr-xr-xqpid/cpp/src/tests/legacystore/run_python_tests5
-rwxr-xr-xqpid/cpp/src/tests/python_tests4
-rwxr-xr-xqpid/cpp/src/tests/run_header_test12
-rwxr-xr-xqpid/cpp/src/tests/run_msg_group_tests6
-rwxr-xr-xqpid/cpp/src/tests/run_queue_flow_limit_tests5
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed6
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex14
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_link27
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_queue27
-rwxr-xr-xqpid/cpp/src/tests/sasl_fed_ex_route27
-rwxr-xr-xqpid/cpp/src/tests/sasl_no_dir116
-rwxr-xr-xqpid/cpp/src/tests/ssl_test5
-rwxr-xr-xqpid/cpp/src/tests/swig_python_tests6
-rw-r--r--qpid/cpp/src/tests/test_env.sh.in4
-rw-r--r--[-rwxr-xr-x]qpid/cpp/src/tests/test_env_common.sh (renamed from qpid/cpp/src/tests/sasl_fed_ex_dynamic)15
18 files changed, 78 insertions, 265 deletions
diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt
index 4a735c00f2..e4fa9bbd3d 100644
--- a/qpid/cpp/src/tests/CMakeLists.txt
+++ b/qpid/cpp/src/tests/CMakeLists.txt
@@ -303,19 +303,23 @@ endif (BUILD_SASL)
# This should ideally be done as part of the test run, but I don't know a way
# to get these arguments and the working directory set like Makefile.am does,
# and have that run during the test pass.
+#
+# Need to check to see that the python tools are included as part of the source
+# tree first and don't install them or run dependent tests if they are not there
+#
set (python_bld ${CMAKE_CURRENT_BINARY_DIR}/python)
execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install --prefix=${pythoon_bld} --install-lib=${python_bld} --install-scripts=${python_bld}/commands
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../python)
if (BUILD_SASL)
- add_test (sasl_fed ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed${test_script_suffix})
- add_test (sasl_fed_ex_dynamic ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex_dynamic${test_script_suffix})
- add_test (sasl_fed_ex_link ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex_link${test_script_suffix})
- add_test (sasl_fed_ex_queue ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex_queue${test_script_suffix})
- add_test (sasl_fed_ex_route ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex_route${test_script_suffix})
- add_test (sasl_no_dir ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/sasl_no_dir${test_script_suffix})
+ add_test (sasl_fed ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed${test_script_suffix})
+ add_test (sasl_fed_ex_dynamic ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} dynamic)
+ add_test (sasl_fed_ex_link ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} link)
+ add_test (sasl_fed_ex_queue ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} queue)
+ add_test (sasl_fed_ex_route ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed_ex${test_script_suffix} route)
+ add_test (sasl_no_dir ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_no_dir${test_script_suffix})
if (BUILD_SSL)
- add_test(ssl_test ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/ssl_test${test_script_suffix})
+ add_test(ssl_test ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/ssl_test${test_script_suffix})
endif (BUILD_SSL)
endif (BUILD_SASL)
add_test (qpid-client-test ${test_wrap} --start-broker -- ${qpid-client-test_LOCATION})
@@ -335,7 +339,7 @@ if (BUILD_AMQP)
add_test (interlink_tests ${python_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/interlink_tests.py)
endif (BUILD_AMQP)
add_test (swig_python_tests ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/swig_python_tests${test_script_suffix})
-add_test (ipv6_test ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/ipv6_test${test_script_suffix})
+add_test (ipv6_test ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/ipv6_test${test_script_suffix})
add_test (federation_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_federation_tests${test_script_suffix})
add_test (federation_sys_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_federation_sys_tests${test_script_suffix})
add_test (queue_flow_limit_tests
diff --git a/qpid/cpp/src/tests/ipv6_test b/qpid/cpp/src/tests/ipv6_test
index 18bb34daa6..b7244434b2 100755
--- a/qpid/cpp/src/tests/ipv6_test
+++ b/qpid/cpp/src/tests/ipv6_test
@@ -33,7 +33,7 @@ fi
# Run a simple test over IPv6
-source ./test_env.sh
+source $QPID_TEST_COMMON
CONFIG=$(dirname $0)/config.null
TEST_HOSTNAME=::1
@@ -95,30 +95,26 @@ stop_brokers
# Start 2 brokers
# In a distribution, the python tools will be absent.
-if [ ! -f $QPID_CONFIG_EXEC ] || [ ! -f $QPID_ROUTE_EXEC ] ; then
- echo "python tools absent - skipping federation test."
-else
+ensure_python_tests
- start_brokers 2
- echo "Started Federated brokers on ports ${PORTS[*]}"
- # Make broker urls
- BROKER0="[::1]:${PORTS[0]}"
- BROKER1="[::1]:${PORTS[1]}"
- TEST_QUEUE=ipv6-fed-test
+start_brokers 2
+echo "Started Federated brokers on ports ${PORTS[*]}"
+# Make broker urls
+BROKER0="[::1]:${PORTS[0]}"
+BROKER1="[::1]:${PORTS[1]}"
+TEST_QUEUE=ipv6-fed-test
- $QPID_CONFIG_EXEC -b $BROKER0 add queue $TEST_QUEUE
- $QPID_CONFIG_EXEC -b $BROKER1 add queue $TEST_QUEUE
- $QPID_ROUTE_EXEC dynamic add $BROKER1 $BROKER0 amq.direct
- $QPID_CONFIG_EXEC -b $BROKER1 bind amq.direct $TEST_QUEUE $TEST_QUEUE
- $QPID_ROUTE_EXEC route map $BROKER1
+$QPID_CONFIG_EXEC -b $BROKER0 add queue $TEST_QUEUE
+$QPID_CONFIG_EXEC -b $BROKER1 add queue $TEST_QUEUE
+$QPID_ROUTE_EXEC dynamic add $BROKER1 $BROKER0 amq.direct
+$QPID_CONFIG_EXEC -b $BROKER1 bind amq.direct $TEST_QUEUE $TEST_QUEUE
+$QPID_ROUTE_EXEC route map $BROKER1
- ./datagen --count 100 | tee rdata-in |
- ./qpid-send -b amqp:$BROKER0 -a amq.direct/$TEST_QUEUE --content-stdin
- ./qpid-receive -b amqp:$BROKER1 -a $TEST_QUEUE --print-content yes -m 0 > rdata-out
+./datagen --count 100 | tee rdata-in |
+ ./qpid-send -b amqp:$BROKER0 -a amq.direct/$TEST_QUEUE --content-stdin
+./qpid-receive -b amqp:$BROKER1 -a $TEST_QUEUE --print-content yes -m 0 > rdata-out
- cmp rdata-in rdata-out || { echo "Federated data over IPv6 does not compare"; exit 1; }
-
- stop_brokers
- rm rdata-in rdata-out
-fi
+cmp rdata-in rdata-out || { echo "Federated data over IPv6 does not compare"; exit 1; }
+stop_brokers
+rm rdata-in rdata-out
diff --git a/qpid/cpp/src/tests/legacystore/CMakeLists.txt b/qpid/cpp/src/tests/legacystore/CMakeLists.txt
index 3ad02ac548..85cc4be5c7 100644
--- a/qpid/cpp/src/tests/legacystore/CMakeLists.txt
+++ b/qpid/cpp/src/tests/legacystore/CMakeLists.txt
@@ -152,6 +152,6 @@ target_link_libraries (jtt
add_test(journal_jtt ${CMAKE_CURRENT_BINARY_DIR}/jtt -c ${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt/jtt.csv)
-add_test (legacystore_python_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix})
+add_test (legacystore_python_tests ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix})
endif (BUILD_LEGACYSTORE AND BUILD_TESTING)
diff --git a/qpid/cpp/src/tests/legacystore/run_python_tests b/qpid/cpp/src/tests/legacystore/run_python_tests
index 130dee05f8..79dbd35da5 100755
--- a/qpid/cpp/src/tests/legacystore/run_python_tests
+++ b/qpid/cpp/src/tests/legacystore/run_python_tests
@@ -18,7 +18,9 @@
# under the License.
#
-source ../test_env.sh
+source $QPID_TEST_COMMON
+
+ensure_python_tests
#Add our directory to the python path
export PYTHONPATH=$srcdir/legacystore:$PYTHONPATH
@@ -27,7 +29,6 @@ MODULENAME=python_tests
echo "Running Python tests in module ${MODULENAME}..."
-test -d $PYTHON_DIR || { echo "Skipping python tests, no python dir."; exit 0; }
QPID_PORT=${QPID_PORT:-5672}
FAILING=${FAILING:-/dev/null}
PYTHON_TESTS=${PYTHON_TESTS:-$*}
diff --git a/qpid/cpp/src/tests/python_tests b/qpid/cpp/src/tests/python_tests
index 0216b5ca7b..3cdf7725f4 100755
--- a/qpid/cpp/src/tests/python_tests
+++ b/qpid/cpp/src/tests/python_tests
@@ -20,8 +20,8 @@
#
# Run the python tests.
-source ./test_env.sh
-test -d $PYTHON_DIR || { echo "Skipping python tests, no python dir."; exit 0; }
+source $QPID_TEST_COMMON
+ensure_python_tests
QPID_PORT=${QPID_PORT:-5672}
PYTHON_TESTS=${PYTHON_TESTS:-$*}
FAILING=${FAILING:-/dev/null}
diff --git a/qpid/cpp/src/tests/run_header_test b/qpid/cpp/src/tests/run_header_test
index 53b31026d5..a557ee49e9 100755
--- a/qpid/cpp/src/tests/run_header_test
+++ b/qpid/cpp/src/tests/run_header_test
@@ -23,9 +23,9 @@
# TODO: this should be expanded to cover a wider set of types and go
# in both directions
-if test -d ${PYTHON_DIR} ; then
- ./header_test -p $QPID_PORT
- $srcdir/header_test.py "localhost" $QPID_PORT
-else
- echo "Skipping header test as python libs not found"
-fi
+source $QPID_TEST_COMMON
+
+ensure_python_testing
+
+./header_test -p $QPID_PORT
+$srcdir/header_test.py "localhost" $QPID_PORT
diff --git a/qpid/cpp/src/tests/run_msg_group_tests b/qpid/cpp/src/tests/run_msg_group_tests
index abbafe7592..4b2332896b 100755
--- a/qpid/cpp/src/tests/run_msg_group_tests
+++ b/qpid/cpp/src/tests/run_msg_group_tests
@@ -20,7 +20,9 @@
#
#script to run a sequence of message group queue tests via make
-test -d $PYTHON_DIR || { echo "Skipping message group tests, no python dir."; exit 0; }
+source $QPID_TEST_COMMON
+
+ensure_python_tests
QUEUE_NAME="group-queue"
GROUP_KEY="My-Group-Id"
@@ -28,7 +30,7 @@ GROUP_KEY="My-Group-Id"
BROKER_URL="${QPID_BROKER:-localhost}:${QPID_PORT:-5672}"
run_test() {
- $@
+ "$@"
}
##set -x
diff --git a/qpid/cpp/src/tests/run_queue_flow_limit_tests b/qpid/cpp/src/tests/run_queue_flow_limit_tests
index 4ba6f17dac..6dbc48098e 100755
--- a/qpid/cpp/src/tests/run_queue_flow_limit_tests
+++ b/qpid/cpp/src/tests/run_queue_flow_limit_tests
@@ -19,6 +19,9 @@
# under the License.
#
-# Run tests against Queue producer flow control.
+source $QPID_TEST_COMMON
+
+ensure_python_tests
+# Run tests against Queue producer flow control.
$QPID_PYTHON_TEST -m queue_flow_limit_tests $SKIPTESTS -b localhost:$QPID_PORT
diff --git a/qpid/cpp/src/tests/sasl_fed b/qpid/cpp/src/tests/sasl_fed
index a92ccd7b7a..48e5b4b40d 100755
--- a/qpid/cpp/src/tests/sasl_fed
+++ b/qpid/cpp/src/tests/sasl_fed
@@ -19,8 +19,6 @@
# under the License.
#
-source ./test_env.sh
-
# This minimum value corresponds to sasl version 2.1.22
minimum_sasl_version=131350
@@ -40,7 +38,7 @@ if [ ! -f $QPID_CONFIG_EXEC ] || [ ! -f $QPID_ROUTE_EXEC ] ; then
fi
-sasl_config_file=$builddir/sasl_config
+sasl_config_file=$QPID_TEST_EXEC_DIR/sasl_config
my_random_number=$RANDOM
tmp_root=/tmp/sasl_fed_$my_random_number
@@ -128,7 +126,7 @@ n_messages=100
#--------------------------------------------------
#echo " Sending 100 messages to $broker_1_port "
#--------------------------------------------------
-$builddir/datagen --count $n_messages | $SENDER_EXEC --mechanism DIGEST-MD5 --username zag --password zag --exchange $EXCHANGE_NAME --routing-key $ROUTING_KEY --port $broker_1_port
+$QPID_TEST_EXEC_DIR/datagen --count $n_messages | $SENDER_EXEC --mechanism DIGEST-MD5 --username zag --password zag --exchange $EXCHANGE_NAME --routing-key $ROUTING_KEY --port $broker_1_port
sleep 5
diff --git a/qpid/cpp/src/tests/sasl_fed_ex b/qpid/cpp/src/tests/sasl_fed_ex
index d4d5258aa8..01791bcf2c 100755
--- a/qpid/cpp/src/tests/sasl_fed_ex
+++ b/qpid/cpp/src/tests/sasl_fed_ex
@@ -25,7 +25,9 @@
# transport-layer security.
#===============================================================================
-source ./test_env.sh
+source $QPID_TEST_COMMON
+
+ensure_python_tests
script_name=`basename $0`
@@ -65,12 +67,6 @@ if [ "$sasl_version" -lt "$minimum_sasl_version" ]; then
exit 0
fi
-# In a distribution, the python tools will be absent.
-if [ ! -f $QPID_CONFIG_EXEC ] || [ ! -f $QPID_ROUTE_EXEC ] ; then
- echo "python tools absent - skipping sasl_fed_ex."
- exit 0
-fi
-
CERT_DIR=`pwd`/test_cert_db
CERT_PW_FILE=`pwd`/cert.password
TEST_HOSTNAME=127.0.0.1
@@ -103,9 +99,9 @@ if [ ! $? ]; then
exit 1
fi
-sasl_config_dir=$builddir/sasl_config
+sasl_config_dir=$QPID_TEST_EXEC_DIR/sasl_config
-tmp_root=${builddir}/sasl_fed_ex_temp
+tmp_root=$QPID_TEST_EXEC_DIR/sasl_fed_ex_temp
print "results dir is ${tmp_root}"
rm -rf ${tmp_root}
mkdir -p $tmp_root
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_link b/qpid/cpp/src/tests/sasl_fed_ex_link
deleted file mode 100755
index 7b232d4874..0000000000
--- a/qpid/cpp/src/tests/sasl_fed_ex_link
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/bash
-
-#
-# 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.
-#
-
-
-source ./test_env.sh
-
-${srcdir}/sasl_fed_ex link
-
-
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_queue b/qpid/cpp/src/tests/sasl_fed_ex_queue
deleted file mode 100755
index be0c10cf63..0000000000
--- a/qpid/cpp/src/tests/sasl_fed_ex_queue
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/bash
-
-#
-# 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.
-#
-
-
-source ./test_env.sh
-
-${srcdir}/sasl_fed_ex queue
-
-
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_route b/qpid/cpp/src/tests/sasl_fed_ex_route
deleted file mode 100755
index dd5c4f3cac..0000000000
--- a/qpid/cpp/src/tests/sasl_fed_ex_route
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/bash
-
-#
-# 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.
-#
-
-
-source ./test_env.sh
-
-${srcdir}/sasl_fed_ex route
-
-
diff --git a/qpid/cpp/src/tests/sasl_no_dir b/qpid/cpp/src/tests/sasl_no_dir
index 5d657deb3a..4d3863fa26 100755
--- a/qpid/cpp/src/tests/sasl_no_dir
+++ b/qpid/cpp/src/tests/sasl_no_dir
@@ -19,14 +19,12 @@
# under the License.
#
-source ./test_env.sh
-
script_name=`basename $0`
# This minimum value corresponds to sasl version 2.1.22
minimum_sasl_version=131350
-sasl_version=`$QPID_TEST_EXEC_DIR/sasl_version`
+sasl_version=$($QPID_TEST_EXEC_DIR/sasl_version)
# This test is necessary because this sasl version is the first one that permits
# redirection of the sasl config file path.
@@ -36,7 +34,7 @@ if [ "$sasl_version" -lt "$minimum_sasl_version" ]; then
fi
-sasl_config_dir=$builddir/sasl_config
+sasl_config_dir=$QPID_TEST_EXEC_DIR/sasl_config
# Debugging print. --------------------------
@@ -106,113 +104,3 @@ rm -rf $tmp_root
print "result: fail"
exit 1
-
-#! /bin/bash
-
-#
-# 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.
-#
-
-source ./test_env.sh
-
-script_name=`basename $0`
-
-# This minimum value corresponds to sasl version 2.1.22
-minimum_sasl_version=131350
-
-sasl_version=`$QPID_TEST_EXEC_DIR/sasl_version`
-
-# This test is necessary because this sasl version is the first one that permits
-# redirection of the sasl config file path.
-if [ "$sasl_version" -lt "$minimum_sasl_version" ]; then
- echo "sasl_fed: must have sasl version 2.1.22 or greater. ( Integer value: $minimum_sasl_version ) Version is: $sasl_version"
- exit 0
-fi
-
-
-sasl_config_dir=$builddir/sasl_config
-
-
-# Debugging print. --------------------------
-debug=
-function print {
- if [ "$debug" ]; then
- echo "${script_name}: $1"
- fi
-}
-
-
-my_random_number=$RANDOM
-tmp_root=/tmp/sasl_fed_$my_random_number
-mkdir -p $tmp_root
-
-
-LOG_FILE=$tmp_root/qpidd.log
-
-# If you want to see this test fail, just comment out this 'mv' command.
-print "Moving sasl configuration dir."
-mv ${sasl_config_dir} ${sasl_config_dir}-
-
-
-#--------------------------------------------------
-print " Starting broker"
-#--------------------------------------------------
-$QPIDD_EXEC \
- -p 0 \
- --no-data-dir \
- --auth=yes \
- --mgmt-enable=yes \
- --log-enable info+ \
- --log-source yes \
- --log-to-file ${LOG_FILE} \
- --sasl-config=$sasl_config_dir \
- -d 2> /dev/null 1> $tmp_root/broker_port
-
-
-
-# If it works right, the output will look something like this: ( two lines long )
-# Daemon startup failed: SASL: sasl_set_path failed: no such directory: /home/mick/trunk/qpid/cpp/src/tests/sasl_config (qpid/broker/SaslAuthenticator.cpp:112)
-# 2011-10-13 14:07:00 critical qpidd.cpp:83: Unexpected error: Daemon startup failed: SASL: sasl_set_path failed: no such directory: /home/mick/trunk/qpid/cpp/src/tests/sasl_config (qpid/broker/SaslAuthenticator.cpp:112)
-
-result=`cat ${LOG_FILE} | grep "sasl_set_path failed: no such directory" | wc -l `
-
-#--------------------------------------------------
-print "Restore the Sasl config dir to its original place."
-#--------------------------------------------------
-mv ${sasl_config_dir}- ${sasl_config_dir}
-
-if [ "2" -eq ${result} ]; then
- print "result: success"
- rm -rf $tmp_root
- exit 0
-fi
-
-
-# If this test fails, the broker is still alive.
-# Kill it.
-broker_port=`cat $tmp_root/broker_port`
-#--------------------------------------------------
-print "Asking broker to quit."
-#--------------------------------------------------
-$QPIDD_EXEC --port $broker_port --quit
-
-rm -rf $tmp_root
-
-print "result: fail"
-exit 1
-
diff --git a/qpid/cpp/src/tests/ssl_test b/qpid/cpp/src/tests/ssl_test
index 7f722361b3..da9b073d39 100755
--- a/qpid/cpp/src/tests/ssl_test
+++ b/qpid/cpp/src/tests/ssl_test
@@ -20,7 +20,6 @@
#
# Run a simple test over SSL
-source ./test_env.sh
#set -x
@@ -33,7 +32,7 @@ TEST_CLIENT_CERT=rumplestiltskin
CA_PEM_FILE=${TEST_CERT_DIR}/ca_cert.pem
OTHER_CA_CERT_DB=${TEST_CERT_DIR}/x_ca_cert_db
OTHER_CA_PEM_FILE=${TEST_CERT_DIR}/other_ca_cert.pem
-PY_PING_BROKER=$top_srcdir/src/tests/ping_broker
+PY_PING_BROKER=${QPID_TEST_SRC_DIR}/ping_broker
COUNT=10
trap cleanup EXIT
@@ -144,7 +143,7 @@ start_ssl_mux_broker() {
PORTS=( ${PORTS[@]} $1 )
}
-sasl_config_dir=$builddir/sasl_config
+sasl_config_dir=$QPID_TEST_EXEC_DIR/sasl_config
start_authenticating_broker() {
start_brokers 1 "--transport ssl --ssl-port 0 --require-encryption --ssl-sasl-no-dict --ssl-require-client-authentication --auth yes --sasl-config=${sasl_config_dir}"
diff --git a/qpid/cpp/src/tests/swig_python_tests b/qpid/cpp/src/tests/swig_python_tests
index 2eb8ce67b3..1815372863 100755
--- a/qpid/cpp/src/tests/swig_python_tests
+++ b/qpid/cpp/src/tests/swig_python_tests
@@ -20,7 +20,10 @@
#
# Run the python tests.
-source ./test_env.sh
+source $QPID_TEST_COMMON
+
+ensure_python_tests
+
trap stop_broker INT TERM QUIT
if [[ -a $AMQP_LIB ]] ; then
@@ -43,7 +46,6 @@ stop_broker() {
$QPIDD_EXEC -q --port $QPID_PORT
}
-test -d $PYTHON_DIR || skip "no python dir"
test -f $PYTHONSWIGMODULE || skip "no swigged python client"
start_broker
diff --git a/qpid/cpp/src/tests/test_env.sh.in b/qpid/cpp/src/tests/test_env.sh.in
index a16812ca6c..df410ec188 100644
--- a/qpid/cpp/src/tests/test_env.sh.in
+++ b/qpid/cpp/src/tests/test_env.sh.in
@@ -61,6 +61,7 @@ export QPIDD_EXEC=$top_builddir/src/qpidd
# Test executables
export QPID_TEST_EXEC_DIR=$builddir
+export QPID_TEST_SRC_DIR=$srcdir
export RECEIVER_EXEC=$QPID_TEST_EXEC_DIR/receiver
export SENDER_EXEC=$QPID_TEST_EXEC_DIR/sender
@@ -90,3 +91,6 @@ fi
# Options for boost test framework
test -z "$BOOST_TEST_SHOW_PROGRESS" && export BOOST_TEST_SHOW_PROGRESS=yes
test -z "$BOOST_TEST_CATCH_SYSTEM_ERRORS" && export BOOST_TEST_CATCH_SYSTEM_ERRORS=no
+
+# Source this for useful common testing functions
+export QPID_TEST_COMMON=$srcdir/test_env_common.sh
diff --git a/qpid/cpp/src/tests/sasl_fed_ex_dynamic b/qpid/cpp/src/tests/test_env_common.sh
index c20b8d69a0..038b6da85c 100755..100644
--- a/qpid/cpp/src/tests/sasl_fed_ex_dynamic
+++ b/qpid/cpp/src/tests/test_env_common.sh
@@ -1,6 +1,5 @@
-#! /bin/bash
+#!/bin/bash
-#
# 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
@@ -19,9 +18,11 @@
# under the License.
#
-
-source ./test_env.sh
-
-${srcdir}/sasl_fed_ex dynamic
-
+# Ensure that we have python testing tools available
+function ensure_python_tests {
+ if [ ! -d ${PYTHON_DIR} ] ; then
+ echo "Python test code not found: skipping python based test"
+ exit 0;
+ fi
+}