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
This commit is contained in:
Miguel Angel Ajo 2015-08-20 15:57:19 +02:00
parent 81b2be5d38
commit 7b960af9b0
1 changed files with 12 additions and 8 deletions

View File

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