Create default network for compute volume and negative metadata tests

server metadata and volume tests also create server without passing
the network to nova which further fail if more than one test network exists.

http://eavesdrop.openstack.org/irclogs/%23openstack-qa/%23openstack-qa.2020-03-03.log.html#t2020-03-03T15:57:34

Partial-Bug: #1844568
Change-Id: I9956946a4309b9a013fd53b0db06718372a9213c
This commit is contained in:
Ghanshyam Mann 2020-03-03 10:21:50 -06:00 committed by Lee Yarwood
parent 1eda90cf06
commit 7d91b69081
10 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,7 @@ CONF = config.CONF
class TestVolumeSwapBase(base.BaseV2ComputeAdminTest):
create_default_network = True
@classmethod
def skip_checks(cls):

View File

@ -22,6 +22,7 @@ CONF = config.CONF
class VolumesAdminNegativeTest(base.BaseV2ComputeAdminTest):
create_default_network = True
@classmethod
def skip_checks(cls):

View File

@ -25,6 +25,7 @@ CONF = config.CONF
class ImagesTestJSON(base.BaseV2ComputeTest):
create_default_network = True
@classmethod
def skip_checks(cls):

View File

@ -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."""

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -25,6 +25,7 @@ CONF = config.CONF
class VolumesActionsTest(base.BaseVolumeTest):
create_default_network = True
@classmethod
def resource_setup(cls):

View File

@ -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

View File

@ -25,6 +25,7 @@ CONF = config.CONF
class VolumesSnapshotTestJSON(base.BaseVolumeTest):
create_default_network = True
@classmethod
def skip_checks(cls):