| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 1 | # Copyright 2020 Canonical Ltd. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [K8s-02] K8s cluster addition. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 17 | |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library Process |
| 22 | |
| 23 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot |
| Mark Beierl | 9e36736 | 2022-12-09 10:20:45 -0500 | [diff] [blame] | 24 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot |
| 25 | |
| 26 | Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 27 | |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 28 | Force Tags k8s_02 cluster_k8s daily regression |
| 29 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 30 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 31 | |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 32 | |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 33 | *** Variables *** |
| 34 | # K8s cluster name and version |
| aguilard | d6a44ef | 2021-09-14 17:46:17 +0200 | [diff] [blame] | 35 | ${k8scluster_name} k8s02 |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 36 | ${k8scluster_version} v1 |
| 37 | |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 38 | *** Test Cases *** |
| Mark Beierl | 9e36736 | 2022-12-09 10:20:45 -0500 | [diff] [blame] | 39 | Create VIM Target Basic |
| 40 | [Documentation] Creates a VIM for the K8s cluster to be anchored against |
| 41 | |
| 42 | ${rand}= Generate Random String 6 [NUMBERS] |
| 43 | ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} |
| 44 | Set Suite Variable ${vim_name} |
| 45 | ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} |
| 46 | Set Suite Variable ${created_vim_account_id} |
| 47 | |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 48 | Add K8s Cluster To OSM |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 49 | |
| Mark Beierl | 9e36736 | 2022-12-09 10:20:45 -0500 | [diff] [blame] | 50 | Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} ${vim_name} %{VIM_MGMT_NET} ${k8scluster_name} |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 51 | |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 52 | Remove K8s Cluster from OSM |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 53 | [Tags] cleanup |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 54 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 55 | Delete K8s Cluster ${k8scluster_name} |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 56 | |
| Mark Beierl | 9e36736 | 2022-12-09 10:20:45 -0500 | [diff] [blame] | 57 | Delete VIM Target By ID |
| 58 | [Documentation] Delete the VIM Target created in previous test-case by its ID. |
| 59 | ... Checks whether the VIM Target was created or not before perform the deletion. |
| 60 | [Tags] cleanup |
| 61 | |
| 62 | ${vim_account_id}= Get VIM Target ID ${vim_name} |
| 63 | Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} |
| 64 | Delete VIM Target ${vim_account_id} |
| 65 | |
| 66 | |
| Felipe Vicens | 5c54d27 | 2020-06-23 15:55:08 +0200 | [diff] [blame] | 67 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 68 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 69 | [Documentation] Test Suit Cleanup: Deleting K8s Cluster |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 70 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 71 | Run Keyword If Any Tests Failed Delete K8s Cluster ${k8scluster_name} |