]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix qos api-tests after policy changes
authorMiguel Angel Ajo <mangelajo@redhat.com>
Thu, 20 Aug 2015 13:57:19 +0000 (15:57 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Thu, 20 Aug 2015 16:27:52 +0000 (18:27 +0200)
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

neutron/tests/api/test_qos.py

index d281094b36d66a889b4fe209565f11e687919426..c5846ed4a7c80b9169e925ee82c0095664292241 100644 (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)