Do not test subnetpools in TF case
TF do not support subnet_allocation extension.
Also bring new method, that can be used as common in
tests to check TF backend.
Related-Prod: https://mirantis.jira.com/browse/PRODX-23390
Change-Id: I369de0530e940c3ddd35541f175f420e576063c5
(cherry picked from commit f72e994971549dddfddef913703156b90b4335e6)
(cherry picked from commit 6ba3c139d06c1c5a15df805b1b74c987e1a974a9)
diff --git a/tempest/api/network/test_tags.py b/tempest/api/network/test_tags.py
index bd3e360..af0a8b0 100644
--- a/tempest/api/network/test_tags.py
+++ b/tempest/api/network/test_tags.py
@@ -113,7 +113,10 @@
# NOTE(felipemonteiro): The supported resource names are plural. Use
# the singular case for the corresponding class resource object.
- SUPPORTED_RESOURCES = ['subnets', 'ports', 'routers', 'subnetpools']
+ if config.is_tungstenfabric_backend_enabled():
+ SUPPORTED_RESOURCES = ['subnets', 'ports', 'routers']
+ else:
+ SUPPORTED_RESOURCES = ['subnets', 'ports', 'routers', 'subnetpools']
@classmethod
def skip_checks(cls):
@@ -134,6 +137,9 @@
cls.port = cls.create_port(cls.network)
cls.router = cls.create_router()
+ if config.is_tungstenfabric_backend_enabled():
+ return
+
subnetpool_name = data_utils.rand_name(
cls.__name__ + '-Subnetpool', prefix=CONF.resource_name_prefix)
prefix = CONF.network.default_network
diff --git a/tempest/config.py b/tempest/config.py
index db1d787..986c917 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1684,6 +1684,17 @@
return _parameters
+def is_tungstenfabric_backend_enabled():
+ """Return True if TungstenFabric is used as a backend."""
+ try:
+ sdn = getattr(CONF, 'sdn')
+ service_name = getattr(sdn, 'service_name')
+ if service_name == 'tungstenfabric':
+ return True
+ except cfg.NoSuchOptError:
+ return False
+
+
def _register_tempest_service_clients():
# Register tempest own service clients using the same mechanism used
# for external plugins.