@@ -0,0 +1,2509 @@
+# Copyright (c) 2021 Red Hat Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#    http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or%0A# implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0Afrom oslo_policy import policy as base_policy%0A%0Afrom neutron import policy%0Afrom neutron.tests.unit.conf.policies import base%0A%0A%0Aclass FloatingipPoolsAPITestCase(base.PolicyBaseTestCase):%0A%0A    def setUp(self):%0A        super(FloatingipPoolsAPITestCase, self).setUp()%0A        self.target = %7B'project_id': self.project_id%7D%0A%0A%0Aclass SystemAdminTests(FloatingipPoolsAPITestCase):%0A%0A    def setUp(self):%0A        super(SystemAdminTests, self).setUp()%0A        self.context = self.system_admin_ctx%0A%0A    def test_get_floatingip_pool(self):%0A        self.assertTrue(%0A            policy.enforce(self.context, 'get_floatingip_pool',%0A                           self.target))%0A%0A%0Aclass SystemMemberTests(SystemAdminTests):%0A%0A    def setUp(self):%0A        super(SystemMemberTests, self).setUp()%0A        self.context = self.system_member_ctx%0A%0A%0Aclass SystemReaderTests(SystemAdminTests):%0A%0A    def setUp(self):%0A        super(SystemReaderTests, self).setUp()%0A        self.context = self.system_reader_ctx%0A%0A%0Aclass ProjectAdminTests(FloatingipPoolsAPITestCase):%0A%0A    def setUp(self):%0A        super(ProjectAdminTests, self).setUp()%0A        self.alt_target = %7B'project_id': self.alt_project_id%7D%0A        self.context = self.project_admin_ctx%0A%0A    def test_get_floatingip_pool(self):%0A        self.assertTrue(%0A            policy.enforce(self.context, 'get_floatingip_pool',%0A                           self.target))%0A%0A    def test_get_floatingip_pool_other_project(self):%0A        self.assertRaises(%0A            base_policy.PolicyNotAuthorized,%0A            policy.enforce,%0A            self.context, 'get_floatingip_pool', self.alt_target)%0A%0A%0Aclass ProjectMemberTests(ProjectAdminTests):%0A%0A    def setUp(self):%0A        super(ProjectMemberTests, self).setUp()%0A        self.context = self.project_member_ctx%0A%0A%0Aclass ProjectReaderTests(ProjectAdminTests):%0A%0A    def setUp(self):%0A        super(ProjectReaderTests, self).setUp()%0A        self.context = self.project_reader_ctx%0A

Add tests for floatingip pools API's new policy rules