| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [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 | |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [BASIC-11] Native Charms |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 17 | |
| 18 | Library OperatingSystem |
| 19 | Library SSHLibrary |
| 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 |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 25 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 26 | Test Tags basic_11 cluster_ee_config cluster_relations regression azure |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 27 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 28 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 29 | |
| 30 | |
| 31 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 32 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 33 | ${VNFD_PKG} charm-packages/native_charm_vnf |
| 34 | ${VNFD_NAME} native_charm-vnf |
| 35 | ${NSD_PKG} charm-packages/native_charm_ns |
| 36 | ${NSD_NAME} native_charm-ns |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 37 | |
| 38 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 39 | ${NS_NAME} basic_11_native_charms |
| 40 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| 41 | ${NS_TIMEOUT} 15min |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 42 | |
| 43 | # SSH keys and username to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 44 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| 45 | ${PRIVATEKEY} %{HOME}/.ssh/id_rsa |
| 46 | ${USERNAME} ubuntu |
| 47 | ${PASSWORD} ${EMPTY} |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 48 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 49 | ${ACTION_NAME} touch |
| 50 | ${VNF_MEMBER_INDEX_1} vnf1 |
| 51 | ${VNF_MEMBER_INDEX_2} vnf2 |
| 52 | ${DAY_1_FILE_NAME} /home/ubuntu/first-touch |
| 53 | ${DAY_2_FILE_NAME_1} /home/ubuntu/mytouch1 |
| 54 | ${DAY_2_FILE_NAME_2} /home/ubuntu/mytouch2 |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 55 | |
| 56 | |
| 57 | *** Test Cases *** |
| 58 | Create Charm VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 59 | [Documentation] Upload VNF package for the testsuite. |
| 60 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 61 | |
| 62 | Create Charm NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 63 | [Documentation] Upload NS package for the testsuite. |
| 64 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 65 | |
| 66 | Instantiate Charm Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 67 | [Documentation] Instantiate NS for the testsuite. |
| 68 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} ${NS_TIMEOUT} |
| 69 | Set Suite Variable ${NS_ID} ${id} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 70 | |
| 71 | Get Management Ip Addresses |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 72 | [Documentation] Get the mgmt IP address of the two VNF of the NS. |
| 73 | ${ip_addr_1}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX_1} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 74 | Log ${ip_addr_1} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 75 | Set Suite Variable ${VNF_1_IP_ADDR} ${ip_addr_1} |
| 76 | ${ip_addr_2}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX_2} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 77 | Log ${ip_addr_2} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 78 | Set Suite Variable ${VNF_2_IP_ADDR} ${ip_addr_2} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 79 | |
| 80 | Test SSH Access |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 81 | [Documentation] Check that both VNF are accessible via SSH in their respective mgmt IP address. |
| 82 | Variable Should Exist ${VNF_1_IP_ADDR} msg=IP address of the management VNF '${VNF_MEMBER_INDEX_1}' is not available |
| 83 | Variable Should Exist ${VNF_2_IP_ADDR} msg=IP address of the management VNF '${VNF_MEMBER_INDEX_2}' is not available |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 84 | Sleep 30s Waiting ssh daemon to be up |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | Test SSH Connection ${VNF_1_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} |
| 86 | Test SSH Connection ${VNF_2_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 87 | |
| 88 | Check Remote Files Created Via Day 1 Operations |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 89 | [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. |
| 90 | ... This test checks whether that files have been created or not. |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 91 | Check If Remote File Exists ${VNF_1_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} ${DAY_1_FILE_NAME} |
| 92 | Check If Remote File Exists ${VNF_2_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} ${DAY_1_FILE_NAME} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 93 | |
| 94 | Delete NS Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | [Documentation] Delete NS instance. |
| 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 NS ${NS_NAME} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 98 | |
| 99 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 100 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 101 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 102 | Delete NSD ${NSD_NAME} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 103 | |
| 104 | Delete VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 105 | [Documentation] Delete VNF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 106 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 107 | Delete VNFD ${VNFD_NAME} |
| Dominik Fleischmann | 46186c8 | 2020-07-23 13:28:01 +0200 | [diff] [blame] | 108 | |
| 109 | |
| 110 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 111 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 112 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 113 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 114 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 115 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |