Run test_service_type_management test only if extension is available
Change-Id: Ic237610dd1b1511bdee484cc2f7797b92a67b9b3
Closes-bug: #1260877
diff --git a/tempest/api/network/test_service_type_management.py b/tempest/api/network/test_service_type_management.py
index ae03e96..da6800b 100644
--- a/tempest/api/network/test_service_type_management.py
+++ b/tempest/api/network/test_service_type_management.py
@@ -13,13 +13,20 @@
# under the License.
from tempest.api.network import base
-from tempest.test import attr
+from tempest import test
class ServiceTypeManagementTestJSON(base.BaseNetworkTest):
_interface = 'json'
- @attr(type='smoke')
+ @classmethod
+ def setUpClass(cls):
+ super(ServiceTypeManagementTestJSON, cls).setUpClass()
+ if not test.is_extension_enabled('service-type', 'network'):
+ msg = "Neutron Service Type Management not enabled."
+ raise cls.skipException(msg)
+
+ @test.attr(type='smoke')
def test_service_provider_list(self):
resp, body = self.client.list_service_providers()
self.assertEqual(resp['status'], '200')