Merge "Update attach logic in VolumeEncryptionTest" 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_consumers.py b/barbican_tempest_plugin/tests/api/test_consumers.py
index 606ae0e..1f003ec 100644
--- a/barbican_tempest_plugin/tests/api/test_consumers.py
+++ b/barbican_tempest_plugin/tests/api/test_consumers.py
@@ -20,6 +20,7 @@
 class ConsumersTest(base.BaseKeyManagerTest):
     """Containers API tests."""
 
+    @decorators.attr(type='smoke')
     @decorators.idempotent_id('7d46a170-6b3b-4f4d-903a-b29aebb93289')
     def test_add_delete_consumers_in_container(self):
         # Create a container to test against
diff --git a/barbican_tempest_plugin/tests/api/test_orders.py b/barbican_tempest_plugin/tests/api/test_orders.py
index de8791b..5a3d233 100644
--- a/barbican_tempest_plugin/tests/api/test_orders.py
+++ b/barbican_tempest_plugin/tests/api/test_orders.py
@@ -20,6 +20,7 @@
 class OrdersTest(base.BaseKeyManagerTest):
     """Orders API tests."""
 
+    @decorators.attr(type='smoke')
     @decorators.idempotent_id('077c1729-1950-4e62-a29c-daba4aa186ad')
     def test_create_list_delete_orders(self):
         # Confirm that there are no orders
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))
diff --git a/barbican_tempest_plugin/tests/scenario/test_image_signing.py b/barbican_tempest_plugin/tests/scenario/test_image_signing.py
index 794d33e..fc552ba 100644
--- a/barbican_tempest_plugin/tests/scenario/test_image_signing.py
+++ b/barbican_tempest_plugin/tests/scenario/test_image_signing.py
@@ -27,6 +27,7 @@
 
 class ImageSigningTest(barbican_manager.BarbicanScenarioTest):
 
+    @decorators.attr(type='smoke')
     @decorators.idempotent_id('4343df3c-5553-40ea-8705-0cce73b297a9')
     @utils.services('compute', 'image')
     def test_signed_image_upload_and_boot(self):
@@ -49,6 +50,7 @@
                                       wait_until='ACTIVE')
         self.servers_client.delete_server(instance['id'])
 
+    @decorators.attr(type='smoke')
     @decorators.idempotent_id('74f022d6-a6ef-4458-96b7-541deadacf99')
     @utils.services('compute', 'image')
     def test_signed_image_upload_boot_failure(self):