| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| calvinosanc1 | 79fcc85 | 2020-07-29 12:11:41 +0200 | [diff] [blame] | 2 | # Copyright 2020 Canonical Ltd. |
| 3 | # |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 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 | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 17 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 18 | Documentation [K8s-03] Simple K8s. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 19 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +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/vnfd_lib.resource |
| 26 | Resource ../lib/nsd_lib.resource |
| 27 | Resource ../lib/ns_lib.resource |
| 28 | Resource ../lib/ns_operation_lib.resource |
| 29 | Resource ../lib/package_lib.resource |
| 30 | Resource ../lib/connectivity_lib.resource |
| 31 | Resource ../lib/ssh_lib.resource |
| 32 | Resource ../lib/k8scluster_lib.resource |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 33 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 34 | Test Tags k8s_03 cluster_k8s regression azure |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 35 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 36 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 37 | |
| 38 | |
| 39 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 40 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${VNFD_PKG} charm-packages/native_k8s_charm_vnf |
| 42 | ${VNFD_NAME} native_k8s_charm-vnf |
| 43 | ${NSD_PKG} charm-packages/native_k8s_charm_ns |
| 44 | ${NSD_NAME} native_k8s_charm-ns |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 45 | |
| 46 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 47 | ${NS_NAME} native-k8s |
| 48 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 49 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 50 | ${NS_ID} ${EMPTY} |
| 51 | ${PUBLICKEY} ${EMPTY} |
| 52 | ${VNF_MEMBER_INDEX} native_k8s_charm-vnf |
| 53 | ${ACTION_NAME} changecontent |
| 54 | ${KDU_NAME} native-kdu |
| 55 | ${APPLICATION_NAME} nginx |
| 56 | ${CUSTOMTITLE} Day 2 Action |
| 57 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 58 | |
| 59 | *** Test Cases *** |
| 60 | Create Simple K8s VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 61 | [Documentation] Upload NF package for the testsuite. |
| 62 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 63 | |
| 64 | Create Simple K8s Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | [Documentation] Upload NS package for the testsuite. |
| 66 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 67 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 68 | Network Service K8s Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 69 | [Documentation] Instantiate NS for the testsuite. |
| 70 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 71 | Set Suite Variable ${NS_ID} ${id} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 72 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 73 | Execute Day 2 Operations |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 74 | [Documentation] Performs one Day 2 operation per VNF that creates a new file. |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 75 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 76 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ACTION_NAME} ${VNF_MEMBER_INDEX} ${KDU_NAME} application-name=${APPLICATION_NAME} customtitle=${CUSTOMTITLE} |
| 77 | Log ${ns_op_id} |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 78 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 79 | Delete NS K8s Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 81 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | Delete NS ${NS_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 83 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 84 | Delete NS Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 86 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 87 | Delete NSD ${NSD_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 88 | |
| 89 | Delete VNF Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | [Documentation] Delete NF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 91 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 92 | Delete VNFD ${VNFD_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 93 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 94 | Delete VNF NS Packages |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | [Documentation] Delete tar.gz NF and NS package files. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 96 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 97 | Delete Package '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| 98 | Delete Package '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 99 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 100 | |
| 101 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 102 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 103 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 104 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 105 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 106 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |