Merge "Add smoke decorator for barbican tests." into mcp/xenial/rocky
diff --git a/barbican_tempest_plugin/tests/api/base.py b/barbican_tempest_plugin/tests/api/base.py
index 7256a10..26fe533 100644
--- a/barbican_tempest_plugin/tests/api/base.py
+++ b/barbican_tempest_plugin/tests/api/base.py
@@ -65,6 +65,12 @@
created_objects = {}
@classmethod
+ def skip_checks(cls):
+ super(BaseKeyManagerTest, cls).skip_checks()
+ if not CONF.service_available.barbican:
+ raise cls.skipException('Barbican is not enabled.')
+
+ @classmethod
def setup_clients(cls):
super(BaseKeyManagerTest, cls).setup_clients()
os = getattr(cls, 'os_%s' % cls.credentials[0])
diff --git a/barbican_tempest_plugin/tests/api/test_secrets.py b/barbican_tempest_plugin/tests/api/test_secrets.py
index da2afcb..5ce1c9f 100644
--- a/barbican_tempest_plugin/tests/api/test_secrets.py
+++ b/barbican_tempest_plugin/tests/api/test_secrets.py
@@ -17,6 +17,7 @@
from datetime import datetime
from datetime import timedelta
import os
+import time
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
@@ -95,6 +96,12 @@
# Associate the payload with the created secret
self.secret_client.put_secret_payload(uuid, key)
+ # NOTE(vsaienko): in HA mode create and get requests might go to
+ # different backends. In case when dogtag is used sync of keys
+ # might take some time.
+ # TODO(vsaienko): switch to retry logic when get 404 exception
+ time.sleep(2)
+
# Retrieve the payload
payload = self.secret_client.get_secret_payload(uuid)
self.assertEqual(key, base64.b64encode(payload))