blob: 7b838bce10e6d373182e919a3c05f6347ce3515c [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
garciaale764873c2020-07-02 17:42:00 -04002# 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
garciaale764873c2020-07-02 17:42:00 -040015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [EPA-01] EPA+SRIOV without underlay.
garciaale764873c2020-07-02 17:42:00 -040017
18Library OperatingSystem
19Library String
20Library Collections
21Library SSHLibrary
22
garciadeblas7a9e0312023-12-11 22:24:46 +010023Resource ../lib/vnfd_lib.resource
24Resource ../lib/nsd_lib.resource
25Resource ../lib/ns_lib.resource
26Resource ../lib/ssh_lib.resource
garciaale764873c2020-07-02 17:42:00 -040027
garciadeblas7a9e0312023-12-11 22:24:46 +010028Test Tags epa_01 cluster_epa daily regression
garciadeblas4cf45d72021-04-08 13:52:22 +020029
garciadeblasd225e552020-10-02 16:10:14 +000030Suite Teardown Run Keyword And Ignore Error Suite Cleanup
garciaale764873c2020-07-02 17:42:00 -040031
32
33*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020034# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010035${VNFD_PKG} hackfest_basic_sriov_vnf
36${VNFD_NAME} hackfest_basic_sriov-vnf
37${NSD_PKG} hackfest_basic_sriov_ns
38${NSD_NAME} hackfest_basic_sriov-ns
almagiab4697d32021-05-25 08:56:17 +020039
40# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010041${NS_NAME} epa_01-epa_sriov_test
42${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43${NS_ID} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020044
45# SSH keys and username to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010046${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47${PRIVATEKEY} %{HOME}/.ssh/id_rsa
48${USERNAME} ubuntu
49${PASSWORD} osm4u
50${VNF_MEMBER_INDEX} vnf
51${VNF_IP_ADDR} ${EMPTY}
garciaale764873c2020-07-02 17:42:00 -040052
53
54*** Test Cases ***
55Create VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010056 [Documentation] Upload VNF package for the testsuite.
57 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
garciaale764873c2020-07-02 17:42:00 -040058
59Create NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010060 [Documentation] Upload NS package for the testsuite.
61 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
garciaale764873c2020-07-02 17:42:00 -040062
63Instantiate Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010064 [Documentation] Instantiate NS for the testsuite.
65 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
66 Set Suite Variable ${NS_ID} ${id}
garciaale764873c2020-07-02 17:42:00 -040067
68Get VNF IP Address
garciadeblas7a9e0312023-12-11 22:24:46 +010069 [Documentation] Get the mgmt IP address of the VNF of the NS.
70 ${ip_addr}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX}
garciadeblas321726f2022-12-21 11:43:06 +010071 Log ${ip_addr}
garciadeblas7a9e0312023-12-11 22:24:46 +010072 Set Suite Variable ${VNF_IP_ADDR} ${ip_addr}
garciaale764873c2020-07-02 17:42:00 -040073
74Check SR-IOV Interface
garciadeblas7a9e0312023-12-11 22:24:46 +010075 [Documentation] Connect via SSH to the mgmt IP address of the VNF and check that the interface is not based in VirtIO.
garciadeblasf4ebaa82022-06-23 13:33:26 +020076 Sleep 30 seconds Waiting for SSH daemon to be up
garciadeblas7a9e0312023-12-11 22:24:46 +010077 Execute Remote Command Check Rc Return Output ${VNF_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} lspci | grep "Ethernet controller" | grep -v "Virtio"
garciaale764873c2020-07-02 17:42:00 -040078
79Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010080 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020081 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010082 Delete NS ${NS_NAME}
garciaale764873c2020-07-02 17:42:00 -040083
84Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010085 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020086 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010087 Delete NSD ${NSD_NAME}
garciaale764873c2020-07-02 17:42:00 -040088
89Delete VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010090 [Documentation] Delete VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020091 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010092 Delete VNFD ${VNFD_NAME}
garciaale764873c2020-07-02 17:42:00 -040093
94
95*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +000096Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +020097 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +010098 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
99 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
100 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}