| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [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 | |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [EPA-01] EPA+SRIOV without underlay. |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [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/nsd_lib.resource |
| 25 | Resource ../lib/ns_lib.resource |
| 26 | Resource ../lib/ssh_lib.resource |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 27 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 28 | Test Tags epa_01 cluster_epa daily regression |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 29 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 30 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 31 | |
| 32 | |
| 33 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 34 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 35 | ${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 |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 39 | |
| 40 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${NS_NAME} epa_01-epa_sriov_test |
| 42 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| 43 | ${NS_ID} ${EMPTY} |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 44 | |
| 45 | # SSH keys and username to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 46 | ${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} |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 52 | |
| 53 | |
| 54 | *** Test Cases *** |
| 55 | Create VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 56 | [Documentation] Upload VNF package for the testsuite. |
| 57 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 58 | |
| 59 | Create NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 60 | [Documentation] Upload NS package for the testsuite. |
| 61 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 62 | |
| 63 | Instantiate Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 64 | [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} |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 67 | |
| 68 | Get VNF IP Address |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 69 | [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} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 71 | Log ${ip_addr} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 72 | Set Suite Variable ${VNF_IP_ADDR} ${ip_addr} |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 73 | |
| 74 | Check SR-IOV Interface |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 75 | [Documentation] Connect via SSH to the mgmt IP address of the VNF and check that the interface is not based in VirtIO. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 76 | Sleep 30 seconds Waiting for SSH daemon to be up |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 77 | Execute Remote Command Check Rc Return Output ${VNF_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} lspci | grep "Ethernet controller" | grep -v "Virtio" |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 78 | |
| 79 | Delete NS Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 81 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | Delete NS ${NS_NAME} |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 83 | |
| 84 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 86 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 87 | Delete NSD ${NSD_NAME} |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 88 | |
| 89 | Delete VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | [Documentation] Delete VNF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 91 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 92 | Delete VNFD ${VNFD_NAME} |
| garciaale | 764873c | 2020-07-02 17:42:00 -0400 | [diff] [blame] | 93 | |
| 94 | |
| 95 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 96 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 97 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 98 | 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} |