| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 2 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | # you may not use this file except in compliance with the License. |
| 4 | # You may obtain a copy of the License at |
| 5 | # |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # |
| 8 | # Unless required by applicable law or agreed to in writing, software |
| 9 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 14 | |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [BASIC-22] Cross-model relations |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 17 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 18 | Library OperatingSystem |
| 19 | Library SSHLibrary |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 20 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 21 | Resource ../lib/vnfd_lib.resource |
| 22 | Resource ../lib/nsd_lib.resource |
| 23 | Resource ../lib/ns_lib.resource |
| 24 | Resource ../lib/ssh_lib.resource |
| 25 | Resource ../lib/k8scluster_lib.resource |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 26 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 27 | Test Tags basic_22 cluster_ee_config cluster_relations regression |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 28 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 29 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 30 | |
| 31 | |
| 32 | *** Variables *** |
| 33 | # K8s cluster name and version |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 34 | ${K8SCLUSTER_NAME} k8sbasic_22 |
| 35 | ${K8SCLUSTER_VERSION} v1 |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 36 | |
| 37 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 38 | ${VNFD_PKG1} charm-packages/cmr_relation_vnf |
| 39 | ${VNFD_PKG2} charm-packages/cmr_no_relation_vnf |
| 40 | ${NSD_PKG} charm-packages/cmr_relation_ns |
| 41 | ${VNFD_NAME1} cross_model_relation-vnf |
| 42 | ${VNFD_NAME2} cross_model_no_relation-vnf |
| 43 | ${NSD_NAME} cross_model_relation-ns |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 44 | |
| 45 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 46 | ${NS_NAME} basic_22 |
| 47 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| 48 | ${NS_TIMEOUT} 15min |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 49 | |
| 50 | # SSH keys and username to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 51 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| 52 | ${PRIVATEKEY} %{HOME}/.ssh/id_rsa |
| 53 | ${USERNAME} ubuntu |
| 54 | ${PASSWORD} ${EMPTY} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 55 | |
| 56 | |
| 57 | *** Test Cases *** |
| 58 | Create Charm VNF Descriptor 1 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 59 | [Documentation] Upload first VNF package for the testsuite. |
| 60 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG1}' |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 61 | |
| 62 | Create Charm VNF Descriptor 2 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 63 | [Documentation] Upload second VNF package for the testsuite. |
| 64 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG2}' |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 65 | |
| 66 | Create Charm NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 67 | [Documentation] Upload NS package for the testsuite. |
| 68 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 69 | |
| 70 | Add K8s Cluster To OSM |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 71 | [Documentation] Register K8s cluster in OSM. |
| 72 | Create K8s Cluster %{K8S_CREDENTIALS} ${K8SCLUSTER_VERSION} %{VIM_TARGET} %{VIM_MGMT_NET} ${K8SCLUSTER_NAME} |
| garciadeblas | 93e5cc2 | 2023-12-17 01:40:23 +0100 | [diff] [blame] | 73 | Check For K8s Cluster To Be Enabled ${K8SCLUSTER_NAME} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 74 | |
| 75 | Instantiate Charm Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 76 | [Documentation] Instantiate NS for the testsuite. |
| 77 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} ${NS_TIMEOUT} |
| 78 | Set Suite Variable ${NS_ID} ${id} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 79 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | # TODO: Check juju status for relations |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 81 | |
| 82 | Delete NS Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 83 | [Documentation] Delete NS instance. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 84 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | Delete NS ${NS_NAME} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 86 | |
| 87 | Remove K8s Cluster from OSM |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 88 | [Documentation] Unregister K8s cluster from OSM. |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 89 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | Delete K8s Cluster ${K8SCLUSTER_NAME} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 91 | |
| 92 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 93 | [Documentation] Delete NS package from OSM. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 94 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | Delete NSD ${NSD_NAME} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 96 | |
| 97 | Delete VNF Descriptor 1 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 98 | [Documentation] Delete first VNF package from OSM. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 99 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 100 | Delete VNFD ${VNFD_NAME1} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 101 | |
| 102 | Delete VNF Descriptor 2 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 103 | [Documentation] Delete second VNF package from OSM. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 104 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 105 | Delete VNFD ${VNFD_NAME2} |
| David Garcia | 006f584 | 2021-11-11 18:05:52 +0100 | [diff] [blame] | 106 | |
| 107 | |
| 108 | *** Keywords *** |
| 109 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 110 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 111 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 112 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 113 | Run Keyword If Any Tests Failed Delete VNFD 1 ${VNFD_NAME1} |
| 114 | Run Keyword If Any Tests Failed Delete VNFD 2 ${VNFD_NAME2} |