Add swift config option to service_available group
This commit adds a new config option, swift, to the service_available
group. This option can be used to specify whether swift is running.
It also adds a skip to the base object test class, replacing the
endpoint detection skip.
Change-Id: I8d81071cf5077fb880f04c04b330b1f4132a58f0
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 435bb6c..32fe484 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -354,3 +354,5 @@
neutron = false
# Whether or not glance is expected to be available
glance = True
+# Whether or not swift is expected to be available
+swift = True
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index bf013ec..5a1fb5a 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -26,6 +26,9 @@
@classmethod
def setUpClass(cls):
+ if not cls.config.service_available.swift:
+ skip_msg = ("%s skipped as swift is not available" % cls.__name__)
+ raise cls.skipException(skip_msg)
cls.os = clients.Manager()
cls.object_client = cls.os.object_client
cls.container_client = cls.os.container_client
@@ -42,12 +45,6 @@
cls.data = DataGenerator(cls.identity_admin_client)
- try:
- cls.account_client.list_account_containers()
- except exceptions.EndpointNotFound:
- skip_msg = "No OpenStack Object Storage API endpoint"
- raise cls.skipException(skip_msg)
-
@classmethod
def delete_containers(cls, containers, container_client=None,
object_client=None):
diff --git a/tempest/config.py b/tempest/config.py
index 6f75b45..83ea25c 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -548,6 +548,9 @@
cfg.BoolOpt('glance',
default=True,
help="Whether or not glance is expected to be available"),
+ cfg.BoolOpt('swift',
+ default=True,
+ help="Whether or not swift is expected to be available"),
]