diff options
author | Michael Goulish <mgoulish@apache.org> | 2011-05-02 18:13:00 +0000 |
---|---|---|
committer | Michael Goulish <mgoulish@apache.org> | 2011-05-02 18:13:00 +0000 |
commit | 21e7b2b1908ca0e1c89ec1cd355fd6da80043e97 (patch) | |
tree | 6588fa3a174f861802f14325e594b4ff76f47516 | |
parent | ec321fedb7067715b76a196a32c29367bc0e5e30 (diff) | |
download | qpid-python-21e7b2b1908ca0e1c89ec1cd355fd6da80043e97.tar.gz |
QPID-3239
qpid-tool is no longer printing status of clustered broker links, so this test code (which is used by several tests) hangs.
so make it look at the "transport" field instead.
also -- if this test is run on a machine that is clustered with several others -- and if there is another copy of the test running on one of the other machines -- the brokers on the different machinnes will form One Big Cluster. append the box-name to the cluster name.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1098704 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | qpid/cpp/src/tests/sasl_fed_ex | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/qpid/cpp/src/tests/sasl_fed_ex b/qpid/cpp/src/tests/sasl_fed_ex index 272b42cd0d..716a806874 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex +++ b/qpid/cpp/src/tests/sasl_fed_ex @@ -19,7 +19,6 @@ # under the License. # - #=============================================================================== # These tests create federated links between two brokers using SASL security. # The SASL mechanism used is EXTERNAL, which is satisfied by SSL @@ -56,6 +55,8 @@ function print { fi } +print "=========== start sasl_fed_ex $* ============" + # This minimum value corresponds to sasl version 2.1.22 @@ -102,8 +103,11 @@ if [[ !(-x $CERTUTIL) ]] ; then fi delete_certs -create_certs || error "Could not create test certificate" - +create_certs 2> /dev/null +if [ ! $? ]; then + error "Could not create test certificate" + exit 1 +fi sasl_config_dir=$builddir/sasl_config @@ -124,9 +128,12 @@ DST_TCP_PORT=5807 SRC_TCP_PORT_2=5802 DST_TCP_PORT_2=5803 -CLUSTER_1_NAME=sasl_fed_ex_cluster_1 -CLUSTER_2_NAME=sasl_fed_ex_cluster_2 +CLUSTER_NAME_SUFFIX=`hostname | tr '.' ' ' | awk '{print $1}'` +CLUSTER_1_NAME=sasl_fed_ex_cluster_1_${CLUSTER_NAME_SUFFIX} +CLUSTER_2_NAME=sasl_fed_ex_cluster_2_${CLUSTER_NAME_SUFFIX} +print "CLUSTER_1_NAME == ${CLUSTER_1_NAME}" +print "CLUSTER_2_NAME == ${CLUSTER_2_NAME}" SSL_LIB=${moduledir}/ssl.so CLUSTER_LIB=${moduledir}/cluster.so @@ -313,32 +320,40 @@ elif [ ${qpid_route_method} == "route" ]; then else echo "unknown method: |${qpid_route_method}|" echo " choices are: dynamic|link|queue|route " - print "Asking brokers to quit." - $QPIDD_EXEC --port ${SRC_TCP_PORT} --quit - $QPIDD_EXEC --port ${DST_TCP_PORT} --quit - exit 2 + 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 # This should work the same whether or not we are running a clustered test. +# In the case of clustered tests, the status is not printed by qpid_route. +# So in either case, I will 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 $5}') -print "link_status == ${link_status}" +link_status=$($QPID_ROUTE_EXEC link list localhost:${DST_TCP_PORT} | tail -1 | awk '{print $3}') halt_brokers sleep 1 -if [ ${link_status} == "Operational" ]; then +if [ ! ${link_status} ]; then + print "link_status is empty" + print "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 fi +print "link_status has a bad value: ${link_status}" print "result: fail" exit 3 |