blob: a81de087a2ffbccd31c1db43ae5ec065712fb8b7 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
aguilarhernadb873742021-03-02 13:44:25 +01002# 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
garciadeblas7a9e0312023-12-11 22:24:46 +010014
aguilarhernadb873742021-03-02 13:44:25 +010015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [EPA-05] EPA underlay PASSTHROUGH.
aguilarhernadb873742021-03-02 13:44:25 +010017
18Library OperatingSystem
19Library String
20Library Collections
21Library SSHLibrary
22
garciadeblas7a9e0312023-12-11 22:24:46 +010023Resource ../lib/vnfd_lib.resource
24Resource ../lib/vnf_lib.resource
25Resource ../lib/nsd_lib.resource
26Resource ../lib/ns_lib.resource
27Resource ../lib/ssh_lib.resource
28Resource ../lib/openstack_lib.resource
aguilarhernadb873742021-03-02 13:44:25 +010029
garciadeblas7a9e0312023-12-11 22:24:46 +010030Test Tags epa_05 cluster_epa
garciadeblas4cf45d72021-04-08 13:52:22 +020031
aguilarhernadb873742021-03-02 13:44:25 +010032Suite Teardown Run Keyword And Ignore Error Suite Cleanup
33
garciadeblas4cf45d72021-04-08 13:52:22 +020034
aguilarhernadb873742021-03-02 13:44:25 +010035*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020036# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010037${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
almagiab4697d32021-05-25 08:56:17 +020042
43# Fixed IPs and subnet for datanet VL
garciadeblas7a9e0312023-12-11 22:24:46 +010044${DATANET_SUBNET} 192.168.110.0/24
45${DATANET_IP1} 192.168.110.11
46${DATANET_IP2} 192.168.110.22
almagiab4697d32021-05-25 08:56:17 +020047
garciadeblas7a9e0312023-12-11 22:24:46 +010048${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
aguilarhernadb873742021-03-02 13:44:25 +010054
55
56*** Test Cases ***
57Create VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010058 [Documentation] Upload VNF package for the testsuite.
garciadeblasf4ebaa82022-06-23 13:33:26 +020059 Remove Environment Variable OVERRIDES
garciadeblas7a9e0312023-12-11 22:24:46 +010060 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
aguilarhernadb873742021-03-02 13:44:25 +010061
62Create NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010063 [Documentation] Upload NS package for the testsuite.
64 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
aguilarhernadb873742021-03-02 13:44:25 +010065
66Instantiate Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010067 [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}
aguilarhernadb873742021-03-02 13:44:25 +010070
71Get Management Ip Addresses
garciadeblas7a9e0312023-12-11 22:24:46 +010072 [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}
aguilarhernadb873742021-03-02 13:44:25 +010080
81Ping from Vnf1 to Vnf2
garciadeblas7a9e0312023-12-11 22:24:46 +010082 [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
aguilarhernadb873742021-03-02 13:44:25 +010084 Sleep 30 seconds Wait for SSH daemon to be up
garciadeblas7a9e0312023-12-11 22:24:46 +010085 ${stdout}= Execute Remote Command Check Rc Return Output ${IP_MGMT_1} ${USERNAME} ${PASSWORD} ${EMPTY} ip addr ; ping -c 5 ${DATANET_IP2}
garciadeblas321726f2022-12-21 11:43:06 +010086 Log ${stdout}
aguilarhernadb873742021-03-02 13:44:25 +010087
aguilarhernadb873742021-03-02 13:44:25 +010088Ping from Vnf2 to Vnf1
garciadeblas7a9e0312023-12-11 22:24:46 +010089 [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}
garciadeblas321726f2022-12-21 11:43:06 +010092 Log ${stdout}
aguilarhernadb873742021-03-02 13:44:25 +010093
aguilarhernadb873742021-03-02 13:44:25 +010094Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010095 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020096 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010097 Delete NS ${NS_NAME}
aguilarhernadb873742021-03-02 13:44:25 +010098
99Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200101 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100102 Delete NSD ${NSD_NAME}
aguilarhernadb873742021-03-02 13:44:25 +0100103
104Delete VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 [Documentation] Delete VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200106 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100107 Delete VNFD ${VNFD_NAME}
aguilarhernadb873742021-03-02 13:44:25 +0100108
109
110*** Keywords ***
111Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200112 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100113 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}