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