| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | # you may not use this file except in compliance with the License. |
| 3 | # You may obtain a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | # See the License for the specific language governing permissions and |
| 11 | # limitations under the License. |
| 12 | |
| 13 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 14 | Documentation [EPA-05] EPA underlay PASSTHROUGH. |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 15 | |
| 16 | Library OperatingSystem |
| 17 | Library String |
| 18 | Library Collections |
| 19 | Library SSHLibrary |
| 20 | |
| 21 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot |
| 22 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot |
| 23 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot |
| 24 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot |
| 25 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot |
| 26 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot |
| 27 | |
| beierlm | 3f1844f | 2021-05-12 04:48:23 -0400 | [diff] [blame] | 28 | Force Tags epa_05 cluster_epa |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 29 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 30 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 31 | |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 32 | |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 33 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 34 | # NS and VNF descriptor package folder and ids |
| 35 | ${vnfd_pkg} epa_1vm_passthrough_vnf |
| 36 | ${vnfd_name} epa_1vm_passthrough-vnf |
| 37 | ${nsd_pkg} epa_1vm_passthrough_ns |
| 38 | ${nsd_name} epa_1vm_passthrough-ns |
| 39 | ${ns_name} epa_05 |
| 40 | |
| 41 | # Fixed IPs and subnet for datanet VL |
| 42 | ${datanet_subnet} 192.168.110.0/24 |
| 43 | ${datanet_ip1} 192.168.110.11 |
| 44 | ${datanet_ip2} 192.168.110.22 |
| 45 | |
| aguilard | f257829 | 2022-03-29 15:26:43 +0000 | [diff] [blame] | 46 | ${vnf_member_index_1} vnf1 |
| 47 | ${vnf_member_index_2} vnf2 |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 48 | ${username} ubuntu |
| 49 | ${password} osm4u |
| aguilard | a504c5f | 2022-04-21 15:42:52 +0200 | [diff] [blame] | 50 | ${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}"}]} ] } |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 51 | ${success_return_code} 0 |
| 52 | |
| 53 | |
| 54 | *** Test Cases *** |
| 55 | Create VNF Descriptor |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 56 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 57 | Remove Environment Variable OVERRIDES |
| 58 | Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 59 | |
| 60 | |
| 61 | Create NS Descriptor |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 62 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 63 | Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 64 | |
| 65 | |
| 66 | Instantiate Network Service |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 67 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 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 | |
| 72 | Get Management Ip Addresses |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 73 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 74 | Variable Should Exist ${ns_id} msg=Network service instance is not available |
| 75 | ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} |
| 76 | Set Suite Variable ${ip_mgmt_1} ${ip} |
| 77 | log ${ip_mgmt_1} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 78 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 79 | ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} |
| 80 | Set Suite Variable ${ip_mgmt_2} ${ip} |
| 81 | log ${ip_mgmt_2} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 82 | |
| 83 | |
| 84 | Ping from Vnf1 to Vnf2 |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 85 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 86 | 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] | 87 | Sleep 30 seconds Wait for SSH daemon to be up |
| aguilarherna | ddc788b | 2021-05-31 16:08:56 +0000 | [diff] [blame] | 88 | ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_1} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip2} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 89 | log ${stdout} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 90 | |
| 91 | |
| 92 | Ping from Vnf2 to Vnf1 |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 93 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 94 | Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available |
| aguilarherna | ddc788b | 2021-05-31 16:08:56 +0000 | [diff] [blame] | 95 | ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_2} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip1} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 96 | log ${stdout} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 97 | |
| 98 | |
| 99 | Delete NS Instance |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 100 | [Tags] cleanup |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 101 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 102 | Delete NS ${ns_name} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 103 | |
| 104 | |
| 105 | Delete NS Descriptor |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 106 | [Tags] cleanup |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 107 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 108 | Delete NSD ${nsd_name} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 109 | |
| 110 | |
| 111 | Delete VNF Descriptor |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 112 | [Tags] cleanup |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 113 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 114 | Delete VNFD ${vnfd_name} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 115 | |
| 116 | |
| 117 | |
| 118 | *** Keywords *** |
| 119 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 120 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 121 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 122 | Run Keyword If Any Tests Failed Delete NS ${ns_name} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 123 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 124 | Run Keyword If Any Tests Failed Delete NSD ${nsd_name} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 125 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 126 | Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} |
| aguilarherna | db87374 | 2021-03-02 13:44:25 +0100 | [diff] [blame] | 127 | |
| 128 | |