summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Giusti <kgiusti@gmail.com>2015-12-03 14:22:50 -0500
committerKenneth Giusti <kgiusti@gmail.com>2015-12-03 14:29:13 -0500
commit822b803fb0d7e260628230c680b4975c1a3e0900 (patch)
tree730d7ddb616814d8a5b6923dbe0531a694a94c46
parent74a0ec8b1c4b3ca6c700d110d6bfd77348cc970a (diff)
downloadoslo-messaging-822b803fb0d7e260628230c680b4975c1a3e0900.tar.gz
Skip Cyrus SASL tests if proton does not support Cyrus SASL
Change-Id: I265d17a2c92b97777a5a97683b95427825872d3a Closes-Bug: #1508523
-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"""