You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mg...@apache.org on 2011/05/02 20:13:00 UTC

svn commit: r1098704 - /qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex

Author: mgoulish
Date: Mon May  2 18:13:00 2011
New Revision: 1098704

URL: http://svn.apache.org/viewvc?rev=1098704&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex

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=1098704&r1=1098703&r2=1098704&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex (original)
+++ qpid/trunk/qpid/cpp/src/tests/sasl_fed_ex Mon May  2 18:13:00 2011
@@ -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" ]
 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
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org