From 2a9094af5d06edd174aab42aa1828fab24fb39cf Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Thu, 8 Dec 2016 12:22:35 -0500 Subject: [PATCH] [AMQP 1.0] Setup the amqp1 test environment on ubuntu Fixes the amqp1 functional tests so they can be run on Xenial. Closes-Bug: 1643644 Change-Id: I3e3ee6779a60774ebffc1f45ae5564db934f8eaf --- bindep.txt | 1 + .../tests/functional/gate/post_test_hook.sh | 3 --- setup-test-env-amqp1.sh | 12 +++++++++++- tools/test-setup.sh | 1 + tox.ini | 3 --- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bindep.txt b/bindep.txt index b704cd6a3..636043a67 100644 --- a/bindep.txt +++ b/bindep.txt @@ -24,6 +24,7 @@ qpidd [platform:dpkg amqp1] sasl2-bin [platform:dpkg amqp1] uuid-dev [platform:dpkg amqp1] swig [platform:dpkg amqp1] +libsasl2-modules [platform:dpkg amqp1] # AMQP1 rpm qpid-cpp-server [platform:rpm amqp1] diff --git a/oslo_messaging/tests/functional/gate/post_test_hook.sh b/oslo_messaging/tests/functional/gate/post_test_hook.sh index 155a8c4b3..fb8778b2d 100755 --- a/oslo_messaging/tests/functional/gate/post_test_hook.sh +++ b/oslo_messaging/tests/functional/gate/post_test_hook.sh @@ -47,9 +47,6 @@ case $RPC_BACKEND in sudo apt-get update -y sudo apt-get install -y redis-server python-redis ;; - amqp1) - sudo yum install -y qpid-cpp-server qpid-proton-c-devel python-qpid-proton cyrus-sasl-lib cyrus-sasl-plain - ;; rabbit) sudo apt-get update -y sudo apt-get install -y rabbitmq-server diff --git a/setup-test-env-amqp1.sh b/setup-test-env-amqp1.sh index 0ecfd0dd7..978cda1dd 100755 --- a/setup-test-env-amqp1.sh +++ b/setup-test-env-amqp1.sh @@ -115,6 +115,12 @@ EOF function _configure_qpidd { + QPIDD=$(which qpidd 2>/dev/null) + if [[ ! -x "$QPIDD" ]]; then + echo "FAILURE: qpidd broker not installed" + exit 1 + fi + [ -f "/usr/lib/qpid/daemon/acl.so" ] && LIBACL="load-module=/usr/lib/qpid/daemon/acl.so" cat > ${DATADIR}/qpidd.conf </dev/null) --help | grep -q "sasl-service-name"`; then +if ! `$QPIDD --help | grep -q "sasl-service-name"`; then echo "This version of $QPIDD does not support SASL authentication with AMQP 1.0" cat >> ${DATADIR}/qpidd.conf </dev/null) mkfifo ${DATADIR}/out $QPIDD --log-enable trace+ --log-to-file ${DATADIR}/out --config ${DATADIR}/qpidd.conf & diff --git a/tools/test-setup.sh b/tools/test-setup.sh index abb2540ba..98a83eabd 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -28,6 +28,7 @@ PACKAGES=$(.tox/bindep/bin/bindep -b -f bindep.txt $BINDEP_PROFILE || true) # inspired from project-config install-distro-packages.sh if apt-get -v >/dev/null 2>&1 ; then + [ $BINDEP_PROFILE == amqp1 ] && sudo add-apt-repository -y ppa:qpid/testing sudo apt-get -qq update sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \ apt-get -q --option "Dpkg::Options::=--force-confold" \ diff --git a/tox.ini b/tox.ini index 8470b1f6e..0cb6b7faf 100644 --- a/tox.ini +++ b/tox.ini @@ -67,7 +67,6 @@ setenv = AMQP1_BACKEND=qpidd ENVNAME={envname} WORKDIR={toxworkdir} -# NOTE(kgiusti): This gate job runs on Centos 7 for now. commands = {toxinidir}/setup-test-env-amqp1.sh python setup.py testr --slowest --testr-args='oslo_messaging.tests.functional' [testenv:py34-func-amqp1] @@ -78,7 +77,6 @@ setenv = AMQP1_BACKEND=qpidd ENVNAME={envname} WORKDIR={toxworkdir} -# NOTE(kgiusti): This gate job runs on Centos 7 for now. commands = {toxinidir}/setup-test-env-amqp1.sh python setup.py testr --slowest --testr-args='oslo_messaging.tests.functional' [testenv:py35-func-amqp1] @@ -89,7 +87,6 @@ setenv = AMQP1_BACKEND=qpidd ENVNAME={envname} WORKDIR={toxworkdir} -# NOTE(kgiusti): This gate job runs on Centos 7 for now. commands = {toxinidir}/setup-test-env-amqp1.sh python setup.py testr --slowest --testr-args='oslo_messaging.tests.functional' [testenv:py27-func-zeromq]