blob: cdee22d3be7908f89555ee844019d29047e1ddd6 [file] [log] [blame]
garciaale764873c2020-07-02 17:42:00 -04001# 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 ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020014Documentation [EPA-01] EPA+SRIOV without underlay.
garciaale764873c2020-07-02 17:42:00 -040015
16Library OperatingSystem
17Library String
18Library Collections
19Library SSHLibrary
20
21Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
22Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
23Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
24Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
25
garciadeblas4cf45d72021-04-08 13:52:22 +020026Force Tags epa_01 cluster_epa daily regression
27
garciadeblasd225e552020-10-02 16:10:14 +000028Suite Teardown Run Keyword And Ignore Error Suite Cleanup
garciaale764873c2020-07-02 17:42:00 -040029
30
31*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020032# NS and VNF descriptor package folder and ids
33${vnfd_pkg} hackfest_basic_sriov_vnf
34${vnfd_name} hackfest_basic_sriov-vnf
35${nsd_pkg} hackfest_basic_sriov_ns
36${nsd_name} hackfest_basic_sriov-ns
37
38# NS instance name and configuration
39${ns_name} epa_01-epa_sriov_test
40${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
garciaale764873c2020-07-02 17:42:00 -040041${ns_id} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020042
43# SSH keys and username to be used
44${publickey} %{HOME}/.ssh/id_rsa.pub
45${privatekey} %{HOME}/.ssh/id_rsa
garciaale764873c2020-07-02 17:42:00 -040046${username} ubuntu
47${password} osm4u
aguilardf2578292022-03-29 15:26:43 +000048${vnf_member_index} vnf
garciaale764873c2020-07-02 17:42:00 -040049${vnf_ip_addr} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020050
garciaale764873c2020-07-02 17:42:00 -040051
52
53*** Test Cases ***
54Create VNF Descriptor
garciaale764873c2020-07-02 17:42:00 -040055
garciadeblasf4ebaa82022-06-23 13:33:26 +020056 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
garciaale764873c2020-07-02 17:42:00 -040057
58
59Create NS Descriptor
garciaale764873c2020-07-02 17:42:00 -040060
garciadeblasf4ebaa82022-06-23 13:33:26 +020061 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
garciaale764873c2020-07-02 17:42:00 -040062
63
64Instantiate Network Service
garciaale764873c2020-07-02 17:42:00 -040065
garciadeblasf4ebaa82022-06-23 13:33:26 +020066 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
67 Set Suite Variable ${ns_id} ${id}
garciaale764873c2020-07-02 17:42:00 -040068
69
70Get VNF IP Address
garciaale764873c2020-07-02 17:42:00 -040071
garciadeblasf4ebaa82022-06-23 13:33:26 +020072 ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
garciaale764873c2020-07-02 17:42:00 -040073 log ${ip_addr}
74 Set Suite Variable ${vnf_ip_addr} ${ip_addr}
75
76
77Check SR-IOV Interface
garciaale764873c2020-07-02 17:42:00 -040078
garciadeblasf4ebaa82022-06-23 13:33:26 +020079 Sleep 30 seconds Waiting for SSH daemon to be up
garciaale764873c2020-07-02 17:42:00 -040080 Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${privatekey} lspci | grep "Ethernet controller" | grep -v "Virtio"
81
82Delete NS Instance
garciadeblas4cf45d72021-04-08 13:52:22 +020083 [Tags] cleanup
garciaale764873c2020-07-02 17:42:00 -040084
garciadeblasf4ebaa82022-06-23 13:33:26 +020085 Delete NS ${ns_name}
garciaale764873c2020-07-02 17:42:00 -040086
87
88Delete NS Descriptor
garciadeblas4cf45d72021-04-08 13:52:22 +020089 [Tags] cleanup
garciaale764873c2020-07-02 17:42:00 -040090
garciadeblasf4ebaa82022-06-23 13:33:26 +020091 Delete NSD ${nsd_name}
garciaale764873c2020-07-02 17:42:00 -040092
93
94Delete VNF Descriptor
garciadeblas4cf45d72021-04-08 13:52:22 +020095 [Tags] cleanup
garciaale764873c2020-07-02 17:42:00 -040096
garciadeblasf4ebaa82022-06-23 13:33:26 +020097 Delete VNFD ${vnfd_name}
garciaale764873c2020-07-02 17:42:00 -040098
99
100*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000101Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200102 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciaale764873c2020-07-02 17:42:00 -0400103
garciadeblasf4ebaa82022-06-23 13:33:26 +0200104 Run Keyword If Any Tests Failed Delete NS ${ns_name}
garciaale764873c2020-07-02 17:42:00 -0400105
garciadeblasf4ebaa82022-06-23 13:33:26 +0200106 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
garciaale764873c2020-07-02 17:42:00 -0400107
garciadeblasf4ebaa82022-06-23 13:33:26 +0200108 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
garciaale764873c2020-07-02 17:42:00 -0400109