From b2f505ee577162e47683ca1ce7a28cacf767aeb5 Mon Sep 17 00:00:00 2001
From: Mehdi Abaakouk <sileht@redhat.com>
Date: Sat, 7 Feb 2015 03:35:05 +0100
Subject: [PATCH] amqp1: fix functional tests deps

This change increases the version of python-qpid-proton to works
on fedora21.

It also installs qpid-tools to ensure authentification works before
starting the tests.

Change-Id: Ic8eb3b80ef4af6ca8cecbb6fba71cb69c0af3101
---
 amqp1-requirements.txt                                 | 2 +-
 oslo_messaging/tests/functional/gate/post_test_hook.sh | 9 +++++++++
 tox.ini                                                | 4 ++--
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/amqp1-requirements.txt b/amqp1-requirements.txt
index bf8a37ee1..6303dc761 100644
--- a/amqp1-requirements.txt
+++ b/amqp1-requirements.txt
@@ -5,5 +5,5 @@
 # amqp1 driver tox tests this way:
 #    tox -e amqp1
 pyngus>=1.0.0,<2.0.0  # Apache-2.0
-python-qpid-proton>=0.7,<0.8  # Apache-2.0
+python-qpid-proton>=0.7,<0.9  # Apache-2.0
 
diff --git a/oslo_messaging/tests/functional/gate/post_test_hook.sh b/oslo_messaging/tests/functional/gate/post_test_hook.sh
index df6c51a93..2388a04fc 100755
--- a/oslo_messaging/tests/functional/gate/post_test_hook.sh
+++ b/oslo_messaging/tests/functional/gate/post_test_hook.sh
@@ -16,5 +16,14 @@
 
 RPC_BACKEND=$1
 
+case $RPC_BACKEND in
+    amqp1|qpid)
+        # Ensure authentification works before continuing, otherwise tests
+        # will retries forever
+        sudo yum install -y qpid-tools
+        qpid-config --sasl-mechanism=PLAIN -a stackqpid/secretqpid@127.0.0.1
+        ;;
+esac
+
 cd $BASE/new/oslo.messaging
 sudo -H -u stack tox -e py27-func-$RPC_BACKEND
diff --git a/tox.ini b/tox.ini
index 7d2ad971c..5cbe26086 100644
--- a/tox.ini
+++ b/tox.ini
@@ -43,8 +43,8 @@ commands = python setup.py testr --slowest --testr-args='oslo_messaging.tests.fu
 setenv = TRANSPORT_URL=amqp://stackqpid:secretqpid@127.0.0.1//
 deps = -r{toxinidir}/amqp1-requirements.txt
         {[testenv]deps}
-# NOTE(sileht): until ubuntu get proto packages, we run amqp_driver tests here
-# because this is the only target to run fedora 20 in gate
+# NOTE(sileht): This gate job run in fedora21 because proton libs are not
+# available on ubuntu yet,
 commands = python setup.py testr --slowest --testr-args='oslo_messaging.tests.(functional|test_amqp_driver)'
 
 [testenv:py27-func-zeromq]