blob: 8e89641f78b525421db204e063136cc10fe1ab1b [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 ***
14Documentation [EPA-01] EPA+SRIOV without underlay.
15
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
48${vnf_member_index} 1
49${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
56 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
57
58
59Create NS Descriptor
garciaale764873c2020-07-02 17:42:00 -040060
61 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
62
63
64Instantiate Network Service
garciaale764873c2020-07-02 17:42:00 -040065
66 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
67 Set Suite Variable ${ns_id} ${id}
68
69
70Get VNF IP Address
garciaale764873c2020-07-02 17:42:00 -040071
72 ${ip_addr}= Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
73 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
79 Sleep 30 seconds Waiting for SSH daemon to be up
80 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
85 Delete NS ${ns_name}
86
87
88Delete NS Descriptor
garciadeblas4cf45d72021-04-08 13:52:22 +020089 [Tags] cleanup
garciaale764873c2020-07-02 17:42:00 -040090
91 Delete NSD ${nsd_name}
92
93
94Delete VNF Descriptor
garciadeblas4cf45d72021-04-08 13:52:22 +020095 [Tags] cleanup
garciaale764873c2020-07-02 17:42:00 -040096
97 Delete VNFD ${vnfd_name}
98
99
100*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000101Suite Cleanup
garciaale764873c2020-07-02 17:42:00 -0400102 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
103
garciadeblasd225e552020-10-02 16:10:14 +0000104 Run Keyword If Any Tests Failed Delete NS ${ns_name}
garciaale764873c2020-07-02 17:42:00 -0400105
garciadeblasd225e552020-10-02 16:10:14 +0000106 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
garciaale764873c2020-07-02 17:42:00 -0400107
garciadeblasd225e552020-10-02 16:10:14 +0000108 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
garciaale764873c2020-07-02 17:42:00 -0400109