You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2013/04/04 19:16:12 UTC

svn commit: r1464646 - in /qpid/branches/0.22/qpid/cpp: bindings/qmf/python/Makefile.am bindings/qpid/Makefile.am src/tests/ssl_test

Author: aconway
Date: Thu Apr  4 17:16:12 2013
New Revision: 1464646

URL: http://svn.apache.org/r1464646
Log:
QPID-4697: Minor fixes to make distcheck

- add qmfengine.py to DIST.
- create directory qpid/bindings/perl if not already present.
- ssl_test: don't run python part of tests if python client not available.

Modified:
    qpid/branches/0.22/qpid/cpp/bindings/qmf/python/Makefile.am
    qpid/branches/0.22/qpid/cpp/bindings/qpid/Makefile.am
    qpid/branches/0.22/qpid/cpp/src/tests/ssl_test

Modified: qpid/branches/0.22/qpid/cpp/bindings/qmf/python/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/bindings/qmf/python/Makefile.am?rev=1464646&r1=1464645&r2=1464646&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/bindings/qmf/python/Makefile.am (original)
+++ qpid/branches/0.22/qpid/cpp/bindings/qmf/python/Makefile.am Thu Apr  4 17:16:12 2013
@@ -25,7 +25,7 @@ generated_file_list = \
 	qmfengine.cpp \
 	qmfengine.py
 
-EXTRA_DIST = CMakeLists.txt python.i
+EXTRA_DIST = CMakeLists.txt python.i qmfengine.py
 BUILT_SOURCES = $(generated_file_list)
 SWIG_FLAGS = -w362,401
 

Modified: qpid/branches/0.22/qpid/cpp/bindings/qpid/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/bindings/qpid/Makefile.am?rev=1464646&r1=1464645&r2=1464646&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/bindings/qpid/Makefile.am (original)
+++ qpid/branches/0.22/qpid/cpp/bindings/qpid/Makefile.am Thu Apr  4 17:16:12 2013
@@ -38,9 +38,11 @@ BUILT_SOURCES = perl/cqpid_perl.cpp
 SWIG_FLAGS = -w362,401
 
 perl/cqpid_perl.cpp: $(srcdir)/perl/perl.i
+	mkdir -p perl
 	$(SWIG) -perl -c++ $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o perl/cqpid_perl.cpp $(srcdir)/perl/perl.i
 
 perl/Makefile: perl/cqpid_perl.cpp
+	mkdir -p perl
 	cd perl; \
 		$(PERL) Makefile.PL PREFIX=$(prefix) ; \
 	cd ..

Modified: qpid/branches/0.22/qpid/cpp/src/tests/ssl_test
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/src/tests/ssl_test?rev=1464646&r1=1464645&r2=1464646&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/src/tests/ssl_test (original)
+++ qpid/branches/0.22/qpid/cpp/src/tests/ssl_test Thu Apr  4 17:16:12 2013
@@ -101,7 +101,7 @@ COMMON_OPTS="--daemon --config $CONFIG -
 start_brokers() {
     local -a ports
     for (( i=0; $i<$1; i++)) do
-        ports[$i]=$($QPIDD_EXEC --port 0 $COMMON_OPTS $2) || error "Could not start broker $i"
+    ports[$i]=$($QPIDD_EXEC --port 0 $COMMON_OPTS $2) || error "Could not start broker $i"
     done
     PORTS=( ${PORTS[@]} ${ports[@]} )
 }
@@ -194,9 +194,13 @@ MSG=`./qpid-receive -b $URL --connection
 test "$MSG" = "hello again" || { echo "receive failed '$MSG' != 'hello again'"; exit 1; }
 
 ## Test using the Python client
-echo "Testing Non-Authenticating with Python Client..."
-URL=amqps://$TEST_HOSTNAME:$PORT
-if `$top_srcdir/src/tests/ping_broker -b $URL`; then echo "    Passed"; else { echo "    Failed"; exit 1; }; fi
+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
 
@@ -253,66 +257,67 @@ 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 || 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
+    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
+    }
 
-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_certs "O=MyCo" "*${TEST_HOSTNAME}" || error "Could not create server test certificate"
+# 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}`; then echo "    Passed"; else { echo "    Failed"; exit 1; }; fi
+    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
-fi
 
+# 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
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org