From: YAMAMOTO Takashi Date: Thu, 17 Sep 2015 23:29:28 +0000 (+0900) Subject: api test: Skip address-scope tests when the extension is not enabled X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=50397d43d2bc98389753782418da3c6a37cac4b3;p=openstack-build%2Fneutron-build.git api test: Skip address-scope tests when the extension is not enabled Closes-Bug: #1497186 Change-Id: I6802e0f3e9c1b5e42dd77ac647f7a6bb96a07dfc --- diff --git a/neutron/tests/api/test_address_scopes.py b/neutron/tests/api/test_address_scopes.py index a80319b39..b68e90996 100644 --- a/neutron/tests/api/test_address_scopes.py +++ b/neutron/tests/api/test_address_scopes.py @@ -29,6 +29,9 @@ class AddressScopeTestBase(base.BaseNetworkTest): @classmethod def resource_setup(cls): super(AddressScopeTestBase, cls).resource_setup() + if not test.is_extension_enabled('address-scope', 'network'): + msg = "address-scope extension not enabled." + raise cls.skipException(msg) try: creds = cls.isolated_creds.get_admin_creds() cls.os_adm = clients.Manager(credentials=creds) diff --git a/neutron/tests/api/test_subnetpools.py b/neutron/tests/api/test_subnetpools.py index f307feaaf..66241b311 100644 --- a/neutron/tests/api/test_subnetpools.py +++ b/neutron/tests/api/test_subnetpools.py @@ -241,6 +241,7 @@ class SubnetPoolsTest(base.BaseNetworkTest): @test.attr(type='smoke') @test.idempotent_id('49b44c64-1619-4b29-b527-ffc3c3115dc4') + @test.requires_ext(extension='address-scope', service='network') def test_create_subnetpool_associate_address_scope(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope')) @@ -253,6 +254,7 @@ class SubnetPoolsTest(base.BaseNetworkTest): @test.attr(type='smoke') @test.idempotent_id('910b6393-db24-4f6f-87dc-b36892ad6c8c') + @test.requires_ext(extension='address-scope', service='network') def test_update_subnetpool_associate_address_scope(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope')) @@ -269,6 +271,7 @@ class SubnetPoolsTest(base.BaseNetworkTest): @test.attr(type='smoke') @test.idempotent_id('18302e80-46a3-4563-82ac-ccd1dd57f652') + @test.requires_ext(extension='address-scope', service='network') def test_update_subnetpool_associate_another_address_scope(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope')) @@ -291,6 +294,7 @@ class SubnetPoolsTest(base.BaseNetworkTest): @test.attr(type='smoke') @test.idempotent_id('f8970048-e41b-42d6-934b-a1297b07706a') + @test.requires_ext(extension='address-scope', service='network') def test_update_subnetpool_disassociate_address_scope(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope')) diff --git a/neutron/tests/api/test_subnetpools_negative.py b/neutron/tests/api/test_subnetpools_negative.py index 76e9ff51a..c3a697456 100644 --- a/neutron/tests/api/test_subnetpools_negative.py +++ b/neutron/tests/api/test_subnetpools_negative.py @@ -143,6 +143,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('9589e332-638e-476e-81bd-013d964aa3cb') + @test.requires_ext(extension='address-scope', service='network') def test_create_subnetpool_associate_invalid_address_scope(self): subnetpool_data = copy.deepcopy(self._subnetpool_data) subnetpool_data['subnetpool']['address_scope_id'] = 'foo-addr-scope' @@ -151,6 +152,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('3b6c5942-485d-4964-a560-55608af020b5') + @test.requires_ext(extension='address-scope', service='network') def test_create_subnetpool_associate_non_exist_address_scope(self): subnetpool_data = copy.deepcopy(self._subnetpool_data) non_exist_address_scope_id = str(uuid.uuid4()) @@ -161,6 +163,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('2dfb4269-8657-485a-a053-b022e911456e') + @test.requires_ext(extension='address-scope', service='network') def test_create_subnetpool_associate_address_scope_prefix_intersect(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope')) @@ -177,6 +180,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('83a19a13-5384-42e2-b579-43fc69c80914') + @test.requires_ext(extension='address-scope', service='network') def test_create_sp_associate_address_scope_multiple_prefix_intersect(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope')) @@ -197,6 +201,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('f06d8e7b-908b-4e94-b570-8156be6a4bf1') + @test.requires_ext(extension='address-scope', service='network') def test_create_subnetpool_associate_address_scope_of_other_owner(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope'), is_admin=True) @@ -208,6 +213,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('3396ec6c-cb80-4ebe-b897-84e904580bdf') + @test.requires_ext(extension='address-scope', service='network') def test_tenant_create_subnetpool_associate_shared_address_scope(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope'), is_admin=True, @@ -220,6 +226,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type='smoke') @test.idempotent_id('6d3d9ad5-32d4-4d63-aa00-8c62f73e2881') + @test.requires_ext(extension='address-scope', service='network') def test_update_subnetpool_associate_address_scope_of_other_owner(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope'), is_admin=True) @@ -260,6 +267,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('96006292-7214-40e0-a471-153fb76e6b31') + @test.requires_ext(extension='address-scope', service='network') def test_update_subnetpool_prefix_intersect(self): pool_1_prefix = [u'20.0.0.0/18'] pool_2_prefix = [u'20.10.0.0/24'] @@ -269,6 +277,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('4d3f8a79-c530-4e59-9acf-6c05968adbfe') + @test.requires_ext(extension='address-scope', service='network') def test_update_subnetpool_multiple_prefix_intersect(self): pool_1_prefixes = [u'20.0.0.0/18', u'30.0.0.0/18'] pool_2_prefixes = [u'20.10.0.0/24', u'40.0.0.0/18', '50.0.0.0/18'] @@ -279,6 +288,7 @@ class SubnetPoolsNegativeTestJSON(base.BaseNetworkTest): @test.attr(type=['negative', 'smoke']) @test.idempotent_id('7438e49e-1351-45d8-937b-892059fb97f5') + @test.requires_ext(extension='address-scope', service='network') def test_tenant_update_sp_prefix_associated_with_shared_addr_scope(self): address_scope = self.create_address_scope( name=data_utils.rand_name('smoke-address-scope'), is_admin=True,