summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-04 13:03:14 +0000
committerGerrit Code Review <review@openstack.org>2015-12-04 13:03:14 +0000
commit6e811ec2e50182022752f54acee99416f66a3619 (patch)
treeb21271cd88c2d018fa6bb085f0c8dd91c5b038ad
parentd1e2fb3be6d5799225c7bbbb36d712699fab051b (diff)
parent822b803fb0d7e260628230c680b4975c1a3e0900 (diff)
downloadoslo-messaging-6e811ec2e50182022752f54acee99416f66a3619.tar.gz
Merge "Skip Cyrus SASL tests if proton does not support Cyrus SASL"
-rw-r--r--oslo_messaging/tests/test_amqp_driver.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/oslo_messaging/tests/test_amqp_driver.py b/oslo_messaging/tests/test_amqp_driver.py
index 4e3b750..e73f491 100644
--- a/oslo_messaging/tests/test_amqp_driver.py
+++ b/oslo_messaging/tests/test_amqp_driver.py
@@ -38,6 +38,11 @@ pyngus = importutils.try_import("pyngus")
if pyngus:
from oslo_messaging._drivers.protocols.amqp import driver as amqp_driver
+# The Cyrus-based SASL tests can only be run if the installed version of proton
+# has been built with Cyrus SASL support.
+_proton = importutils.try_import("proton")
+CYRUS_ENABLED = (pyngus and pyngus.VERSION >= (2, 0, 0) and _proton
+ and getattr(_proton.SASL, "extended", lambda: False)())
LOG = logging.getLogger(__name__)
@@ -354,8 +359,7 @@ class TestAuthentication(test_utils.BaseTestCase):
driver.cleanup()
-@testtools.skipUnless(pyngus and pyngus.VERSION >= (2, 0, 0),
- "pyngus module not present")
+@testtools.skipUnless(CYRUS_ENABLED, "Cyrus SASL not supported")
class TestCyrusAuthentication(test_utils.BaseTestCase):
"""Test the driver's Cyrus SASL integration"""