Added: qpid/trunk/qpid/cpp/src/tests/run_ssl_tests
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_ssl_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_ssl_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_ssl_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,329 @@
+#!/usr/bin/env 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.
+#
+
+# Run a simple test over SSL
+
+source env.sh
+
+#set -x
+
+CONFIG=$(dirname $0)/qpidd-empty.conf
+TEST_CERT_DIR=`pwd`/test_cert_dir
+CERT_DB=${TEST_CERT_DIR}/test_cert_db
+CERT_PW_FILE=`pwd`/cert.password
+TEST_HOSTNAME=127.0.0.1
+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=$SOURCE_DIR/src/tests/ping_broker
+COUNT=10
+
+if [[ -a $AMQP_LIB ]] ; then
+    MODULES="--load-module $AMQP_LIB"
+fi
+
+trap cleanup EXIT
+
+error() { echo $*; exit 1; }
+
+# create the test certificate database
+#    $1 = string used as Subject in server's certificate
+#    $2 = string used as SubjectAlternateName (SAN) in server's certificate
+create_certs() {
+
+    local CERT_SUBJECT=${1:-"CN=${TEST_HOSTNAME},O=MyCo,ST=Massachusetts,C=US"}
+    local CERT_SAN=${2:-"*.server.com"}
+
+    mkdir -p ${TEST_CERT_DIR}
+    rm -rf ${TEST_CERT_DIR}/*
+
+    # Set Up a CA with a self-signed Certificate
+    #
+    mkdir -p ${CERT_DB}
+    certutil -N -d ${CERT_DB} -f ${CERT_PW_FILE}
+    certutil -S -d ${CERT_DB} -n "Test-CA" -s 
"CN=Test-CA,O=MyCo,ST=Massachusetts,C=US" -t "CT,," -x -f ${CERT_PW_FILE} -z 
/bin/sh >/dev/null 2>&1
+    certutil -L -d ${CERT_DB} -n "Test-CA" -a -o ${CERT_DB}/rootca.crt -f 
${CERT_PW_FILE}
+    #certutil -L -d ${CERT_DB} -f ${CERT_PW_FILE}
+
+    # create server certificate signed by Test-CA
+    #
+    certutil -R -d ${CERT_DB} -s "${CERT_SUBJECT}" -o 
${TEST_CERT_DIR}/server.req -f ${CERT_PW_FILE} -z /bin/sh > /dev/null 2>&1
+    certutil -C -d ${CERT_DB} -c "Test-CA" -8 "${CERT_SAN}" -i 
${TEST_CERT_DIR}/server.req -o ${TEST_CERT_DIR}/server.crt -f ${CERT_PW_FILE} 
-m ${RANDOM}
+    certutil -A -d ${CERT_DB} -n ${TEST_HOSTNAME} -i 
${TEST_CERT_DIR}/server.crt -t "Pu,,"
+
+    # create a certificate to identify the client
+    #
+    certutil -R -d ${CERT_DB} -s "CN=${TEST_CLIENT_CERT}" -o 
${TEST_CERT_DIR}/client.req -f ${CERT_PW_FILE} -z /bin/sh > /dev/null 2>&1
+    certutil -C -d ${CERT_DB} -c "Test-CA" -8 "*.client.com" -i 
${TEST_CERT_DIR}/client.req -o ${TEST_CERT_DIR}/client.crt -f ${CERT_PW_FILE} 
-m ${RANDOM}
+    certutil -A -d ${CERT_DB} -n ${TEST_CLIENT_CERT} -i 
${TEST_CERT_DIR}/client.crt -t "Pu,,"
+    ###
+    #certutil -N -d ${SERVER_CERT_DIR} -f ${CERT_PW_FILE}
+    #certutil -S -d ${SERVER_CERT_DIR} -n ${TEST_HOSTNAME} -s 
"CN=${TEST_HOSTNAME}" -t "CT,," -x -f ${CERT_PW_FILE} -z /usr/bin/certutil
+    #certutil -S -d ${SERVER_CERT_DIR} -n ${TEST_CLIENT_CERT} -s 
"CN=${TEST_CLIENT_CERT}" -t "CT,," -x -f ${CERT_PW_FILE} -z /usr/bin/certutil
+
+    # Set up a separate DB with its own CA for testing failure to validate 
scenario
+    #
+    mkdir -p ${OTHER_CA_CERT_DB}
+    certutil -N -d ${OTHER_CA_CERT_DB} -f ${CERT_PW_FILE}
+    certutil -S -d ${OTHER_CA_CERT_DB} -n "Other-Test-CA" -s "CN=Another Test 
CA,O=MyCo,ST=Massachusetts,C=US" -t "CT,," -x -f ${CERT_PW_FILE} -z /bin/sh 
>/dev/null 2>&1
+    certutil -L -d ${OTHER_CA_CERT_DB} -n "Other-Test-CA" -a -o 
${OTHER_CA_CERT_DB}/rootca.crt -f ${CERT_PW_FILE}
+    #certutil -L -d ${OTHER_CA_CERT_DB} -f ${CERT_PW_FILE}
+}
+
+delete_certs() {
+    if [[ -e ${TEST_CERT_DIR} ]] ;  then
+        rm -rf ${TEST_CERT_DIR}
+    fi
+}
+
+# Don't need --no-module-dir or --no-data-dir as they are set as env vars in 
env.sh
+COMMON_OPTS="--daemon --config $CONFIG --ssl-cert-db $CERT_DB 
--ssl-cert-password-file $CERT_PW_FILE --ssl-cert-name $TEST_HOSTNAME"
+
+# Start new brokers:
+#   $1 must be integer
+#   $2 = extra opts
+# Append used ports to PORTS variable
+start_brokers() {
+    local -a ports
+    for (( i=0; $i<$1; i++)) do
+    ports[$i]=$(qpidd --port 0 --interface 127.0.0.1 $COMMON_OPTS $2) || error 
"Could not start broker $i"
+    done
+    PORTS=( ${PORTS[@]} ${ports[@]} )
+}
+
+# Stop single broker:
+#   $1 is number of broker to stop (0 based)
+stop_broker() {
+    qpidd -qp ${PORTS[$1]}
+
+    # Remove from ports array
+    unset PORTS[$1]
+}
+
+stop_brokers() {
+    for port in "${PORTS[@]}";
+    do
+        qpidd -qp $port
+    done
+    PORTS=()
+}
+
+pick_port() {
+    # We need a fixed port to set --cluster-url. Use qpidd to pick a free port.
+    PICK=`qpidd --no-module-dir --listen-disable ssl -dp0`
+    qpidd --no-module-dir -qp $PICK
+    echo $PICK
+}
+
+cleanup() {
+    stop_brokers
+    delete_certs
+    rm -f ${CERT_PW_FILE}
+}
+
+start_ssl_broker() {
+    start_brokers 1 "--transport ssl --ssl-port 0 --require-encryption --auth 
no $MODULES"
+}
+
+start_ssl_mux_broker() {
+    qpidd $COMMON_OPTS --port $1 --ssl-port $1 --auth no
+    PORTS=( ${PORTS[@]} $1 )
+}
+
+sasl_config_dir=$BUILD_DIR/src/tests/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} $MODULES"
+}
+
+ssl_cluster_broker() {         # $1 = port
+    start_brokers 1 "--ssl-port $1 --auth no --load-module  $CLUSTER_LIB 
--cluster-name ssl_test.$HOSTNAME.$$ --cluster-url amqp:ssl:$TEST_HOSTNAME:$1"
+
+    # Wait for broker to be ready
+    qpid-ping -Pssl -b $TEST_HOSTNAME:$1 -q || { echo "Cannot connect to 
broker on $1"; exit 1; }
+}
+
+CERTUTIL=$(type -p certutil)
+if [[ !(-x $CERTUTIL) ]] ; then
+    echo "No certutil, skipping ssl test";
+    exit 0;
+fi
+
+if [[ !(-e ${CERT_PW_FILE}) ]] ;  then
+    echo password > ${CERT_PW_FILE}
+fi
+delete_certs
+create_certs || error "Could not create test certificate database"
+
+start_ssl_broker
+PORT=${PORTS[0]}
+echo "Running SSL test on port $PORT"
+export QPID_NO_MODULE_DIR=1
+export QPID_SSL_CERT_DB=${CERT_DB}
+export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE}
+
+## Test connection via connection settings
+qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary
+
+## Test connection with a URL
+URL=amqp:ssl:$TEST_HOSTNAME:$PORT
+qpid-send -b $URL --content-string=hello -a "foo;{create:always}"
+MSG=`qpid-receive -b $URL -a "foo;{create:always}" --messages 1`
+test "$MSG" = "hello" || { echo "receive failed '$MSG' != 'hello'"; exit 1; }
+
+if [[ -a $AMQP_LIB ]] ; then
+    echo "Testing ssl over AMQP 1.0"
+    qpid-send --connection-options '{protocol:amqp1.0}'  -b $URL 
--content-string=hello -a "foo;{create:always}"
+    MSG=`qpid-receive --connection-options '{protocol:amqp1.0}' -b $URL -a 
"foo;{create:always}" --messages 1`
+    test "$MSG" = "hello" || { echo "receive failed for AMQP 1.0 '$MSG' != 
'hello'"; exit 1; }
+fi
+
+## Test connection with a combination of URL and connection options (in 
messaging API)
+URL=$TEST_HOSTNAME:$PORT
+qpid-send -b $URL --connection-options '{transport:ssl,heartbeat:2}' 
--content-string='hello again' -a "foo;{create:always}"
+MSG=`qpid-receive -b $URL --connection-options '{transport:ssl,heartbeat:2}' 
-a "foo;{create:always}" --messages 1`
+test "$MSG" = "hello again" || { echo "receive failed '$MSG' != 'hello 
again'"; exit 1; }
+
+## Test using the Python client
+if test -d $PYTHON_DIR; then
+    echo "Testing Non-Authenticating with Python Client..."
+    URL=amqps://$TEST_HOSTNAME:$PORT
+    if `$PY_PING_BROKER -b $URL`; then echo "    Passed"; else { echo "    
Failed"; exit 1; }; fi
+else
+    echo "Skipping python part of ssl_test, no python dir."
+fi
+
+#### Client Authentication tests
+
+start_authenticating_broker
+PORT2=${PORTS[1]}
+echo "Running SSL client authentication test on port $PORT2"
+URL=amqp:ssl:$TEST_HOSTNAME:$PORT2
+
+## See if you can set the SSL cert-name for the connection
+qpid-send -b $URL --connection-options "{ssl-cert-name: $TEST_CLIENT_CERT }"  
--content-string=hello -a "bar;{create:always}"
+MSG2=`qpid-receive -b $URL  --connection-options "{ssl-cert-name: 
$TEST_CLIENT_CERT }" -a "bar;{create:always}" --messages 1`
+test "$MSG2" = "hello" || { echo "receive failed '$MSG2' != 'hello'"; exit 1; }
+
+## Make sure that connect fails with an invalid SSL cert-name
+qpid-send -b $URL --connection-options "{ssl-cert-name: pignose }" 
--content-string=hello -a "baz;{create:always}" 2>/dev/null 1>/dev/null
+MSG3=`qpid-receive -b $URL  --connection-options "{ssl-cert-name: pignose }" 
-a "baz;{create:always}" --messages 1 2>/dev/null`
+test "$MSG3" = "" || { echo "receive succeeded without valid ssl cert '$MSG3' 
!= ''"; exit 1; }
+
+stop_brokers
+
+# Test ssl muxed with plain TCP on the same connection
+
+# Test a specified port number - since tcp/ssl are the same port don't need to 
specify --transport ssl
+PORT=`pick_port`
+start_ssl_mux_broker $PORT || error "Could not start broker"
+echo "Running SSL/TCP mux test on fixed port $PORT"
+
+## Test connection via connection settings
+qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary || error "SSL connection failed!"
+qpid-perftest --count ${COUNT} --port ${PORT} -P tcp -b $TEST_HOSTNAME 
--summary || error "TCP connection failed!"
+
+# Test a broker chosen port - since ssl chooses port need to use --transport 
ssl here
+start_ssl_broker
+PORT=${PORTS[0]}
+echo "Running SSL/TCP mux test on random port $PORT"
+
+## Test connection via connection settings
+qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary || error "SSL connection failed!"
+qpid-perftest --count ${COUNT} --port ${PORT} -P tcp -b $TEST_HOSTNAME 
--summary || error "TCP connection failed!"
+
+stop_brokers
+
+### Additional tests that require 'openssl' and 'pk12util' to be installed 
(optional)
+
+PK12UTIL=$(type -p pk12util)
+if [[ !(-x $PK12UTIL) ]] ; then
+    echo >&2 "'pk12util' command not available, skipping remaining tests"
+    exit 0
+fi
+
+OPENSSL=$(type -p openssl)
+if [[ !(-x $OPENSSL) ]] ; then
+    echo >&2 "'openssl' command not available, skipping remaining tests"
+    exit 0
+fi
+
+## verify python version > 2.5 (only 2.6+ does certificate checking)
+PY_VERSION=$(python -c "import sys; print hex(sys.hexversion)")
+if (( PY_VERSION < 0x02060000 )); then
+    echo >&2 "Detected python version < 2.6 - skipping certificate 
verification tests"
+    exit 0
+fi
+
+echo "Testing Certificate validation and Authentication with the Python 
Client..."
+
+# extract the CA's certificate as a PEM file
+get_ca_certs() {
+    $PK12UTIL -o ${TEST_CERT_DIR}/CA_pk12.out -d ${CERT_DB} -n "Test-CA"  -w 
${CERT_PW_FILE} -k ${CERT_PW_FILE} > /dev/null
+    $OPENSSL pkcs12 -in ${TEST_CERT_DIR}/CA_pk12.out -out ${CA_PEM_FILE} 
-nokeys -passin file:${CERT_PW_FILE} >/dev/null
+    $PK12UTIL -o ${TEST_CERT_DIR}/other_CA_pk12.out -d ${OTHER_CA_CERT_DB} -n 
"Other-Test-CA" -w ${CERT_PW_FILE} -k ${CERT_PW_FILE} > /dev/null
+    $OPENSSL pkcs12 -in ${TEST_CERT_DIR}/other_CA_pk12.out -out 
${OTHER_CA_PEM_FILE} -nokeys -passin file:${CERT_PW_FILE} >/dev/null
+}
+
+get_ca_certs || error "Could not extract CA certificates as PEM files"
+start_ssl_broker
+PORT=${PORTS[0]}
+URL=amqps://$TEST_HOSTNAME:$PORT
+# verify the python client can authenticate the broker using the CA
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then echo "    
Passed"; else { echo "    Failed"; exit 1; }; fi
+# verify the python client fails to authenticate the broker when using the 
other CA
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${OTHER_CA_PEM_FILE} > /dev/null 
2>&1`; then { echo "    Failed"; exit 1; }; else echo "    Passed"; fi
+stop_brokers
+
+# create a certificate without matching TEST_HOSTNAME, should fail to verify
+
+create_certs "O=MyCo" "*.${TEST_HOSTNAME}.com" || error "Could not create 
server test certificate"
+get_ca_certs || error "Could not extract CA certificates as PEM files"
+start_ssl_broker
+PORT=${PORTS[0]}
+URL=amqps://$TEST_HOSTNAME:$PORT
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE} > /dev/null 
2>&1`; then { echo "    Failed"; exit 1; }; else echo "    Passed"; fi
+# but disabling the check for the hostname should pass
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE} 
--ssl-skip-hostname-check`; then echo "    Passed"; else { echo "    Failed"; 
exit 1; }; fi
+stop_brokers
+
+# test SubjectAltName parsing
+
+if (( PY_VERSION >= 0x02070300 )); then
+# python 2.7.3+ supports SubjectAltName extraction
+# create a certificate with TEST_HOSTNAME only in SAN, should verify OK
+    create_certs "O=MyCo" "*.foo.com,${TEST_HOSTNAME},*xyz.com" || error 
"Could not create server test certificate"
+    get_ca_certs || error "Could not extract CA certificates as PEM files"
+    start_ssl_broker
+    PORT=${PORTS[0]}
+    URL=amqps://$TEST_HOSTNAME:$PORT
+    if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then echo " 
   Passed"; else { echo "    Failed"; exit 1; }; fi
+    stop_brokers
+
+    create_certs "O=MyCo" "*${TEST_HOSTNAME}" || error "Could not create 
server test certificate"
+    get_ca_certs || error "Could not extract CA certificates as PEM files"
+    start_ssl_broker
+    PORT=${PORTS[0]}
+    URL=amqps://$TEST_HOSTNAME:$PORT
+    if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then echo " 
   Passed"; else { echo "    Failed"; exit 1; }; fi
+    stop_brokers
+fi

Propchange: qpid/trunk/qpid/cpp/src/tests/run_ssl_tests
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/run_store_tests.ps1
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_store_tests.ps1?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_store_tests.ps1 (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_store_tests.ps1 Thu Apr 21 12:31:34 2016
@@ -31,7 +31,7 @@ if ($test_store -ne "MSSQL" -and $test_s
 
 $srcdir = Split-Path $myInvocation.InvocationName
 
-. .\test_env.ps1
+. .\env.ps1
 
 if (!(Test-Path $PYTHON_DIR -pathType Container)) {
     "Skipping store tests as python libs not found"

Added: qpid/trunk/qpid/cpp/src/tests/run_topic_tests
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_topic_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_topic_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_topic_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#
+# 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.
+#
+
+# Quick and quiet topic test for make test
+
+from common import *
+
+ENV["QPID_PORT"] = start_broker("broker")
+
+call_with_valgrind("topictest -s2 -m2 -b1")
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_topic_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_transaction_tests
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_transaction_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_transaction_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_transaction_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#
+# 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.
+#
+
+from common import *
+
+port1 = start_broker("broker1")
+port2 = start_broker("broker2")
+
+call_with_valgrind("qpid-txtest --queues 4 --tx-count 10 --quiet --port {}", 
port1)
+call_with_valgrind("qpid-txtest2 --queues 4 --tx-count 10 --quiet --port {}", 
port2)
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_transaction_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_unit_tests
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_unit_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_unit_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_unit_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+#
+# 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.
+#
+
+from common import *
+
+# Options for boost test framework
+
+if "BOOST_TEST_SHOW_PROGRESS" not in ENV:
+    ENV["BOOST_TEST_SHOW_PROGRESS"] = "yes"
+
+if "BOOST_TEST_CATCH_SYSTEM_ERRORS" not in ENV:
+    ENV["BOOST_TEST_CATCH_SYSTEM_ERRORS"] = "no"
+
+if WINDOWS:
+    ENV["QPID_SSL_CERT_STORE_LOCATION"] = "LocalMachine"
+    ENV["QPID_SSL_CERT_NAME"] = "localhost"
+    ENV["QPID_SSL_PORT"] = "0"
+    
+call_with_valgrind("unit_test")
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_unit_tests
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/sasl_fed
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/sasl_fed?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/sasl_fed (original)
+++ qpid/trunk/qpid/cpp/src/tests/sasl_fed Thu Apr 21 12:31:34 2016
@@ -19,69 +19,54 @@
 # under the License.
 #
 
-# This minimum value corresponds to sasl version 2.1.22
-minimum_sasl_version=131350
+set -eu
 
-sasl_version=`$QPID_TEST_EXEC_DIR/sasl_version`
-
-# This test is necessary becasue 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
-
-# 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."
-    exit 0
-fi
+WORK_DIR=$WORK_DIR/sasl_fed
+mkdir $WORK_DIR
 
+sasl_config_dir=$BUILD_DIR/src/tests/sasl_config
 
-sasl_config_file=$QPID_TEST_EXEC_DIR/sasl_config
+# Create ACL file to allow links
+echo acl allow all all > $WORK_DIR/sasl_fed.acl
 
-my_random_number=$RANDOM
-tmp_root=/tmp/sasl_fed_$my_random_number
-mkdir -p $tmp_root
+echo "Starting broker 1"
 
-# create ACL file to allow links
-echo acl allow all all > $tmp_root/sasl_fed.acl
-
-
-#--------------------------------------------------
-#echo " Starting broker 1"
-#--------------------------------------------------
-$QPIDD_EXEC                                  \
+qpidd                                        \
   -p 0  --interface 127.0.0.1                \
-  --data-dir $tmp_root/data_1                \
+  --data-dir $WORK_DIR/data_1                \
   --auth=yes                                 \
   --mgmt-enable=yes                          \
   --log-enable info+                         \
   --log-source yes                           \
-  --log-to-file $tmp_root/qpidd_1.log        \
-  --sasl-config=$sasl_config_file            \
-  --acl-file $tmp_root/sasl_fed.acl          \
-  -d > $tmp_root/broker_1_port
-
-broker_1_port=`cat $tmp_root/broker_1_port`
+  --log-to-file $WORK_DIR/qpidd_1.log        \
+  --sasl-config=$sasl_config_dir             \
+  --acl-file $WORK_DIR/sasl_fed.acl          \
+  -d > $WORK_DIR/broker_1_port
+
+broker_1_port=$(cat $WORK_DIR/broker_1_port)
 
+echo "Starting broker 2"
 
-#--------------------------------------------------
-#echo " Starting broker 2"
-#--------------------------------------------------
-$QPIDD_EXEC                                  \
+qpidd                                        \
   -p 0 --interface 127.0.0.1                 \
-  --data-dir $tmp_root/data_2                \
+  --data-dir $WORK_DIR/data_2                \
   --auth=yes                                 \
   --mgmt-enable=yes                          \
   --log-enable info+                         \
   --log-source yes                           \
-  --log-to-file $tmp_root/qpidd_2.log        \
-  --sasl-config=$sasl_config_file            \
-  --acl-file $tmp_root/sasl_fed.acl          \
-  -d > $tmp_root/broker_2_port
+  --log-to-file $WORK_DIR/qpidd_2.log        \
+  --sasl-config=$sasl_config_dir             \
+  --acl-file $WORK_DIR/sasl_fed.acl          \
+  -d > $WORK_DIR/broker_2_port
+
+broker_2_port=$(cat $WORK_DIR/broker_2_port)
+
+function stop_brokers {
+    qpidd --port $broker_1_port --quit
+    qpidd --port $broker_2_port --quit
+}
 
-broker_2_port=`cat $tmp_root/broker_2_port`
+trap stop_brokers EXIT
 
 sleep 2
 
@@ -90,80 +75,48 @@ QUEUE_NAME=sasl_fed_queue
 ROUTING_KEY=sasl_fed_queue
 EXCHANGE_NAME=sasl_fedex
 
-#--------------------------------------------------
-#echo "  add exchanges"
-#--------------------------------------------------
-$QPID_CONFIG_EXEC -b localhost:$broker_1_port add exchange direct 
$EXCHANGE_NAME
-$QPID_CONFIG_EXEC -b localhost:$broker_2_port add exchange direct 
$EXCHANGE_NAME
+echo "Adding exchanges"
 
+qpid-config -b localhost:$broker_1_port add exchange direct $EXCHANGE_NAME
+qpid-config -b localhost:$broker_2_port add exchange direct $EXCHANGE_NAME
 
-#--------------------------------------------------
-#echo "  add queues"
-#--------------------------------------------------
-$QPID_CONFIG_EXEC -b localhost:$broker_1_port add queue $QUEUE_NAME
-$QPID_CONFIG_EXEC -b localhost:$broker_2_port add queue $QUEUE_NAME
+echo "Adding queues"
+
+qpid-config -b localhost:$broker_1_port add queue $QUEUE_NAME
+qpid-config -b localhost:$broker_2_port add queue $QUEUE_NAME
 
 sleep 5
 
-#--------------------------------------------------
-#echo " create bindings"
-#--------------------------------------------------
-$QPID_CONFIG_EXEC -b localhost:$broker_1_port bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
-$QPID_CONFIG_EXEC -b localhost:$broker_2_port bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
+echo "Creating bindings"
+
+qpid-config -b localhost:$broker_1_port bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
+qpid-config -b localhost:$broker_2_port bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
 
 sleep 5
 
+echo "Adding routes"
 
-#--------------------------------------------------
-#echo "  qpid-route route add"
-#--------------------------------------------------
-$QPID_ROUTE_EXEC route add zag/zag@localhost:$broker_2_port 
zag/zag@localhost:$broker_1_port $EXCHANGE_NAME $ROUTING_KEY "" "" DIGEST-MD5
+qpid-route route add zag/zag@localhost:$broker_2_port 
zag/zag@localhost:$broker_1_port $EXCHANGE_NAME $ROUTING_KEY "" "" DIGEST-MD5
 
 sleep 5
 
-
 n_messages=100
-#--------------------------------------------------
-#echo "  Sending 100 messages to $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
+echo "Sending 100 messages to $broker_1_port "
 
-#--------------------------------------------------
-#echo "  Examine Broker $broker_1_port"
-#--------------------------------------------------
-broker_1_message_count=`$PYTHON_COMMANDS/qpid-stat -q -b 
localhost:$broker_1_port | grep sasl_fed_queue | awk '{print $2}'`
-#echo " "
-
-#--------------------------------------------------
-#echo "  Examine Broker $broker_2_port"
-#--------------------------------------------------
-broker_2_message_count=`$PYTHON_COMMANDS/qpid-stat -q -b 
localhost:$broker_2_port | grep sasl_fed_queue | awk '{print $2}'`
-#echo " "
-
-#--------------------------------------------------
-#echo "  Asking brokers to quit."
-#--------------------------------------------------
-$QPIDD_EXEC --port $broker_1_port --quit
-$QPIDD_EXEC --port $broker_2_port --quit
-
-
-#--------------------------------------------------
-#echo   "Removing temporary directory $tmp_root"
-#--------------------------------------------------
-rm -rf $tmp_root
-
-if [ "$broker_2_message_count" -eq  "$n_messages" ]; then
-  # echo "good: |$broker_2_message_count| == |$n_messages|"
-  exit 0
-else
-  # echo "not ideal: |$broker_1_message_count| != |$n_messages|"
-  exit 1
-fi
+datagen --count $n_messages | sender --mechanism DIGEST-MD5 --username zag 
--password zag --exchange $EXCHANGE_NAME --routing-key $ROUTING_KEY --port 
$broker_1_port
 
+sleep 5
 
+echo "Examining Broker $broker_1_port"
 
+broker_1_message_count=$(qpid-stat -q -b localhost:$broker_1_port | grep 
sasl_fed_queue | awk '{print $2}')
 
+echo "Examining Broker $broker_2_port"
 
+broker_2_message_count=$(qpid-stat -q -b localhost:$broker_2_port | grep 
sasl_fed_queue | awk '{print $2}')
 
+if (( $broker_2_message_count != $n_messages )); then
+    echo "Expected ${n_messages} and received ${broker_2_message_count}"
+    exit 1
+fi

Modified: qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex (original)
+++ qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex Thu Apr 21 12:31:34 2016
@@ -25,86 +25,47 @@
 # transport-layer security.
 
#===============================================================================
 
-source $QPID_TEST_COMMON
+set -eu
 
-ensure_python_tests
-
-script_name=`basename $0`
-
-if [ $# -lt 1 ] || [ $# -gt 2 ]
-then
-  echo
-  # These are the four different ways of creating links ( or routes+links ) 
-  # that the qpid-route command provides.
-  echo "Usage: ${script_name} dynamic|link|queue|route"
-  echo
-  exit 1
+if (( $# != 1 )); then
+    # These are the four different ways of creating links ( or routes+links ) 
+    # that the qpid-route command provides.
+    echo "Usage: $(basename $0) dynamic|link|queue|route"
+    exit 1
 fi
 
 qpid_route_method=$1
 
-# Debugging print. --------------------------
-debug=
-function print {
-  if [ "$debug" ]; then
-    echo "${script_name}: $1"
-  fi
-}
-
-print "=========== start sasl_fed_ex $* ============"
-
-
-
-# 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
+WORK_DIR="${WORK_DIR}/sasl_fed_ex_${qpid_route_method}"
+mkdir $WORK_DIR
 
-CERT_DIR=`pwd`/test_cert_db
-CERT_PW_FILE=`pwd`/cert.password
+CERT_DIR=$WORK_DIR/test_cert_db
+CERT_PW_FILE=$WORK_DIR/cert.password
 TEST_HOSTNAME=127.0.0.1
 
 create_certs() {
-    #create certificate and key databases with single, simple, self-signed 
certificate in it
+    # Create certificate and key databases with single, simple,
+    # self-signed certificate in it
     mkdir ${CERT_DIR}
     certutil -N -d ${CERT_DIR} -f ${CERT_PW_FILE}
     certutil -S -d ${CERT_DIR} -n ${TEST_HOSTNAME} -s "CN=${TEST_HOSTNAME}" -t 
"CT,," -x -f ${CERT_PW_FILE} -z /bin/sh 2> /dev/null
 }
 
-delete_certs() {
-    if [[ -e ${CERT_DIR} ]] ;  then
-        print "removing cert dir ${CERT_DIR}"
-        rm -rf ${CERT_DIR}
-    fi
-}
-
-
 CERTUTIL=$(type -p certutil)
-if [[ !(-x $CERTUTIL) ]] ; then
-    echo "No certutil, skipping ssl test";
-    exit 0;
+
+if [[ ! -x $CERTUTIL ]]; then
+    echo "No certutil, skipping ssl test"
+    exit 0
 fi
 
-delete_certs
 create_certs 2> /dev/null
-if [ ! $? ]; then
-  error "Could not create test certificate"
-  exit 1
-fi
 
-sasl_config_dir=$QPID_TEST_EXEC_DIR/sasl_config
+if (( $? != 0 )); then
+    echo "Could not create test certificate"
+    exit 1
+fi
 
-tmp_root=$QPID_TEST_EXEC_DIR/sasl_fed_ex_temp
-print "results dir is ${tmp_root}"
-rm -rf ${tmp_root}
-mkdir -p $tmp_root
+sasl_config_dir=$BUILD_DIR/src/tests/sasl_config
 
 SRC_SSL_PORT=6667
 DST_SSL_PORT=6666
@@ -125,8 +86,6 @@ export QPID_SSL_CERT_DB=${CERT_DIR}
 export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE}
 export QPID_SSL_CERT_NAME=${TEST_HOSTNAME}
 
-
-
 #######################################
 # Understanding this Plumbing
 #######################################
@@ -146,7 +105,7 @@ export QPID_SSL_CERT_NAME=${TEST_HOSTNAM
 
 COMMON_BROKER_OPTIONS="                          \
       --ssl-sasl-no-dict                         \
-      --sasl-config=$sasl_config_dir             \
+      --sasl-config $sasl_config_dir             \
       --ssl-require-client-authentication        \
       --auth yes                                 \
       --ssl-cert-db $CERT_DIR                    \
@@ -154,130 +113,111 @@ COMMON_BROKER_OPTIONS="
       --ssl-cert-name $TEST_HOSTNAME             \
       --no-data-dir                              \
       --no-module-dir                            \
-      --mgmt-enable=yes                          \
+      --mgmt-enable yes                          \
       --log-enable info+                         \
       --log-source yes                           \
-      --daemon "                                 
+      --daemon"                                 
                       
-
 function start_brokers {
     # vanilla brokers --------------------------------
-    print "Starting SRC broker"
-    $QPIDD_EXEC                                  \
+    echo "Starting SRC broker"
+    qpidd                                          \
        --port=${SRC_TCP_PORT}                     \
        --ssl-port ${SRC_SSL_PORT}                 \
        ${COMMON_BROKER_OPTIONS}                   \
-       --log-to-file $tmp_root/qpidd_src.log 2> /dev/null
+       --log-to-file $WORK_DIR/qpidd_src.log 2> /dev/null
 
     broker_ports[0]=${SRC_TCP_PORT}
 
-    print "Starting DST broker"
-    $QPIDD_EXEC                                  \
+    echo "Starting DST broker"
+    qpidd                                          \
        --port=${DST_TCP_PORT}                     \
        --ssl-port ${DST_SSL_PORT}                 \
        ${COMMON_BROKER_OPTIONS}                   \
-       --log-to-file $tmp_root/qpidd_dst.log 2> /dev/null
+       --log-to-file $WORK_DIR/qpidd_dst.log 2> /dev/null
 
     broker_ports[1]=${DST_TCP_PORT}
 }
 
 function halt_brokers {
-  n_brokers=${#broker_ports[@]}
-  print "Halting ${n_brokers} brokers."
-  for i in $(seq 0 $((${n_brokers} - 1)))
-  do
-    halt_port=${broker_ports[$i]}
-    print "Halting broker $i on port ${halt_port}"
-    $QPIDD_EXEC --port ${halt_port} --quit
-  done
-
+    n_brokers=${#broker_ports[@]}
+    echo "Halting ${n_brokers} brokers"
+    for i in $(seq 0 $((${n_brokers} - 1))); do
+        halt_port=${broker_ports[$i]}
+        echo "Halting broker $i on port ${halt_port}"
+        qpidd --port ${halt_port} --quit
+    done
 }
 
-
 start_brokers
-
+trap halt_brokers EXIT
 
 # I am not randomizing these names, because this test creates its own brokers.
 QUEUE_NAME=sasl_fed_queue
 ROUTING_KEY=sasl_fed_queue
 EXCHANGE_NAME=sasl_fedex
 
-
-print "add exchanges"
-$QPID_CONFIG_EXEC -b localhost:${SRC_TCP_PORT} add exchange direct 
$EXCHANGE_NAME
-$QPID_CONFIG_EXEC -b localhost:${DST_TCP_PORT} add exchange direct 
$EXCHANGE_NAME
-
-
-print "add queues"
-$QPID_CONFIG_EXEC -b localhost:${SRC_TCP_PORT} add queue $QUEUE_NAME
-$QPID_CONFIG_EXEC -b localhost:${DST_TCP_PORT} add queue $QUEUE_NAME
-
-
-print "create bindings"
-$QPID_CONFIG_EXEC -b localhost:${SRC_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
-$QPID_CONFIG_EXEC -b localhost:${DST_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
-
+echo "Add exchanges"
+qpid-config -b localhost:${SRC_TCP_PORT} add exchange direct $EXCHANGE_NAME
+qpid-config -b localhost:${DST_TCP_PORT} add exchange direct $EXCHANGE_NAME
+
+echo "Add queues"
+qpid-config -b localhost:${SRC_TCP_PORT} add queue $QUEUE_NAME
+qpid-config -b localhost:${DST_TCP_PORT} add queue $QUEUE_NAME
+
+echo "Create bindings"
+qpid-config -b localhost:${SRC_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
+qpid-config -b localhost:${DST_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME 
$ROUTING_KEY
 
 #
 # NOTE: The SRC broker *must* be referred to as $TEST_HOSTNAME, and not as 
"localhost".
 #       It must be referred to by the exact string given as the Common Name 
(CN) in the cert,
 #       which was created in the function create_certs, above.
 
-
-
 #----------------------------------------------------------------
 # Use qpid-route to create the link, or the link+route, depending
 # on which of its several methods was requested.
 #----------------------------------------------------------------
-if   [ ${qpid_route_method} == "dynamic" ]; then
-  print "dynamic add"
-  $QPID_ROUTE_EXEC -t ssl dynamic add localhost:${DST_TCP_PORT} 
$TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME "" "" EXTERNAL
-elif [ ${qpid_route_method} == "link"   ];  then
-  print "link add"
-  $QPID_ROUTE_EXEC -t ssl link add localhost:${DST_TCP_PORT} 
$TEST_HOSTNAME:${SRC_SSL_PORT}  EXTERNAL
-elif [ ${qpid_route_method} == "queue" ];   then
-  print "queue add"
-  $QPID_ROUTE_EXEC -t ssl queue add localhost:${DST_TCP_PORT}   
$TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME $ROUTING_KEY EXTERNAL
-elif [ ${qpid_route_method} == "route" ];   then
-  print "route add"
-  $QPID_ROUTE_EXEC -t ssl route add localhost:${DST_TCP_PORT}   
$TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME $ROUTING_KEY "" "" EXTERNAL
+if   [[ $qpid_route_method == "dynamic" ]]; then
+    echo "Dynamic add"
+    qpid-route -t ssl dynamic add localhost:${DST_TCP_PORT} 
$TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME "" "" EXTERNAL || :
+elif [[ $qpid_route_method == "link"    ]];  then
+    echo "Link add"
+    qpid-route -t ssl link add localhost:${DST_TCP_PORT}    
$TEST_HOSTNAME:${SRC_SSL_PORT} EXTERNAL || :
+elif [[ $qpid_route_method == "queue"   ]];   then
+    echo "Queue add"
+    qpid-route -t ssl queue add localhost:${DST_TCP_PORT}   
$TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME $ROUTING_KEY EXTERNAL || :
+elif [[ $qpid_route_method == "route"   ]];   then
+    echo "Route add"
+    qpid-route -t ssl route add localhost:${DST_TCP_PORT}   
$TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME $ROUTING_KEY "" "" EXTERNAL || :
 else
-  echo "unknown method: |${qpid_route_method}|"
-  echo " choices are: dynamic|link|queue|route "
-  halt_brokers
-  exit 1
+    echo "Unknown method: |${qpid_route_method}|"
+    echo "Choices are: dynamic|link|queue|route "
+    halt_brokers
+    exit 1
 fi
 
-
 # I don't know how to avoid this sleep yet.  It has to come after 
route-creation 
 # to avoid false negatives.
 sleep 5
 
 # Look only at the transport field, which should be "ssl".
-print "check the link"
-link_status=$($QPID_ROUTE_EXEC link list localhost:${DST_TCP_PORT} | tail -1 | 
awk '{print $3}')
-
-halt_brokers
+echo "Check the link"
+link_status=$(qpid-route link list localhost:${DST_TCP_PORT} | tail -1 | awk 
'{print $3}')
 
 sleep 1
 
-if [ ! ${link_status} ]; then
-  print "link_status is empty"
-  print "result: fail"
-  exit 2
+if [[ ! $link_status ]]; then
+    echo "Link status is empty"
+    echo "Result: fail"
+    exit 2
 fi
 
-if [ ${link_status} == "ssl" ]; then
-  print "result: good"
-  # Only remove the tmp_root on success, to permit debugging.
-  print "Removing temporary directory $tmp_root"
-  rm -rf $tmp_root
-  exit 0
+if [[ $link_status == "ssl" ]]; then
+    echo "Result: good"
+    exit 0
 fi
 
-print "link_status has a bad value: ${link_status}"
-print "result: fail"
+echo "Link status has a bad value: ${link_status}"
+echo "Result: fail"
 exit 3
-
-
-

Modified: qpid/trunk/qpid/cpp/src/tests/sasl_no_dir
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/sasl_no_dir?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/sasl_no_dir (original)
+++ qpid/trunk/qpid/cpp/src/tests/sasl_no_dir Thu Apr 21 12:31:34 2016
@@ -19,88 +19,40 @@
 # under the License.
 #
 
-script_name=`basename $0`
+set -eu
 
-# This minimum value corresponds to sasl version 2.1.22
-minimum_sasl_version=131350
+sasl_config_dir=$BUILD_DIR/not_there_at_all
 
-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=$QPID_TEST_EXEC_DIR/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  --interface 127.0.0.1                \
-  --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
+WORK_DIR=$WORK_DIR/sasl_no_dir
+mkdir $WORK_DIR
 
+LOG_FILE=$WORK_DIR/qpidd.log
 
+echo "Starting broker"
+qpidd                                          \
+    -p 0  --interface 127.0.0.1                \
+    --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> $WORK_DIR/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 `
+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
+if (( $result == 2 )); then
+    echo "Result: success"
+    exit 0
 fi
 
+broker_port=$(cat $WORK_DIR/broker_port)
+qpidd --port ${broker_port} --quit
 
-# 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"
+echo "Result: fail"
 exit 1

Modified: qpid/trunk/qpid/cpp/src/tests/sasl_test_setup.sh
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/sasl_test_setup.sh?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/sasl_test_setup.sh (original)
+++ qpid/trunk/qpid/cpp/src/tests/sasl_test_setup.sh Thu Apr 21 12:31:34 2016
@@ -18,9 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-source ./test_env.sh
 
-test -x $SASL_PW || { echo Skipping SASL test, saslpasswd2 not found; exit 0; }
+source env.sh
+
+test -x $SASLPASSWD2 || { echo Skipping SASL test, saslpasswd2 not found; exit 
0; }
 
 mkdir -p sasl_config
 
@@ -36,7 +37,7 @@ EOF
 # Populate temporary sasl db.
 SASLTEST_DB=./sasl_config/qpidd.sasldb
 rm -f $SASLTEST_DB
-echo guest | $SASL_PW -c -p -f $SASLTEST_DB -u QPID guest
-echo zig | $SASL_PW -c -p -f $SASLTEST_DB -u QPID zig
-echo zag | $SASL_PW -c -p -f $SASLTEST_DB -u QPID zag
+echo guest | $SASLPASSWD2 -c -p -f $SASLTEST_DB -u QPID guest
+echo zig | $SASLPASSWD2 -c -p -f $SASLTEST_DB -u QPID zig
+echo zag | $SASLPASSWD2 -c -p -f $SASLTEST_DB -u QPID zag
 

Modified: qpid/trunk/qpid/cpp/src/tests/ssl_test
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ssl_test?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ssl_test (original)
+++ qpid/trunk/qpid/cpp/src/tests/ssl_test Thu Apr 21 12:31:34 2016
@@ -21,9 +21,11 @@
 
 # Run a simple test over SSL
 
+source env.sh
+
 #set -x
 
-CONFIG=$(dirname $0)/config.null
+CONFIG=$(dirname $0)/qpidd-empty.conf
 TEST_CERT_DIR=`pwd`/test_cert_dir
 CERT_DB=${TEST_CERT_DIR}/test_cert_db
 CERT_PW_FILE=`pwd`/cert.password
@@ -32,7 +34,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=${QPID_TEST_SRC_DIR}/ping_broker
+PY_PING_BROKER=$SOURCE_DIR/src/tests/ping_broker
 COUNT=10
 
 if [[ -a $AMQP_LIB ]] ; then
@@ -93,7 +95,7 @@ delete_certs() {
     fi
 }
 
-# Don't need --no-module-dir or --no-data-dir as they are set as env vars in 
test_env.sh
+# Don't need --no-module-dir or --no-data-dir as they are set as env vars in 
env.sh
 COMMON_OPTS="--daemon --config $CONFIG --ssl-cert-db $CERT_DB 
--ssl-cert-password-file $CERT_PW_FILE --ssl-cert-name $TEST_HOSTNAME"
 
 # Start new brokers:
@@ -103,7 +105,7 @@ COMMON_OPTS="--daemon --config $CONFIG -
 start_brokers() {
     local -a ports
     for (( i=0; $i<$1; i++)) do
-    ports[$i]=$($QPIDD_EXEC --port 0 --interface 127.0.0.1 $COMMON_OPTS $2) || 
error "Could not start broker $i"
+    ports[$i]=$(qpidd --port 0 --interface 127.0.0.1 $COMMON_OPTS $2) || error 
"Could not start broker $i"
     done
     PORTS=( ${PORTS[@]} ${ports[@]} )
 }
@@ -111,7 +113,7 @@ start_brokers() {
 # Stop single broker:
 #   $1 is number of broker to stop (0 based)
 stop_broker() {
-    $QPIDD_EXEC -qp ${PORTS[$1]}
+    qpidd -qp ${PORTS[$1]}
 
     # Remove from ports array
     unset PORTS[$1]
@@ -120,15 +122,15 @@ stop_broker() {
 stop_brokers() {
     for port in "${PORTS[@]}";
     do
-        $QPIDD_EXEC -qp $port
+        qpidd -qp $port
     done
     PORTS=()
 }
 
 pick_port() {
     # We need a fixed port to set --cluster-url. Use qpidd to pick a free port.
-    PICK=`../qpidd --no-module-dir --listen-disable ssl -dp0`
-    ../qpidd --no-module-dir -qp $PICK
+    PICK=`qpidd --no-module-dir --listen-disable ssl -dp0`
+    qpidd --no-module-dir -qp $PICK
     echo $PICK
 }
 
@@ -143,11 +145,11 @@ start_ssl_broker() {
 }
 
 start_ssl_mux_broker() {
-    ../qpidd $COMMON_OPTS --port $1 --ssl-port $1 --auth no
+    qpidd $COMMON_OPTS --port $1 --ssl-port $1 --auth no
     PORTS=( ${PORTS[@]} $1 )
 }
 
-sasl_config_dir=$QPID_TEST_EXEC_DIR/sasl_config
+sasl_config_dir=$BUILD_DIR/src/tests/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} $MODULES"
@@ -180,25 +182,25 @@ export QPID_SSL_CERT_DB=${CERT_DB}
 export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE}
 
 ## Test connection via connection settings
-./qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary
+qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary
 
 ## Test connection with a URL
 URL=amqp:ssl:$TEST_HOSTNAME:$PORT
-./qpid-send -b $URL --content-string=hello -a "foo;{create:always}"
-MSG=`./qpid-receive -b $URL -a "foo;{create:always}" --messages 1`
+qpid-send -b $URL --content-string=hello -a "foo;{create:always}"
+MSG=`qpid-receive -b $URL -a "foo;{create:always}" --messages 1`
 test "$MSG" = "hello" || { echo "receive failed '$MSG' != 'hello'"; exit 1; }
 
 if [[ -a $AMQP_LIB ]] ; then
     echo "Testing ssl over AMQP 1.0"
-    ./qpid-send --connection-options '{protocol:amqp1.0}'  -b $URL 
--content-string=hello -a "foo;{create:always}"
-    MSG=`./qpid-receive --connection-options '{protocol:amqp1.0}' -b $URL -a 
"foo;{create:always}" --messages 1`
+    qpid-send --connection-options '{protocol:amqp1.0}'  -b $URL 
--content-string=hello -a "foo;{create:always}"
+    MSG=`qpid-receive --connection-options '{protocol:amqp1.0}' -b $URL -a 
"foo;{create:always}" --messages 1`
     test "$MSG" = "hello" || { echo "receive failed for AMQP 1.0 '$MSG' != 
'hello'"; exit 1; }
 fi
 
 ## Test connection with a combination of URL and connection options (in 
messaging API)
 URL=$TEST_HOSTNAME:$PORT
-./qpid-send -b $URL --connection-options '{transport:ssl,heartbeat:2}' 
--content-string='hello again' -a "foo;{create:always}"
-MSG=`./qpid-receive -b $URL --connection-options '{transport:ssl,heartbeat:2}' 
-a "foo;{create:always}" --messages 1`
+qpid-send -b $URL --connection-options '{transport:ssl,heartbeat:2}' 
--content-string='hello again' -a "foo;{create:always}"
+MSG=`qpid-receive -b $URL --connection-options '{transport:ssl,heartbeat:2}' 
-a "foo;{create:always}" --messages 1`
 test "$MSG" = "hello again" || { echo "receive failed '$MSG' != 'hello 
again'"; exit 1; }
 
 ## Test using the Python client
@@ -218,14 +220,14 @@ echo "Running SSL client authentication
 URL=amqp:ssl:$TEST_HOSTNAME:$PORT2
 
 ## See if you can set the SSL cert-name for the connection
-./qpid-send -b $URL --connection-options "{ssl-cert-name: $TEST_CLIENT_CERT }" 
 --content-string=hello -a "bar;{create:always}"
-MSG2=`./qpid-receive -b $URL  --connection-options "{ssl-cert-name: 
$TEST_CLIENT_CERT }" -a "bar;{create:always}" --messages 1`
+qpid-send -b $URL --connection-options "{ssl-cert-name: $TEST_CLIENT_CERT }"  
--content-string=hello -a "bar;{create:always}"
+MSG2=`qpid-receive -b $URL  --connection-options "{ssl-cert-name: 
$TEST_CLIENT_CERT }" -a "bar;{create:always}" --messages 1`
 test "$MSG2" = "hello" || { echo "receive failed '$MSG2' != 'hello'"; exit 1; }
 
 
 ## Make sure that connect fails with an invalid SSL cert-name
-./qpid-send -b $URL --connection-options "{ssl-cert-name: pignose }" 
--content-string=hello -a "baz;{create:always}" 2>/dev/null 1>/dev/null
-MSG3=`./qpid-receive -b $URL  --connection-options "{ssl-cert-name: pignose }" 
-a "baz;{create:always}" --messages 1 2>/dev/null`
+qpid-send -b $URL --connection-options "{ssl-cert-name: pignose }" 
--content-string=hello -a "baz;{create:always}" 2>/dev/null 1>/dev/null
+MSG3=`qpid-receive -b $URL  --connection-options "{ssl-cert-name: pignose }" 
-a "baz;{create:always}" --messages 1 2>/dev/null`
 test "$MSG3" = "" || { echo "receive succeeded without valid ssl cert '$MSG3' 
!= ''"; exit 1; }
 
 ## Set the userid in the message to the authenticated username
@@ -243,8 +245,8 @@ start_ssl_mux_broker $PORT || error "Cou
 echo "Running SSL/TCP mux test on fixed port $PORT"
 
 ## Test connection via connection settings
-./qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary || error "SSL connection failed!"
-./qpid-perftest --count ${COUNT} --port ${PORT} -P tcp -b $TEST_HOSTNAME 
--summary || error "TCP connection failed!"
+qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary || error "SSL connection failed!"
+qpid-perftest --count ${COUNT} --port ${PORT} -P tcp -b $TEST_HOSTNAME 
--summary || error "TCP connection failed!"
 
 # Test a broker chosen port - since ssl chooses port need to use --transport 
ssl here
 start_ssl_broker
@@ -252,8 +254,8 @@ PORT=${PORTS[0]}
 echo "Running SSL/TCP mux test on random port $PORT"
 
 ## Test connection via connection settings
-./qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary || error "SSL connection failed!"
-./qpid-perftest --count ${COUNT} --port ${PORT} -P tcp -b $TEST_HOSTNAME 
--summary || error "TCP connection failed!"
+qpid-perftest --count ${COUNT} --port ${PORT} -P ssl -b $TEST_HOSTNAME 
--summary || error "SSL connection failed!"
+qpid-perftest --count ${COUNT} --port ${PORT} -P tcp -b $TEST_HOSTNAME 
--summary || error "TCP connection failed!"
 
 stop_brokers
 
@@ -271,67 +273,63 @@ if [[ !(-x $OPENSSL) ]] ; then
     exit 0
 fi
 
-if test -d $PYTHON_DIR; then
 ## verify python version > 2.5 (only 2.6+ does certificate checking)
-    PY_VERSION=$(python -c "import sys; print hex(sys.hexversion)")
-    if (( PY_VERSION < 0x02060000 )); then
-       echo >&2 "Detected python version < 2.6 - skipping certificate 
verification tests"
-       exit 0
-    fi
+PY_VERSION=$(python -c "import sys; print hex(sys.hexversion)")
+if (( PY_VERSION < 0x02060000 )); then
+    echo >&2 "Detected python version < 2.6 - skipping certificate 
verification tests"
+    exit 0
+fi
 
-    echo "Testing Certificate validation and Authentication with the Python 
Client..."
+echo "Testing Certificate validation and Authentication with the Python 
Client..."
 
 # extract the CA's certificate as a PEM file
-    get_ca_certs() {
-       $PK12UTIL -o ${TEST_CERT_DIR}/CA_pk12.out -d ${CERT_DB} -n "Test-CA"  
-w ${CERT_PW_FILE} -k ${CERT_PW_FILE} > /dev/null
-       $OPENSSL pkcs12 -in ${TEST_CERT_DIR}/CA_pk12.out -out ${CA_PEM_FILE} 
-nokeys -passin file:${CERT_PW_FILE} >/dev/null
-       $PK12UTIL -o ${TEST_CERT_DIR}/other_CA_pk12.out -d ${OTHER_CA_CERT_DB} 
-n "Other-Test-CA" -w ${CERT_PW_FILE} -k ${CERT_PW_FILE} > /dev/null
-       $OPENSSL pkcs12 -in ${TEST_CERT_DIR}/other_CA_pk12.out -out 
${OTHER_CA_PEM_FILE} -nokeys -passin file:${CERT_PW_FILE} >/dev/null
-    }
+get_ca_certs() {
+    $PK12UTIL -o ${TEST_CERT_DIR}/CA_pk12.out -d ${CERT_DB} -n "Test-CA"  -w 
${CERT_PW_FILE} -k ${CERT_PW_FILE} > /dev/null
+    $OPENSSL pkcs12 -in ${TEST_CERT_DIR}/CA_pk12.out -out ${CA_PEM_FILE} 
-nokeys -passin file:${CERT_PW_FILE} >/dev/null
+    $PK12UTIL -o ${TEST_CERT_DIR}/other_CA_pk12.out -d ${OTHER_CA_CERT_DB} -n 
"Other-Test-CA" -w ${CERT_PW_FILE} -k ${CERT_PW_FILE} > /dev/null
+    $OPENSSL pkcs12 -in ${TEST_CERT_DIR}/other_CA_pk12.out -out 
${OTHER_CA_PEM_FILE} -nokeys -passin file:${CERT_PW_FILE} >/dev/null
+}
 
+get_ca_certs || error "Could not extract CA certificates as PEM files"
+start_ssl_broker
+PORT=${PORTS[0]}
+URL=amqps://$TEST_HOSTNAME:$PORT
+# verify the python client can authenticate the broker using the CA
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then echo "    
Passed"; else { echo "    Failed"; exit 1; }; fi
+# verify the python client fails to authenticate the broker when using the 
other CA
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${OTHER_CA_PEM_FILE} > /dev/null 
2>&1`; then { echo "    Failed"; exit 1; }; else echo "    Passed"; fi
+stop_brokers
+
+# create a certificate without matching TEST_HOSTNAME, should fail to verify
+
+create_certs "O=MyCo" "*.${TEST_HOSTNAME}.com" || error "Could not create 
server test certificate"
+get_ca_certs || error "Could not extract CA certificates as PEM files"
+start_ssl_broker
+PORT=${PORTS[0]}
+URL=amqps://$TEST_HOSTNAME:$PORT
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE} > /dev/null 
2>&1`; then { echo "    Failed"; exit 1; }; else echo "    Passed"; fi
+# but disabling the check for the hostname should pass
+if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE} 
--ssl-skip-hostname-check`; then echo "    Passed"; else { echo "    Failed"; 
exit 1; }; fi
+stop_brokers
+
+# test SubjectAltName parsing
+
+if (( PY_VERSION >= 0x02070300 )); then
+# python 2.7.3+ supports SubjectAltName extraction
+# create a certificate with TEST_HOSTNAME only in SAN, should verify OK
+    create_certs "O=MyCo" "*.foo.com,${TEST_HOSTNAME},*xyz.com" || error 
"Could not create server test certificate"
     get_ca_certs || error "Could not extract CA certificates as PEM files"
     start_ssl_broker
     PORT=${PORTS[0]}
     URL=amqps://$TEST_HOSTNAME:$PORT
-# verify the python client can authenticate the broker using the CA
     if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then echo " 
   Passed"; else { echo "    Failed"; exit 1; }; fi
-# verify the python client fails to authenticate the broker when using the 
other CA
-    if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${OTHER_CA_PEM_FILE} > 
/dev/null 2>&1`; then { echo "    Failed"; exit 1; }; else echo "    Passed"; fi
     stop_brokers
 
-# create a certificate without matching TEST_HOSTNAME, should fail to verify
-
-    create_certs "O=MyCo" "*.${TEST_HOSTNAME}.com" || error "Could not create 
server test certificate"
+    create_certs "O=MyCo" "*${TEST_HOSTNAME}" || error "Could not create 
server test certificate"
     get_ca_certs || error "Could not extract CA certificates as PEM files"
     start_ssl_broker
     PORT=${PORTS[0]}
     URL=amqps://$TEST_HOSTNAME:$PORT
-    if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE} > /dev/null 
2>&1`; then { echo "    Failed"; exit 1; }; else echo "    Passed"; fi
-# but disabling the check for the hostname should pass
-    if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE} 
--ssl-skip-hostname-check`; then echo "    Passed"; else { echo "    Failed"; 
exit 1; }; fi
+    if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then echo " 
   Passed"; else { echo "    Failed"; exit 1; }; fi
     stop_brokers
-
-# test SubjectAltName parsing
-
-    if (( PY_VERSION >= 0x02070300 )); then
-    # python 2.7.3+ supports SubjectAltName extraction
-    # create a certificate with TEST_HOSTNAME only in SAN, should verify OK
-       create_certs "O=MyCo" "*.foo.com,${TEST_HOSTNAME},*xyz.com" || error 
"Could not create server test certificate"
-       get_ca_certs || error "Could not extract CA certificates as PEM files"
-       start_ssl_broker
-       PORT=${PORTS[0]}
-       URL=amqps://$TEST_HOSTNAME:$PORT
-       if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then 
echo "    Passed"; else { echo "    Failed"; exit 1; }; fi
-       stop_brokers
-
-       create_certs "O=MyCo" "*${TEST_HOSTNAME}" || error "Could not create 
server test certificate"
-       get_ca_certs || error "Could not extract CA certificates as PEM files"
-       start_ssl_broker
-       PORT=${PORTS[0]}
-       URL=amqps://$TEST_HOSTNAME:$PORT
-       if `${PY_PING_BROKER} -b $URL --ssl-trustfile=${CA_PEM_FILE}`; then 
echo "    Passed"; else { echo "    Failed"; exit 1; }; fi
-       stop_brokers
-    fi
-
 fi
-

Modified: qpid/trunk/qpid/cpp/src/tests/topictest
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/topictest?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/topictest (original)
+++ qpid/trunk/qpid/cpp/src/tests/topictest Thu Apr 21 12:31:34 2016
@@ -46,11 +46,11 @@ done
 subscribe() {
     echo Start subscriber $1
     LOG="subscriber_$1.log"
-    ./qpid-topic-listener $TRANSACTIONAL > $LOG 2>&1 && rm -f $LOG 
+    qpid-topic-listener $TRANSACTIONAL > $LOG 2>&1 && rm -f $LOG 
 }
 
 publish() {
-    ./qpid-topic-publisher --messages $MESSAGES --batches $BATCHES 
--subscribers $SUBSCRIBERS $HOST $TRANSACTIONAL
+    qpid-topic-publisher --messages $MESSAGES --batches $BATCHES --subscribers 
$SUBSCRIBERS $HOST $TRANSACTIONAL
 }
 
 for ((i=$SUBSCRIBERS ; i--; )); do

Added: qpid/trunk/qpid/python/qpid-python-test.bat
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid-python-test.bat?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/python/qpid-python-test.bat (added)
+++ qpid/trunk/qpid/python/qpid-python-test.bat Thu Apr 21 12:31:34 2016
@@ -0,0 +1,2 @@
+@echo off
+python %~dp0\qpid-python-test %*

Propchange: qpid/trunk/qpid/python/qpid-python-test.bat
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/python/setup.py
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/python/setup.py?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/python/setup.py (original)
+++ qpid/trunk/qpid/python/setup.py Thu Apr 21 12:31:34 2016
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-import os, re, sys, string
+import os, re, sys, string, platform
 from distutils.core import setup, Command
 from distutils.command.build import build as _build
 from distutils.command.build_py import build_py as _build_py
@@ -297,17 +297,24 @@ class install_lib(_install_lib):
         extra.append(tgt)
     return outfiles + extra
 
+scripts = ["qpid-python-test"]
+
+if platform.system() == "Windows":
+  scripts.append("qpid-python-test.bat")
+  
 setup(name="qpid-python",
       version="0.35",
       author="Apache Qpid",
-      author_email="[email protected]",
+      author_email="[email protected]",
       packages=["mllib", "qpid", "qpid.messaging", "qpid.tests",
-                "qpid.tests.messaging", "qpid.saslmech", 
"qpid.tests.saslmech"],
+                "qpid.tests.messaging", "qpid.saslmech", "qpid.tests.saslmech",
+                "qpid_tests", "qpid_tests.broker_1_0", 
"qpid_tests.broker_0_10",
+                "qpid_tests.broker_0_9", "qpid_tests.broker_0_8"],
       package_data={"qpid": ["specs/*.dtd", "specs/*.xml"]},
-      scripts=["qpid-python-test"],
+      scripts=scripts,
       url="http://qpid.apache.org/";,
       license="Apache Software License",
-      description="Python client implementation for Apache Qpid",
+      description="Python client implementation and AMQP conformance tests for 
Apache Qpid",
       cmdclass={"build": build,
                 "build_py": build_py,
                 "build_doc": build_doc,



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to