| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +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 | |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 17 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 18 | Documentation [K8s-09] Pebble Charm. |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 19 | |
| 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 |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 33 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 34 | Test Tags k8s_09 cluster_k8s regression azure |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 35 | |
| 36 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 37 | |
| 38 | |
| 39 | *** Variables *** |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +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/pebble_charm_vnf |
| 42 | ${VNFD_NAME} pebble_charm-vnf |
| 43 | ${NSD_PKG} charm-packages/pebble_charm_ns |
| 44 | ${NSD_NAME} pebble_charm-ns |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 45 | |
| 46 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 47 | ${NS_NAME} pebble-charm-k8s |
| 48 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +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} pebble_charm-vnf |
| 53 | ${ACTION_NAME} list-available-apps |
| 54 | ${KDU_NAME} onos-kdu |
| 55 | ${APPLICATION_NAME} onos |
| 56 | |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 57 | |
| 58 | *** Test Cases *** |
| 59 | Create Simple K8s VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 60 | [Documentation] Upload VNF package for the testsuite. |
| 61 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 62 | |
| 63 | Create Simple K8s Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 64 | [Documentation] Upload NS package for the testsuite. |
| 65 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 66 | |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 67 | Network Service K8s Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | [Documentation] Instantiate NS for the testsuite. |
| 69 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 70 | Set Suite Variable ${NS_ID} ${id} |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 71 | |
| 72 | Execute Day 2 Operations |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 73 | [Documentation] Performs one Day 2 operation per VNF that creates a new file. |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 74 | |
| 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} |
| 77 | Log ${ns_op_id} |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 78 | |
| 79 | Delete NS K8s Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | [Documentation] Delete NS instance. |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 81 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | Delete NS ${NS_NAME} |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 83 | |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 84 | Delete NS Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | [Documentation] Delete the NS package. |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 86 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 87 | Delete NSD ${NSD_NAME} |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 88 | |
| 89 | Delete VNF Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | [Documentation] Delete the VNF package. |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 91 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 92 | Delete VNFD ${VNFD_NAME} |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 93 | |
| 94 | Delete VNF NS Packages |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | [Documentation] Delete the tar.gz files associated to the VNF and NS packages. |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +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}' |
| David Garcia | 88b9ab3 | 2021-08-20 14:24:38 +0200 | [diff] [blame] | 99 | |
| 100 | |
| 101 | *** Keywords *** |
| 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} |