Bug 2327 fix to verify ipaddress in sol003_02 testsuite
[osm/tests.git] / robot-systest / testsuite / epa_01-epa_sriov.robot
1 *** Comments ***
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
14
15 *** Settings ***
16 Documentation   [EPA-01] EPA+SRIOV without underlay.
17
18 Library   OperatingSystem
19 Library   String
20 Library   Collections
21 Library   SSHLibrary
22
23 Resource   ../lib/vnfd_lib.resource
24 Resource   ../lib/nsd_lib.resource
25 Resource   ../lib/ns_lib.resource
26 Resource   ../lib/ssh_lib.resource
27
28 Test Tags   epa_01   cluster_epa   daily   regression
29
30 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
31
32
33 *** Variables ***
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
39
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}} ] }
43 ${NS_ID}   ${EMPTY}
44
45 # SSH keys and username to be used
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}
52
53
54 *** Test Cases ***
55 Create VNF Descriptor
56     [Documentation]   Upload VNF package for the testsuite.
57     Create VNFD   '%{PACKAGES_FOLDER}/${VNFD_PKG}'
58
59 Create NS Descriptor
60     [Documentation]   Upload NS package for the testsuite.
61     Create NSD   '%{PACKAGES_FOLDER}/${NSD_PKG}'
62
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}
67
68 Get VNF IP Address
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}
71     Log   ${ip_addr}
72     Set Suite Variable   ${VNF_IP_ADDR}   ${ip_addr}
73
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"
78
79 Delete NS Instance
80     [Documentation]   Delete NS instance.
81     [Tags]   cleanup
82     Delete NS   ${NS_NAME}
83
84 Delete NS Descriptor
85     [Documentation]   Delete NS package from OSM.
86     [Tags]   cleanup
87     Delete NSD   ${NSD_NAME}
88
89 Delete VNF Descriptor
90     [Documentation]   Delete VNF package from OSM.
91     [Tags]   cleanup
92     Delete VNFD   ${VNFD_NAME}
93
94
95 *** Keywords ***
96 Suite Cleanup
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}