| 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 |
|
| 13 |
from magnum_tempest_plugin.common.templates import cluster |
| 14 |
|
| 15 |
IDEMPOTENT_IDS = { |
| 16 |
"test_delete_cluster_for_nonexisting_cluster": ( |
| 17 |
"376c45ea-a857-11e9-9382-00224d6b7bc1"), |
| 18 |
"test_update_cluster_for_nonexisting_cluster": ( |
| 19 |
"33bd0416-a857-11e9-9382-00224d6b7bc1"), |
| 20 |
"test_create_cluster_with_nonexisting_flavor": ( |
| 21 |
"2cf16528-a857-11e9-9382-00224d6b7bc1"), |
| 22 |
"test_create_cluster_with_zero_masters": ( |
| 23 |
"29c6c5f0-a857-11e9-9382-00224d6b7bc1"), |
| 24 |
"test_create_cluster_with_zero_nodes": ( |
| 25 |
"262eb132-a857-11e9-9382-00224d6b7bc1"), |
| 26 |
"test_create_cluster_for_nonexisting_cluster_template": ( |
| 27 |
"11c293da-a857-11e9-9382-00224d6b7bc1"), |
| 28 |
"test_create_list_sign_delete_clusters": ( |
| 29 |
"44158a8c-a856-11e9-9382-00224d6b7bc1"), |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
class ClusterTest(cluster.ClusterTestTemplate): |
| 34 |
|
| 35 |
"""Tests for cluster CRUD.""" |
| 36 |
|
| 37 |
@classmethod |
| 38 |
def setUpClass(cls): |
| 39 |
super(ClusterTest, cls).setUpClass() |
| 40 |
|
| 41 |
try: |
| 42 |
(cls.creds, cls.keypair) = cls.get_credentials_with_keypair( |
| 43 |
type_of_creds='default' |
| 44 |
) |
| 45 |
(cls.cluster_template_client, |
| 46 |
cls.keypairs_client) = cls.get_clients_with_existing_creds( |
| 47 |
creds=cls.creds, |
| 48 |
type_of_creds='default', |
| 49 |
request_type='cluster_template' |
| 50 |
) |
| 51 |
cls.ct_reader_client = cls.cluster_template_client |
| 52 |
cls.ct_member_client = cls.cluster_template_client |
| 53 |
cls.ct_admin_client = cls.cluster_template_client |
| 54 |
(cls.cluster_client, _) = cls.get_clients_with_existing_creds( |
| 55 |
creds=cls.creds, |
| 56 |
type_of_creds='default', |
| 57 |
request_type='cluster' |
| 58 |
) |
| 59 |
cls.cluster_reader_client = cls.cluster_client |
| 60 |
cls.cluster_member_client = cls.cluster_client |
| 61 |
cls.cluster_admin_client = cls.cluster_client |
| 62 |
(cls.cert_client, _) = cls.get_clients_with_existing_creds( |
| 63 |
creds=cls.creds, |
| 64 |
type_of_creds='default', |
| 65 |
request_type='cert' |
| 66 |
) |
| 67 |
cls.cert_reader_client = cls.cert_client |
| 68 |
cls.cert_member_client = cls.cert_client |
| 69 |
cls.cert_admin_client = cls.cert_client |
| 70 |
|
| 71 |
cls._setup_cluster_template() |
| 72 |
except Exception: |
| 73 |
raise |