blob: 3e4c7417c79aa9fb0fbb7676dbbe02bc094c47c2 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Felipe Vicens5c54d272020-06-23 15:55:08 +02002# 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
garciadeblas7a9e0312023-12-11 22:24:46 +010016
Felipe Vicens5c54d272020-06-23 15:55:08 +020017*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020018Documentation [K8s-02] K8s cluster addition.
garciadeblas4cf45d72021-04-08 13:52:22 +020019
Felipe Vicens5c54d272020-06-23 15:55:08 +020020Library OperatingSystem
21Library String
22Library Collections
23Library Process
24
garciadeblas7a9e0312023-12-11 22:24:46 +010025Resource ../lib/k8scluster_lib.resource
26Resource ../lib/vim_lib.resource
Mark Beierl9e367362022-12-09 10:20:45 -050027
garciadeblas7a9e0312023-12-11 22:24:46 +010028Variables ../resources/basic_01-crud_operations_on_vim_targets_data.py
Felipe Vicens5c54d272020-06-23 15:55:08 +020029
garciadeblas7a9e0312023-12-11 22:24:46 +010030Test Tags k8s_02 cluster_k8s daily regression azure
garciadeblas4cf45d72021-04-08 13:52:22 +020031
garciadeblasd225e552020-10-02 16:10:14 +000032Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Felipe Vicens5c54d272020-06-23 15:55:08 +020033
garciadeblas4cf45d72021-04-08 13:52:22 +020034
almagiab4697d32021-05-25 08:56:17 +020035*** Variables ***
36# K8s cluster name and version
garciadeblas7a9e0312023-12-11 22:24:46 +010037${K8SCLUSTER_NAME} k8s02
38${K8SCLUSTER_VERSION} v1
39
almagiab4697d32021-05-25 08:56:17 +020040
Felipe Vicens5c54d272020-06-23 15:55:08 +020041*** Test Cases ***
Mark Beierl9e367362022-12-09 10:20:45 -050042Create VIM Target Basic
43 [Documentation] Creates a VIM for the K8s cluster to be anchored against
Mark Beierl9e367362022-12-09 10:20:45 -050044 ${rand}= Generate Random String 6 [NUMBERS]
garciadeblas7a9e0312023-12-11 22:24:46 +010045 ${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 Beierl9e367362022-12-09 10:20:45 -050049
Felipe Vicens5c54d272020-06-23 15:55:08 +020050Add K8s Cluster To OSM
garciadeblas7a9e0312023-12-11 22:24:46 +010051 [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}
garciadeblas93e5cc22023-12-17 01:40:23 +010053 Check For K8s Cluster To Be Ready ${K8SCLUSTER_NAME}
Felipe Vicens5c54d272020-06-23 15:55:08 +020054
Felipe Vicens5c54d272020-06-23 15:55:08 +020055Remove K8s Cluster from OSM
garciadeblas7a9e0312023-12-11 22:24:46 +010056 [Documentation] Delete K8s cluster.
garciadeblas4cf45d72021-04-08 13:52:22 +020057 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010058 Delete K8s Cluster ${K8SCLUSTER_NAME}
Felipe Vicens5c54d272020-06-23 15:55:08 +020059
Mark Beierl9e367362022-12-09 10:20:45 -050060Delete 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
garciadeblas7a9e0312023-12-11 22:24:46 +010065 ${vim_account_id}= Get VIM Target ID ${VIM_NAME}
66 Should Be Equal As Strings ${vim_account_id} ${CREATED_VIM_ACCOUNT_ID}
Mark Beierl9e367362022-12-09 10:20:45 -050067 Delete VIM Target ${vim_account_id}
68
69
Felipe Vicens5c54d272020-06-23 15:55:08 +020070*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +000071Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +020072 [Documentation] Test Suit Cleanup: Deleting K8s Cluster
almagiab4697d32021-05-25 08:56:17 +020073
garciadeblas7a9e0312023-12-11 22:24:46 +010074 Run Keyword If Any Tests Failed Delete K8s Cluster ${K8SCLUSTER_NAME}