| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +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 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [EPA-05] EPA underlay PASSTHROUGH. |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 17 | |
| 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library SSHLibrary |
| 22 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 23 | Resource ../lib/vnfd_lib.resource |
| 24 | Resource ../lib/vnf_lib.resource |
| 25 | Resource ../lib/nsd_lib.resource |
| 26 | Resource ../lib/ns_lib.resource |
| 27 | Resource ../lib/ssh_lib.resource |
| 28 | Resource ../lib/openstack_lib.resource |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 29 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 30 | Test Tags epa_05 cluster_epa |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 31 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 32 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 33 | |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 34 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 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} epa_1vm_passthrough_vnf |
| 38 | ${VNFD_NAME} epa_1vm_passthrough-vnf |
| 39 | ${NSD_PKG} epa_1vm_passthrough_ns |
| 40 | ${NSD_NAME} epa_1vm_passthrough-ns |
| 41 | ${NS_NAME} epa_05 |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 42 | |
| 43 | # Fixed IPs and subnet for datanet VL |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 44 | ${DATANET_SUBNET} 192.168.110.0/24 |
| 45 | ${DATANET_IP1} 192.168.110.11 |
| 46 | ${DATANET_IP2} 192.168.110.22 |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 47 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 48 | ${VNF_MEMBER_INDEX_1} vnf1 |
| 49 | ${VNF_MEMBER_INDEX_2} vnf2 |
| 50 | ${USERNAME} ubuntu |
| 51 | ${PASSWORD} osm4u |
| 52 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} , {name: datanet, ip-profile: {ip-version: ipv4, subnet-address: "${DATANET_SUBNET}"}, vnfd-connection-point-ref: [ {member-vnf-index-ref: "${VNF_MEMBER_INDEX_1}", vnfd-connection-point-ref: vnf-data-ext, ip-address: "${DATANET_IP1}"}, {member-vnf-index-ref: "${VNF_MEMBER_INDEX_2}", vnfd-connection-point-ref: vnf-data-ext, ip-address: "${DATANET_IP2}"}]} ] } |
| 53 | ${SUCCESS_RETURN_CODE} 0 |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 54 | |
| 55 | |
| 56 | *** Test Cases *** |
| 57 | Create VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 58 | [Documentation] Upload VNF package for the testsuite. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 59 | Remove Environment Variable OVERRIDES |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 60 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 61 | |
| 62 | Create 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}' |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 65 | |
| 66 | Instantiate 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} ${EMPTY} |
| 69 | Set Suite Variable ${NS_ID} ${id} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [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 addresses of both VNF of the NS. |
| 73 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 74 | ${ip}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX_1} |
| 75 | Set Suite Variable ${IP_MGMT_1} ${ip} |
| 76 | Log ${IP_MGMT_1} |
| 77 | ${ip}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX_2} |
| 78 | Set Suite Variable ${IP_MGMT_2} ${ip} |
| 79 | Log ${IP_MGMT_2} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 80 | |
| 81 | Ping from Vnf1 to Vnf2 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | [Documentation] Check connectivity from the first VNF to the second VNF using ping. |
| 83 | Variable Should Exist ${IP_MGMT_1} msg=IP address of the data VNF '${VNF_MEMBER_INDEX_1}' is not available |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 84 | Sleep 30 seconds Wait for SSH daemon to be up |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | ${stdout}= Execute Remote Command Check Rc Return Output ${IP_MGMT_1} ${USERNAME} ${PASSWORD} ${EMPTY} ip addr ; ping -c 5 ${DATANET_IP2} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 86 | Log ${stdout} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 87 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 88 | Ping from Vnf2 to Vnf1 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 89 | [Documentation] Check connectivity from the second VNF to the first VNF using ping. |
| 90 | Variable Should Exist ${IP_MGMT_2} msg=IP address of the data VNF '${VNF_MEMBER_INDEX_2}' is not available |
| 91 | ${stdout}= Execute Remote Command Check Rc Return Output ${IP_MGMT_2} ${USERNAME} ${PASSWORD} ${EMPTY} ip addr ; ping -c 5 ${DATANET_IP1} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 92 | Log ${stdout} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 93 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 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} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [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} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [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} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 108 | |
| 109 | |
| 110 | *** Keywords *** |
| 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} |