Add new base manager with default network
Dynamic credentials setup full network by default, tests
which don't need some network resources disables them
explicitly, make same behavior for static credentials.
Related-PRODX: PRODX-25617
Change-Id: I23542c02a71b0b7dc87e8b9b1b32d0b4ea9035f9
(cherry picked from commit c3c15c7905e2674938699f3bff095618b1ac1e1f)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 39021d5..481765f 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -1203,6 +1203,16 @@
return self.create_volume(name=name, imageRef=image_id, **kwargs)
+class ScenarioTestWithNetwork(ScenarioTest):
+ """Base class for tests with default network"""
+
+ @classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True,
+ dhcp=True, router=True)
+ super(ScenarioTestWithNetwork, cls).setup_credentials()
+
+
class NetworkScenarioTest(ScenarioTest):
"""Base class for network scenario tests.
@@ -1554,7 +1564,8 @@
return network, subnet, router
-class EncryptionScenarioTest(ScenarioTest):
+class EncryptionScenarioTest(ScenarioTestWithNetwork):
+
"""Base class for encryption scenario tests"""
@classmethod
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 2a15470..e1c8953 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -27,7 +27,7 @@
CONF = config.CONF
-class TestServerBasicOps(manager.ScenarioTest):
+class TestServerBasicOps(manager.ScenarioTestWithNetwork):
"""The test suite for server basic operations
diff --git a/tempest/scenario/test_volume_backup_restore.py b/tempest/scenario/test_volume_backup_restore.py
index d0885cf..17b5c40 100644
--- a/tempest/scenario/test_volume_backup_restore.py
+++ b/tempest/scenario/test_volume_backup_restore.py
@@ -22,7 +22,7 @@
CONF = config.CONF
-class TestVolumeBackupRestore(manager.ScenarioTest):
+class TestVolumeBackupRestore(manager.ScenarioTestWithNetwork):
"""Test cinder backup and restore
This testcase verifies content preservation after backup and restore