Debian Codegraph @

magnum_tempest_plugin/tests/api/v1/rbac/test_cluster.py

raw
1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
2 # not use this file except in compliance with the License. You may obtain
3 # a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 # License for the specific language governing permissions and limitations
11 # under the License.
12 import abc
13
14 from magnum_tempest_plugin.common.templates import cluster
15 from magnum_tempest_plugin.tests.api.v1.rbac import base
16
17 IDEMPOTENT_IDS = {
18 "test_delete_cluster_for_nonexisting_cluster": (
19 "09589881-e3c1-4507-9ded-55994e46963f"),
20 "test_update_cluster_for_nonexisting_cluster": (
21 "145d02ee-a804-476a-948f-727099c3525d"),
22 "test_create_cluster_with_nonexisting_flavor": (
23 "a08f129e-b0cb-411b-9cc0-e6b97db3d6d7"),
24 "test_create_cluster_with_zero_masters": (
25 "9eee202d-77a0-43e0-b5e3-657ab5d46835"),
26 "test_create_cluster_with_zero_nodes": (
27 "bdfb3894-d970-4e35-95b3-fec3e8a717ae"),
28 "test_create_cluster_for_nonexisting_cluster_template": (
29 "f3be4b27-62f1-46d4-8c07-8b7315a2b4c3"),
30 "test_create_list_sign_delete_clusters": (
31 "b03cb130-d2ca-4721-8298-b491020d72db"),
32 }
33
34
35 class ClusterTest(base.RbacBaseTests,
36 cluster.ClusterTestTemplate,
37 metaclass=abc.ABCMeta):
38
39 """Tests for cluster CRUD with RBAC."""
40
41 @classmethod
42 def tearDownClass(cls):
43 if cls.delete_template:
44 cls._delete_cluster_template(cls.cluster_template.uuid)
45 super(ClusterTest, cls).tearDownClass()
46
47 def setUp(self):
48 super(ClusterTest, self).setUp()
49 self._setup_cluster_template()