Make network resource creation in isolation configurable
This commit adds a helper method to the base test class
set_network_resources(). This method should be called before the super
call in setUpClass and lets you specify which network resources
are created for a test class in tenant isolation. This is useful for
fine tuning each test class so that only the resources that are needed
get created.
Change-Id: I8f66534dbe3f48552ed6cd238ad237c46d7ee60c
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index 47d8cca..b4928dd 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -32,7 +32,8 @@
if not cls.config.service_available.swift:
skip_msg = ("%s skipped as swift is not available" % cls.__name__)
raise cls.skipException(skip_msg)
- cls.isolated_creds = isolated_creds.IsolatedCreds(cls.__name__)
+ cls.isolated_creds = isolated_creds.IsolatedCreds(
+ cls.__name__, network_resources=cls.network_resources)
if cls.config.compute.allow_tenant_isolation:
# Get isolated creds for normal user
creds = cls.isolated_creds.get_primary_creds()