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
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 Documentation [EPA-01] EPA+SRIOV without underlay.
18 Library OperatingSystem
23 Resource ../lib/vnfd_lib.resource
24 Resource ../lib/nsd_lib.resource
25 Resource ../lib/ns_lib.resource
26 Resource ../lib/ssh_lib.resource
28 Test Tags epa_01 cluster_epa daily regression
30 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
34 # NS and VNF descriptor package folder and ids
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
40 # NS instance name and configuration
41 ${NS_NAME} epa_01-epa_sriov_test
42 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
45 # SSH keys and username to be used
46 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47 ${PRIVATEKEY} %{HOME}/.ssh/id_rsa
50 ${VNF_MEMBER_INDEX} vnf
51 ${VNF_IP_ADDR} ${EMPTY}
56 [Documentation] Upload VNF package for the testsuite.
57 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
60 [Documentation] Upload NS package for the testsuite.
61 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
63 Instantiate Network Service
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}
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}
72 Set Suite Variable ${VNF_IP_ADDR} ${ip_addr}
74 Check SR-IOV Interface
75 [Documentation] Connect via SSH to the mgmt IP address of the VNF and check that the interface is not based in VirtIO.
76 Sleep 30 seconds Waiting for SSH daemon to be up
77 Execute Remote Command Check Rc Return Output ${VNF_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} lspci | grep "Ethernet controller" | grep -v "Virtio"
80 [Documentation] Delete NS instance.
85 [Documentation] Delete NS package from OSM.
87 Delete NSD ${NSD_NAME}
90 [Documentation] Delete VNF package from OSM.
92 Delete VNFD ${VNFD_NAME}
97 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
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}