From: Miguel Angel Ajo Date: Thu, 20 Aug 2015 13:57:19 +0000 (+0200) Subject: Fix qos api-tests after policy changes X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7b960af9b0ff44ed0e2a7bcfa7c40200552bbc6b;p=openstack-build%2Fneutron-build.git Fix qos api-tests after policy changes The policy.json update in change Ide1cd30979f99612fe89dddf3dc0e029d3f4d34a breaks the qos api-tests due to actions which the default policy won't allow, like qos rules or policies creation by non-admins. We removed test_rule_association_nonshared_policy which is not possible with the default policy.json in favor of test_policy_create_forbidden_for_regular_tenants. This commit unblocks the qos api-test re-enablement. Partially-Implements: blueprint quantum-qos-api Change-Id: Ib77412bd95ad5b65ad0f6964d9809b5f707847f5 --- diff --git a/neutron/tests/api/test_qos.py b/neutron/tests/api/test_qos.py index d281094b3..c5846ed4a 100644 --- a/neutron/tests/api/test_qos.py +++ b/neutron/tests/api/test_qos.py @@ -390,13 +390,17 @@ class QosBandwidthLimitRuleTestJSON(base.BaseAdminNetworkTest): 'policy', 200, 1337) @test.attr(type='smoke') - @test.idempotent_id('3ba4abf9-7976-4eaf-a5d0-a934a6e09b2d') - def test_rule_association_nonshared_policy(self): - policy = self.create_qos_policy(name='test-policy', - description='test policy', - shared=False, - tenant_id='tenant-id') + @test.idempotent_id('eed8e2a6-22da-421b-89b9-935a2c1a1b50') + def test_policy_create_forbidden_for_regular_tenants(self): self.assertRaises( - exceptions.NotFound, + exceptions.Forbidden, + self.client.create_qos_policy, + 'test-policy', 'test policy', False) + + @test.attr(type='smoke') + @test.idempotent_id('a4a2e7ad-786f-4927-a85a-e545a93bd274') + def test_rule_create_forbidden_for_regular_tenants(self): + self.assertRaises( + exceptions.Forbidden, self.client.create_bandwidth_limit_rule, - policy['id'], 200, 1337) + 'policy', 1, 2)