api-tests: Common way to define required extensions
As some tests require extensions to be enabled on the server, this patch introduces a new class attribute to the API base class. If any extension defined in test class is not enabled on the server, then all tests in the test class will be skipped. Change-Id: I0629153f973daeb3bef3a6968360cbc2d427f9ad
This commit is contained in:
parent
e4557a7793
commit
814fbc0501
@ -368,6 +368,12 @@ Tests for other resources should be contributed to the Neutron repository.
|
||||
Scenario tests should be similarly split up between Tempest and Neutron
|
||||
according to the API they're targeting.
|
||||
|
||||
To create an API test, the testing class must at least inherit from
|
||||
neutron.tests.tempest.api.base.BaseNetworkTest base class. As some of tests
|
||||
may require certain extensions to be enabled, the base class provides
|
||||
``required_extensions`` class attribute which can be used by subclasses to
|
||||
define a list of required extensions for particular test class.
|
||||
|
||||
Scenario Tests
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -14,15 +14,15 @@
|
||||
|
||||
from neutron.tests.tempest.common import tempest_fixtures
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
|
||||
class AgentManagementTestJSON(base.BaseAdminNetworkTest):
|
||||
|
||||
required_extensions = ['agent']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="agent", service="network")
|
||||
def resource_setup(cls):
|
||||
super(AgentManagementTestJSON, cls).resource_setup()
|
||||
body = cls.admin_client.list_agents()
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
from neutron_lib import constants
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.common import utils
|
||||
from neutron.tests.tempest.api import base
|
||||
@ -22,8 +21,9 @@ from neutron.tests.tempest.api import base
|
||||
|
||||
class DHCPAgentSchedulersTestJSON(base.BaseAdminNetworkTest):
|
||||
|
||||
required_extensions = ['dhcp_agent_scheduler']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="dhcp_agent_scheduler", service="network")
|
||||
def resource_setup(cls):
|
||||
super(DHCPAgentSchedulersTestJSON, cls).resource_setup()
|
||||
# Create a network and make sure it will be hosted by a
|
||||
|
@ -24,9 +24,10 @@ from neutron.tests.tempest.api import base_security_groups as base_security
|
||||
class PortSecurityAdminTests(base_security.BaseSecGroupTest,
|
||||
base.BaseAdminNetworkTest):
|
||||
|
||||
required_extensions = ['port-security']
|
||||
|
||||
@test.attr(type='negative')
|
||||
@decorators.idempotent_id('d39a96e2-2dea-4feb-8093-e7ac991ce6f8')
|
||||
@test.requires_ext(extension='port-security', service='network')
|
||||
def test_create_port_security_false_on_shared_network(self):
|
||||
network = self.create_shared_network()
|
||||
self.assertTrue(network['shared'])
|
||||
|
@ -14,7 +14,6 @@ from oslo_config import cfg
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest import test
|
||||
import testtools
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
@ -23,9 +22,9 @@ from neutron.tests.tempest.api import base
|
||||
class ExternalNetworksRBACTestJSON(base.BaseAdminNetworkTest):
|
||||
|
||||
credentials = ['primary', 'alt', 'admin']
|
||||
required_extensions = ['rbac-policies']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="rbac-policies", service="network")
|
||||
def resource_setup(cls):
|
||||
super(ExternalNetworksRBACTestJSON, cls).resource_setup()
|
||||
cls.client2 = cls.alt_manager.network_client
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
from neutron.tests.tempest import exceptions
|
||||
@ -42,10 +41,7 @@ class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest):
|
||||
The l3_agent_scheduler extension is required for these tests.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="l3_agent_scheduler", service="network")
|
||||
def skip_checks(cls):
|
||||
super(L3AgentSchedulerTestJSON, cls).skip_checks()
|
||||
required_extensions = ['l3_agent_scheduler']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
|
@ -26,8 +26,9 @@ CONF = config.CONF
|
||||
|
||||
class QuotasTestBase(base.BaseAdminNetworkTest):
|
||||
|
||||
required_extensions = ['quotas']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="quotas", service="network")
|
||||
def resource_setup(cls):
|
||||
if not CONF.identity_feature_enabled.api_v2_admin:
|
||||
# TODO(ihrachys) adopt to v3
|
||||
|
@ -15,16 +15,15 @@
|
||||
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base_routers as base
|
||||
|
||||
|
||||
class RoutersTestDVR(base.BaseRouterTest):
|
||||
|
||||
required_extensions = ['router', 'dvr']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
@test.requires_ext(extension="dvr", service="network")
|
||||
def resource_setup(cls):
|
||||
# The check above will pass if api_extensions=all, which does
|
||||
# not mean DVR extension itself is present.
|
||||
|
@ -14,7 +14,6 @@
|
||||
from neutron_lib import constants
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest import test
|
||||
import testtools
|
||||
|
||||
from neutron.tests.tempest.api import base_routers as base
|
||||
@ -22,12 +21,7 @@ from neutron.tests.tempest.api import base_routers as base
|
||||
|
||||
class RoutersFlavorTestCase(base.BaseRouterTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
@test.requires_ext(extension="flavors", service="network")
|
||||
@test.requires_ext(extension="l3-flavors", service="network")
|
||||
def skip_checks(cls):
|
||||
super(RoutersFlavorTestCase, cls).skip_checks()
|
||||
required_extensions = ['router', 'flavors', 'l3-flavors']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
|
@ -12,16 +12,15 @@
|
||||
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base_routers as base
|
||||
|
||||
|
||||
class RoutersTestHA(base.BaseRouterTest):
|
||||
|
||||
required_extensions = ['router', 'l3-ha']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
@test.requires_ext(extension="l3-ha", service="network")
|
||||
def resource_setup(cls):
|
||||
# The check above will pass if api_extensions=all, which does
|
||||
# not mean "l3-ha" extension itself is present.
|
||||
|
@ -148,11 +148,7 @@ class SharedNetworksTest(base.BaseAdminNetworkTest):
|
||||
|
||||
class AllowedAddressPairSharedNetworkTest(base.BaseAdminNetworkTest):
|
||||
allowed_address_pairs = [{'ip_address': '1.1.1.1'}]
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="allowed-address-pairs", service="network")
|
||||
def skip_checks(cls):
|
||||
super(AllowedAddressPairSharedNetworkTest, cls).skip_checks()
|
||||
required_extensions = ['allowed-address-pairs']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
@ -178,9 +174,9 @@ class RBACSharedNetworksTest(base.BaseAdminNetworkTest):
|
||||
|
||||
force_tenant_isolation = True
|
||||
credentials = ['primary', 'alt', 'admin']
|
||||
required_extensions = ['rbac-policies']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="rbac-policies", service="network")
|
||||
def resource_setup(cls):
|
||||
super(RBACSharedNetworksTest, cls).resource_setup()
|
||||
cls.client2 = cls.alt_manager.network_client
|
||||
|
@ -76,6 +76,10 @@ class BaseNetworkTest(test.BaseTestCase):
|
||||
raise cls.skipException("Neutron support is required")
|
||||
if cls._ip_version == 6 and not CONF.network_feature_enabled.ipv6:
|
||||
raise cls.skipException("IPv6 Tests are disabled.")
|
||||
for req_ext in getattr(cls, 'required_extensions', []):
|
||||
if not test.is_extension_enabled(req_ext, 'network'):
|
||||
msg = "%s extension not enabled." % req_ext
|
||||
raise cls.skipException(msg)
|
||||
|
||||
@classmethod
|
||||
def setup_credentials(cls):
|
||||
|
@ -25,10 +25,7 @@ ADDRESS_SCOPE_NAME = 'smoke-address-scope'
|
||||
|
||||
class AddressScopeTestBase(base.BaseAdminNetworkTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="address-scope", service="network")
|
||||
def resource_setup(cls):
|
||||
super(AddressScopeTestBase, cls).resource_setup()
|
||||
required_extensions = ['address-scope']
|
||||
|
||||
def _create_address_scope(self, is_admin=False, **kwargs):
|
||||
name = data_utils.rand_name(ADDRESS_SCOPE_NAME)
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
import netaddr
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
from neutron.tests.tempest import config
|
||||
@ -39,8 +38,9 @@ class AllowedAddressPairTestJSON(base.BaseNetworkTest):
|
||||
api_extensions
|
||||
"""
|
||||
|
||||
required_extensions = ['allowed-address-pairs']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="allowed-address-pairs", service="network")
|
||||
def resource_setup(cls):
|
||||
super(AllowedAddressPairTestJSON, cls).resource_setup()
|
||||
cls.network = cls.create_network()
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
@ -31,11 +30,7 @@ class TestAutoAllocatedTopology(base.BaseAdminNetworkTest):
|
||||
# all tests are added under TestAutoAllocatedTopology,
|
||||
# nothing bad should happen.
|
||||
force_tenant_isolation = True
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="auto-allocated-topology", service="network")
|
||||
def skip_checks(cls):
|
||||
super(TestAutoAllocatedTopology, cls).skip_checks()
|
||||
required_extensions = ['auto-allocated-topology']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
@ -36,8 +35,9 @@ class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
|
||||
section of etc/tempest.conf
|
||||
"""
|
||||
|
||||
required_extensions = ['extra_dhcp_opt']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="extra_dhcp_opt", service="network")
|
||||
def resource_setup(cls):
|
||||
super(ExtraDHCPOptionsTestJSON, cls).resource_setup()
|
||||
cls.network = cls.create_network()
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
@ -29,8 +28,9 @@ class TestFlavorsJson(base.BaseAdminNetworkTest):
|
||||
List, Show, Create, Update, Delete service profiles
|
||||
"""
|
||||
|
||||
required_extensions = ['flavors']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="flavors", service="network")
|
||||
def resource_setup(cls):
|
||||
super(TestFlavorsJson, cls).resource_setup()
|
||||
|
||||
|
@ -25,8 +25,9 @@ CONF = config.CONF
|
||||
|
||||
class FloatingIPTestJSON(base.BaseNetworkTest):
|
||||
|
||||
required_extensions = ['router']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
def resource_setup(cls):
|
||||
super(FloatingIPTestJSON, cls).resource_setup()
|
||||
cls.ext_net_id = CONF.network.public_network_id
|
||||
|
@ -27,8 +27,9 @@ CONF = config.CONF
|
||||
|
||||
class FloatingIPNegativeTestJSON(base.BaseNetworkTest):
|
||||
|
||||
required_extensions = ['router']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
def resource_setup(cls):
|
||||
super(FloatingIPNegativeTestJSON, cls).resource_setup()
|
||||
cls.ext_net_id = CONF.network.public_network_id
|
||||
|
@ -15,7 +15,6 @@
|
||||
from neutron_lib.db import constants as db_const
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
@ -32,8 +31,9 @@ class MeteringTestJSON(base.BaseAdminNetworkTest):
|
||||
List, Show, Create, Delete Metering labels rules
|
||||
"""
|
||||
|
||||
required_extensions = ['metering']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="metering", service="network")
|
||||
def resource_setup(cls):
|
||||
super(MeteringTestJSON, cls).resource_setup()
|
||||
description = "metering label created by tempest"
|
||||
|
@ -24,10 +24,7 @@ LONG_NAME_NG = 'x' * (db_const.NAME_FIELD_SIZE + 1)
|
||||
|
||||
class MeteringNegativeTestJSON(base.BaseAdminNetworkTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="metering", service="network")
|
||||
def resource_setup(cls):
|
||||
super(MeteringNegativeTestJSON, cls).resource_setup()
|
||||
required_extensions = ['metering']
|
||||
|
||||
@test.attr(type='negative')
|
||||
@decorators.idempotent_id('8b3f7c84-9d37-4771-8681-bfd2c07f3c2d')
|
||||
|
@ -28,10 +28,8 @@ load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class QosTestJSON(base.BaseAdminNetworkTest):
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
def resource_setup(cls):
|
||||
super(QosTestJSON, cls).resource_setup()
|
||||
|
||||
required_extensions = ['qos']
|
||||
|
||||
@decorators.idempotent_id('108fbdf7-3463-4e47-9871-d07f3dcf5bbb')
|
||||
def test_create_policy(self):
|
||||
@ -366,9 +364,9 @@ class QosTestJSON(base.BaseAdminNetworkTest):
|
||||
class QosBandwidthLimitRuleTestJSON(base.BaseAdminNetworkTest):
|
||||
|
||||
direction = None
|
||||
required_extensions = ['qos']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
@base.require_qos_rule_type(qos_consts.RULE_TYPE_BANDWIDTH_LIMIT)
|
||||
def resource_setup(cls):
|
||||
super(QosBandwidthLimitRuleTestJSON, cls).resource_setup()
|
||||
@ -550,24 +548,23 @@ class QosBandwidthLimitRuleTestJSON(base.BaseAdminNetworkTest):
|
||||
class QosBandwidthLimitRuleWithDirectionTestJSON(
|
||||
QosBandwidthLimitRuleTestJSON):
|
||||
|
||||
required_extensions = (
|
||||
QosBandwidthLimitRuleTestJSON.required_extensions +
|
||||
['qos-bw-limit-direction']
|
||||
)
|
||||
scenarios = [
|
||||
('ingress', {'direction': 'ingress'}),
|
||||
('egress', {'direction': 'egress'}),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos-bw-limit-direction", service="network")
|
||||
def resource_setup(cls):
|
||||
super(QosBandwidthLimitRuleWithDirectionTestJSON, cls).resource_setup()
|
||||
|
||||
|
||||
class RbacSharedQosPoliciesTest(base.BaseAdminNetworkTest):
|
||||
|
||||
force_tenant_isolation = True
|
||||
credentials = ['primary', 'alt', 'admin']
|
||||
required_extensions = ['qos']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
def resource_setup(cls):
|
||||
super(RbacSharedQosPoliciesTest, cls).resource_setup()
|
||||
cls.client2 = cls.alt_manager.network_client
|
||||
@ -818,8 +815,9 @@ class QosDscpMarkingRuleTestJSON(base.BaseAdminNetworkTest):
|
||||
VALID_DSCP_MARK1 = 56
|
||||
VALID_DSCP_MARK2 = 48
|
||||
|
||||
required_extensions = ['qos']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
@base.require_qos_rule_type(qos_consts.RULE_TYPE_DSCP_MARKING)
|
||||
def resource_setup(cls):
|
||||
super(QosDscpMarkingRuleTestJSON, cls).resource_setup()
|
||||
@ -951,9 +949,9 @@ class QosMinimumBandwidthRuleTestJSON(base.BaseAdminNetworkTest):
|
||||
DIRECTION_INGRESS = "ingress"
|
||||
RULE_NAME = qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH + "_rule"
|
||||
RULES_NAME = RULE_NAME + "s"
|
||||
required_extensions = ['qos']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
@base.require_qos_rule_type(qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH)
|
||||
def resource_setup(cls):
|
||||
super(QosMinimumBandwidthRuleTestJSON, cls).resource_setup()
|
||||
@ -1113,8 +1111,9 @@ class QosSearchCriteriaTest(base.BaseSearchCriteriaTest,
|
||||
list_kwargs = {'description': 'search-criteria-test'}
|
||||
list_as_admin = True
|
||||
|
||||
required_extensions = ['qos']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
def resource_setup(cls):
|
||||
super(QosSearchCriteriaTest, cls).resource_setup()
|
||||
for name in cls.resource_names:
|
||||
|
@ -23,10 +23,8 @@ LONG_TENANT_ID_NG = 'z' * (db_const.PROJECT_ID_FIELD_SIZE + 1)
|
||||
|
||||
|
||||
class QosNegativeTestJSON(base.BaseAdminNetworkTest):
|
||||
@classmethod
|
||||
@test.requires_ext(extension="qos", service="network")
|
||||
def resource_setup(cls):
|
||||
super(QosNegativeTestJSON, cls).resource_setup()
|
||||
|
||||
required_extensions = ['qos']
|
||||
|
||||
@test.attr(type='negative')
|
||||
@decorators.idempotent_id('b9dce555-d3b3-11e5-950a-54ee757c77da')
|
||||
|
@ -22,10 +22,7 @@ from neutron.tests.tempest import config
|
||||
|
||||
class TestRevisions(base.BaseAdminNetworkTest, bsg.BaseSecGroupTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="standard-attr-revisions", service="network")
|
||||
def skip_checks(cls):
|
||||
super(TestRevisions, cls).skip_checks()
|
||||
required_extensions = ['standard-attr-revisions']
|
||||
|
||||
@decorators.idempotent_id('4a26a4be-9c53-483c-bc50-b53f1db10ac6')
|
||||
def test_update_network_bumps_revision(self):
|
||||
|
@ -28,10 +28,7 @@ CONF = config.CONF
|
||||
|
||||
class RoutersTest(base_routers.BaseRouterTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
def skip_checks(cls):
|
||||
super(RoutersTest, cls).skip_checks()
|
||||
required_extensions = ['router']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
@ -231,10 +228,7 @@ class RoutersIpV6Test(RoutersTest):
|
||||
|
||||
class DvrRoutersTest(base_routers.BaseRouterTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="dvr", service="network")
|
||||
def skip_checks(cls):
|
||||
super(DvrRoutersTest, cls).skip_checks()
|
||||
required_extensions = ['dvr']
|
||||
|
||||
@decorators.idempotent_id('141297aa-3424-455d-aa8d-f2d95731e00a')
|
||||
def test_create_distributed_router(self):
|
||||
@ -261,10 +255,7 @@ class DvrRoutersTest(base_routers.BaseRouterTest):
|
||||
|
||||
class HaRoutersTest(base_routers.BaseRouterTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="l3-ha", service="network")
|
||||
def skip_checks(cls):
|
||||
super(HaRoutersTest, cls).skip_checks()
|
||||
required_extensions = ['l3-ha']
|
||||
|
||||
@decorators.idempotent_id('77db8eae-3aa3-4e61-bf2a-e739ce042e53')
|
||||
def test_convert_legacy_router(self):
|
||||
@ -281,13 +272,9 @@ class HaRoutersTest(base_routers.BaseRouterTest):
|
||||
|
||||
class RoutersSearchCriteriaTest(base.BaseSearchCriteriaTest):
|
||||
|
||||
required_extensions = ['router']
|
||||
resource = 'router'
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
def skip_checks(cls):
|
||||
super(RoutersSearchCriteriaTest, cls).skip_checks()
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(RoutersSearchCriteriaTest, cls).resource_setup()
|
||||
|
@ -24,10 +24,7 @@ from neutron.tests.tempest.api import base_routers as base
|
||||
|
||||
class RoutersNegativeTestBase(base.BaseRouterTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="router", service="network")
|
||||
def skip_checks(cls):
|
||||
super(RoutersNegativeTestBase, cls).skip_checks()
|
||||
required_extensions = ['router']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
@ -74,10 +71,7 @@ class RoutersNegativePolicyTest(RoutersNegativeTestBase):
|
||||
|
||||
class DvrRoutersNegativeTest(RoutersNegativeTestBase):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="dvr", service="network")
|
||||
def skip_checks(cls):
|
||||
super(DvrRoutersNegativeTest, cls).skip_checks()
|
||||
required_extensions = ['dvr']
|
||||
|
||||
@test.attr(type='negative')
|
||||
@decorators.idempotent_id('4990b055-8fc7-48ab-bba7-aa28beaad0b9')
|
||||
@ -89,10 +83,7 @@ class DvrRoutersNegativeTest(RoutersNegativeTestBase):
|
||||
|
||||
class HaRoutersNegativeTest(RoutersNegativeTestBase):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="l3-ha", service="network")
|
||||
def skip_checks(cls):
|
||||
super(HaRoutersNegativeTest, cls).skip_checks()
|
||||
required_extensions = ['l3-ha']
|
||||
|
||||
@test.attr(type='negative')
|
||||
@decorators.idempotent_id('821b85b9-9c51-40f3-831f-bf223a7e0084')
|
||||
|
@ -15,17 +15,13 @@
|
||||
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base_security_groups as base
|
||||
|
||||
|
||||
class SecGroupTest(base.BaseSecGroupTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="security-group", service="network")
|
||||
def resource_setup(cls):
|
||||
super(SecGroupTest, cls).resource_setup()
|
||||
required_extensions = ['security-group']
|
||||
|
||||
@decorators.idempotent_id('bfd128e5-3c92-44b6-9d66-7fe29d22c802')
|
||||
def test_create_list_update_show_delete_security_group(self):
|
||||
|
@ -25,10 +25,7 @@ LONG_NAME_NG = 'x' * (db_const.NAME_FIELD_SIZE + 1)
|
||||
|
||||
class NegativeSecGroupTest(base.BaseSecGroupTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="security-group", service="network")
|
||||
def resource_setup(cls):
|
||||
super(NegativeSecGroupTest, cls).resource_setup()
|
||||
required_extensions = ['security-group']
|
||||
|
||||
@test.attr(type='negative')
|
||||
@decorators.idempotent_id('594edfa8-9a5b-438e-9344-49aece337d49')
|
||||
|
@ -11,17 +11,13 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
|
||||
class ServiceTypeManagementTest(base.BaseNetworkTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="service-type", service="network")
|
||||
def resource_setup(cls):
|
||||
super(ServiceTypeManagementTest, cls).resource_setup()
|
||||
required_extensions = ['service-type']
|
||||
|
||||
@decorators.idempotent_id('2cbbeea9-f010-40f6-8df5-4eaa0c918ea6')
|
||||
def test_service_provider_list(self):
|
||||
|
@ -19,8 +19,9 @@ from neutron.tests.tempest.api import base
|
||||
|
||||
class TagTestJSON(base.BaseAdminNetworkTest):
|
||||
|
||||
required_extensions = ['tag']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="tag", service="network")
|
||||
def resource_setup(cls):
|
||||
super(TagTestJSON, cls).resource_setup()
|
||||
cls.res_id = cls._create_resource()
|
||||
@ -150,9 +151,9 @@ class TagRouterTestJSON(TagTestJSON):
|
||||
|
||||
class TagFilterTestJSON(base.BaseAdminNetworkTest):
|
||||
credentials = ['primary', 'alt', 'admin']
|
||||
required_extensions = ['tag']
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="tag", service="network")
|
||||
def resource_setup(cls):
|
||||
super(TagFilterTestJSON, cls).resource_setup()
|
||||
|
||||
@ -319,10 +320,7 @@ class TagFilterRouterTestJSON(TagFilterTestJSON):
|
||||
|
||||
class UpdateTagsTest(base.BaseAdminNetworkTest):
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="tag", service="network")
|
||||
def resource_setup(cls):
|
||||
super(UpdateTagsTest, cls).resource_setup()
|
||||
required_extensions = ['tag']
|
||||
|
||||
def _get_and_compare_tags(self, tags, res_id):
|
||||
# nothing specific about networks here, just a resource that is
|
||||
|
@ -14,7 +14,6 @@ import copy
|
||||
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest import test
|
||||
|
||||
from neutron.tests.tempest.api import base
|
||||
from neutron.tests.tempest.api import base_routers
|
||||
@ -26,6 +25,8 @@ CONF = config.CONF
|
||||
|
||||
class TestTimeStamp(base.BaseAdminNetworkTest):
|
||||
|
||||
required_extensions = ["standard-attr-timestamp"]
|
||||
|
||||
## attributes for subnetpool
|
||||
min_prefixlen = '28'
|
||||
max_prefixlen = '31'
|
||||
@ -34,11 +35,6 @@ class TestTimeStamp(base.BaseAdminNetworkTest):
|
||||
new_prefix = '10.11.15.0/24'
|
||||
larger_prefix = '10.11.0.0/16'
|
||||
|
||||
@classmethod
|
||||
@test.requires_ext(extension="standard-attr-timestamp", service="network")
|
||||
def skip_checks(cls):
|
||||
super(TestTimeStamp, cls).skip_checks()
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(TestTimeStamp, cls).resource_setup()
|
||||
@ -183,13 +179,8 @@ class TestTimeStamp(base.BaseAdminNetworkTest):
|
||||
|
||||
|
||||
class TestTimeStampWithL3(base_routers.BaseRouterTest):
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(TestTimeStampWithL3, cls).skip_checks()
|
||||
|
||||
if not test.is_extension_enabled('standard-attr-timestamp', 'network'):
|
||||
raise cls.skipException("standard-attr-timestamp extension not "
|
||||
"enabled")
|
||||
required_extensions = ['standard-attr-timestamp']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
@ -260,13 +251,8 @@ class TestTimeStampWithL3(base_routers.BaseRouterTest):
|
||||
|
||||
|
||||
class TestTimeStampWithSecurityGroup(base_security_groups.BaseSecGroupTest):
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(TestTimeStampWithSecurityGroup, cls).skip_checks()
|
||||
|
||||
if not test.is_extension_enabled('standard-attr-timestamp', 'network'):
|
||||
raise cls.skipException("standard-attr-timestamp extension not "
|
||||
"enabled")
|
||||
required_extensions = ['standard-attr-timestamp']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
|
@ -38,19 +38,12 @@ def trunks_cleanup(client, trunks):
|
||||
|
||||
class TrunkTestJSONBase(base.BaseAdminNetworkTest):
|
||||
|
||||
extension = 'trunk'
|
||||
required_extensions = ['trunk']
|
||||
|
||||
def setUp(self):
|
||||
self.addCleanup(self.resource_cleanup)
|
||||
super(TrunkTestJSONBase, self).setUp()
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(TrunkTestJSONBase, cls).skip_checks()
|
||||
if not test.is_extension_enabled(cls.extension, 'network'):
|
||||
msg = "%s extension not enabled." % cls.extension
|
||||
raise cls.skipException(msg)
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(TrunkTestJSONBase, cls).resource_setup()
|
||||
@ -227,10 +220,6 @@ class TrunkTestInheritJSONBase(TrunkTestJSONBase):
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(TrunkTestInheritJSONBase, cls).skip_checks()
|
||||
for ext in cls.required_extensions:
|
||||
if not test.is_extension_enabled(ext, 'network'):
|
||||
msg = "%s extension not enabled." % ext
|
||||
raise cls.skipException(msg)
|
||||
if ("vlan" not in
|
||||
config.CONF.neutron_plugin_options.available_type_drivers):
|
||||
raise cls.skipException("VLAN type_driver is not enabled")
|
||||
@ -277,11 +266,6 @@ class TrunkTestMtusJSONBase(TrunkTestJSONBase):
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(TrunkTestMtusJSONBase, cls).skip_checks()
|
||||
for ext in cls.required_extensions:
|
||||
if not test.is_extension_enabled(ext, 'network'):
|
||||
msg = "%s extension not enabled." % ext
|
||||
raise cls.skipException(msg)
|
||||
|
||||
if any(t
|
||||
not in config.CONF.neutron_plugin_options.available_type_drivers
|
||||
for t in ['gre', 'vxlan']):
|
||||
@ -351,15 +335,9 @@ class TrunkTestMtusJSON(TrunkTestMtusJSONBase):
|
||||
|
||||
class TrunksSearchCriteriaTest(base.BaseSearchCriteriaTest):
|
||||
|
||||
required_extensions = ['trunk']
|
||||
resource = 'trunk'
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(TrunksSearchCriteriaTest, cls).skip_checks()
|
||||
if not test.is_extension_enabled('trunk', 'network'):
|
||||
msg = "trunk extension not enabled."
|
||||
raise cls.skipException(msg)
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(TrunksSearchCriteriaTest, cls).resource_setup()
|
||||
|
@ -19,7 +19,7 @@ from neutron.tests.tempest.api import test_trunk
|
||||
|
||||
class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):
|
||||
|
||||
extension = 'trunk-details'
|
||||
required_extensions = ['trunk-details']
|
||||
|
||||
@decorators.idempotent_id('f0bed24f-d36a-498b-b4e7-0d66e3fb7308')
|
||||
def test_port_resource_trunk_details_no_subports(self):
|
||||
|
Loading…
Reference in New Issue
Block a user