diff --git a/tempest/api/compute/admin/test_volume_swap.py b/tempest/api/compute/admin/test_volume_swap.py index 371b506f7a..edcb1a7440 100644 --- a/tempest/api/compute/admin/test_volume_swap.py +++ b/tempest/api/compute/admin/test_volume_swap.py @@ -23,6 +23,7 @@ CONF = config.CONF class TestVolumeSwapBase(base.BaseV2ComputeAdminTest): + create_default_network = True @classmethod def skip_checks(cls): diff --git a/tempest/api/compute/admin/test_volumes_negative.py b/tempest/api/compute/admin/test_volumes_negative.py index 4a7f36f2be..aa932eefac 100644 --- a/tempest/api/compute/admin/test_volumes_negative.py +++ b/tempest/api/compute/admin/test_volumes_negative.py @@ -22,6 +22,7 @@ CONF = config.CONF class VolumesAdminNegativeTest(base.BaseV2ComputeAdminTest): + create_default_network = True @classmethod def skip_checks(cls): diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py index eef278114b..ef336851a1 100644 --- a/tempest/api/compute/images/test_images.py +++ b/tempest/api/compute/images/test_images.py @@ -25,6 +25,7 @@ CONF = config.CONF class ImagesTestJSON(base.BaseV2ComputeTest): + create_default_network = True @classmethod def skip_checks(cls): diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py index 512c9d260f..37f9be35bd 100644 --- a/tempest/api/compute/images/test_images_oneserver_negative.py +++ b/tempest/api/compute/images/test_images_oneserver_negative.py @@ -30,6 +30,7 @@ LOG = logging.getLogger(__name__) class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest): + create_default_network = True def tearDown(self): """Terminate test instances created after a test is executed.""" diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py index 482ba0946f..5688af1997 100644 --- a/tempest/api/compute/servers/test_server_metadata_negative.py +++ b/tempest/api/compute/servers/test_server_metadata_negative.py @@ -20,6 +20,7 @@ from tempest.lib import exceptions as lib_exc class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest): + create_default_network = True @classmethod def setup_clients(cls): diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py index 3e0deefa43..5bac3d877e 100644 --- a/tempest/api/volume/admin/test_volumes_actions.py +++ b/tempest/api/volume/admin/test_volumes_actions.py @@ -23,6 +23,7 @@ CONF = config.CONF class VolumesActionsTest(base.BaseVolumeAdminTest): + create_default_network = True def _create_reset_and_force_delete_temp_volume(self, status=None): # Create volume, reset volume status, and force delete temp volume diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py index 1bfd075249..bcbcf43a26 100644 --- a/tempest/api/volume/base.py +++ b/tempest/api/volume/base.py @@ -30,6 +30,9 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest, tempest.test.BaseTestCase): """Base test case class for all Cinder API tests.""" + # Set this to True in subclasses to create a default network. See + # https://bugs.launchpad.net/tempest/+bug/1844568 + create_default_network = False _api_version = 2 # if api_v2 is not enabled while api_v3 is enabled, the volume v2 classes # should be transferred to volume v3 classes. @@ -63,7 +66,9 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest, @classmethod def setup_credentials(cls): - cls.set_network_resources() + cls.set_network_resources( + network=cls.create_default_network, + subnet=cls.create_default_network) super(BaseVolumeTest, cls).setup_credentials() @classmethod diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py index be5638ec3a..9edffc697b 100644 --- a/tempest/api/volume/test_volumes_actions.py +++ b/tempest/api/volume/test_volumes_actions.py @@ -25,6 +25,7 @@ CONF = config.CONF class VolumesActionsTest(base.BaseVolumeTest): + create_default_network = True @classmethod def resource_setup(cls): diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py index c3f44e2d87..22670451ce 100644 --- a/tempest/api/volume/test_volumes_extend.py +++ b/tempest/api/volume/test_volumes_extend.py @@ -60,6 +60,7 @@ class VolumesExtendTest(base.BaseVolumeTest): class VolumesExtendAttachedTest(base.BaseVolumeTest): """Tests extending the size of an attached volume.""" + create_default_network = True # We need admin credentials for getting instance action event details. By # default a non-admin can list and show instance actions if they own the diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py index 72e7290e12..bf221e8e3b 100644 --- a/tempest/api/volume/test_volumes_snapshots.py +++ b/tempest/api/volume/test_volumes_snapshots.py @@ -25,6 +25,7 @@ CONF = config.CONF class VolumesSnapshotTestJSON(base.BaseVolumeTest): + create_default_network = True @classmethod def skip_checks(cls):