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 14202aa048de2b6e504c8dd1762400c5bf19d7d2)
diff --git a/tempest/api/network/test_tags.py b/tempest/api/network/test_tags.py
index 5219c34..e93e75a 100644
--- a/tempest/api/network/test_tags.py
+++ b/tempest/api/network/test_tags.py
@@ -111,7 +111,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):
@@ -132,6 +135,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.network.default_network
cls.subnetpool = cls.subnetpools_client.create_subnetpool(
diff --git a/tempest/config.py b/tempest/config.py
index 7a9d19b..2eadea0 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1607,6 +1607,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.