| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +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 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [HACKFEST-MULTIVDU] Basic NS with two multi-VDU VNF |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 17 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library Process |
| 22 | Library SSHLibrary |
| 23 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 24 | Resource ../lib/vnfd_lib.resource |
| 25 | Resource ../lib/nsd_lib.resource |
| 26 | Resource ../lib/ns_lib.resource |
| 27 | Resource ../lib/connectivity_lib.resource |
| 28 | Resource ../lib/ssh_lib.resource |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 29 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 30 | Test Tags hackfest_multivdu cluster_main daily regression azure |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 31 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 32 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 33 | |
| 34 | |
| 35 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 36 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 37 | ${VNFD_PKG} hackfest_multivdu_vnf |
| 38 | ${VNFD_NAME} hackfest_multivdu-vnf |
| 39 | ${NSD_PKG} hackfest_multivdu_ns |
| 40 | ${NSD_NAME} hackfest_multivdu-ns |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 41 | |
| 42 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 43 | ${NS_NAME} hfmultivdu |
| 44 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 45 | |
| 46 | # SSH keys and username to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 47 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| 48 | ${PRIVATEKEY} %{HOME}/.ssh/id_rsa |
| 49 | ${USERNAME} ubuntu |
| 50 | ${PASSWORD} ${EMPTY} |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 51 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 52 | ${NS_ID} ${EMPTY} |
| 53 | ${VNF_MEMBER_INDEX} vnf1 |
| 54 | ${VNF_IP_ADDR} ${EMPTY} |
| 55 | ${WAIT_GUARD_FOR_VM_BOOT} 50s |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 56 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 57 | |
| 58 | *** Test Cases *** |
| 59 | Create Hackfest multivdu 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}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 62 | |
| 63 | Create Hackfest Multivdu NS 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}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 66 | |
| 67 | Network Service Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | [Documentation] Instantiate NS for the testsuite. |
| 69 | ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${PUBLICKEY} |
| 70 | Log ${status},${message} |
| 71 | IF "${status}" == "FAIL" Set Global Variable ${PUBLICKEY} ${EMPTY} |
| 72 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 73 | Set Suite Variable ${NS_ID} ${id} |
| 74 | Sleep ${WAIT_GUARD_FOR_VM_BOOT} Waiting for VM's daemons to be up and running |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 75 | |
| 76 | Get Vnf Ip Address |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 77 | [Documentation] Get the mgmt IP address of the VNF of the NS. |
| 78 | ${ip_addr}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 79 | Log ${ip_addr} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | Set Suite Variable ${VNF_IP_ADDR} ${ip_addr} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 81 | |
| 82 | Test Ping |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 83 | [Documentation] Test that the mgmt IP address of the VNF is reachable with ping. |
| 84 | Test Connectivity ${VNF_IP_ADDR} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 85 | |
| 86 | Test SSH Access |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 87 | [Documentation] Check that the VNF is accessible via SSH in its mgmt IP address. |
| 88 | ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${PRIVATEKEY} |
| 89 | Log ${status},${message} |
| garciadeblas | 66e307d | 2023-12-14 10:30:09 +0100 | [diff] [blame] | 90 | IF "${status}" == "FAIL" Set Global Variable ${PRIVATEKEY} ${EMPTY} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 91 | Test SSH Connection ${VNF_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 92 | |
| 93 | Delete NS Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 94 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 95 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 96 | Delete NS ${NS_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 97 | |
| 98 | Delete NS Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 99 | [Documentation] Delete NS package. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 100 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 101 | Delete NSD ${NSD_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 102 | |
| 103 | Delete VNF Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 104 | [Documentation] Delete VNF package. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 105 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 106 | Delete VNFD ${VNFD_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 107 | |
| 108 | |
| 109 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 110 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 111 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 112 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 113 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 114 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |