Removed unused 'privatekey' variable in EPA04 and EPA05 tests
[osm/tests.git] / robot-systest / testsuite / epa_04-epa_underlay_sriov.robot
1 #   Licensed under the Apache License, Version 2.0 (the "License");\r
2 #   you may not use this file except in compliance with the License.\r
3 #   You may obtain a copy of the License at\r
4 #\r
5 #       http://www.apache.org/licenses/LICENSE-2.0\r
6 #\r
7 #   Unless required by applicable law or agreed to in writing, software\r
8 #   distributed under the License is distributed on an "AS IS" BASIS,\r
9 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
10 #   See the License for the specific language governing permissions and\r
11 #   limitations under the License.\r
12 \r
13 *** Settings ***\r
14 Documentation     [EPA-04] EPA underlay SR-IOV.\r
15 \r
16 Library   OperatingSystem\r
17 Library   String\r
18 Library   Collections\r
19 Library   SSHLibrary\r
20 \r
21 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot\r
22 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot\r
23 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot\r
24 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot\r
25 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot\r
26 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot\r
27 \r
28 Force Tags   epa_04   cluster_epa   daily   regression\r
29 \r
30 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup\r
31 \r
32 \r
33 *** Variables ***\r
34 # NS and VNF descriptor package folder and ids\r
35 ${vnfd_pkg}   epa_1vm_sriov_vnf\r
36 ${vnfd_name}   epa_1vm_sriov-vnf\r
37 ${nsd_pkg}   epa_1vm_sriov_ns\r
38 ${nsd_name}   epa_1vm_sriov-ns\r
39 ${ns_name}   epa_04\r
40 \r
41 # Fixed IPs and subnet for datanet VL\r
42 ${datanet_subnet}   192.168.100.0/24\r
43 ${datanet_ip1}   192.168.100.11\r
44 ${datanet_ip2}   192.168.100.22\r
45 \r
46 ${vnf_member_index_1}   1\r
47 ${vnf_member_index_2}   2\r
48 ${username}   ubuntu\r
49 ${password}   osm4u\r
50 ${ns_config}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} , {name: datanet, ip-profile: {ip-version: ipv4, subnet-address: "${datanet_subnet}"}, vnfd-connection-point-ref: [ {member-vnf-index-ref: "1", vnfd-connection-point-ref: vnf-data-ext, ip-address: "${datanet_ip1}"}, {member-vnf-index-ref: "2", vnfd-connection-point-ref: vnf-data-ext, ip-address: "${datanet_ip2}"}]} ] }\r
51 ${success_return_code}   0\r
52 \r
53 \r
54 *** Test Cases ***\r
55 Create VNF Descriptor\r
56 \r
57     Remove Environment Variable  OVERRIDES\r
58     Create VNFD  '%{PACKAGES_FOLDER}/${vnfd_pkg}'\r
59 \r
60 \r
61 Create NS Descriptor\r
62 \r
63     Create NSD  '%{PACKAGES_FOLDER}/${nsd_pkg}'\r
64 \r
65 \r
66 Instantiate Network Service\r
67 \r
68     ${id}=  Create Network Service  ${nsd_name}  %{VIM_TARGET}  ${ns_name}  ${ns_config}  ${EMPTY}\r
69     Set Suite Variable  ${ns_id}  ${id}\r
70 \r
71 \r
72 Get Management Ip Addresses\r
73 \r
74     Variable Should Exist  ${ns_id}  msg=Network service instance is not available\r
75     ${ip}  Get Vnf Management Ip Address  ${ns_id}  ${vnf_member_index_1}\r
76     Set Suite Variable  ${ip_mgmt_1}  ${ip}\r
77     log  ${ip_mgmt_1}\r
78 \r
79     ${ip}  Get Vnf Management Ip Address  ${ns_id}  ${vnf_member_index_2}\r
80     Set Suite Variable  ${ip_mgmt_2}  ${ip}\r
81     log  ${ip_mgmt_2}\r
82 \r
83 \r
84 Ping from Vnf1 to Vnf2\r
85 \r
86     Variable Should Exist  ${ip_mgmt_1}  msg=IP address of the data VNF '${vnf_member_index_1}' is not available\r
87     Sleep   30 seconds   Wait for SSH daemon to be up\r
88     ${stdout}=   Execute Remote Command Check Rc Return Output   ${ip_mgmt_1}   ${username}   ${password}   ${EMPTY}   ip addr ; ping -c 5 ${datanet_ip2}\r
89     log  ${stdout}\r
90 \r
91 \r
92 Ping from Vnf2 to Vnf1\r
93 \r
94     Variable Should Exist  ${ip_mgmt_2}  msg=IP address of the data VNF '${vnf_member_index_2}' is not available\r
95     ${stdout}=   Execute Remote Command Check Rc Return Output   ${ip_mgmt_2}   ${username}   ${password}   ${EMPTY}   ip addr ; ping -c 5 ${datanet_ip1}\r
96     log  ${stdout}\r
97 \r
98 \r
99 Delete NS Instance\r
100     [Tags]   cleanup\r
101 \r
102     Delete NS  ${ns_name}\r
103 \r
104 \r
105 Delete NS Descriptor\r
106     [Tags]   cleanup\r
107 \r
108     Delete NSD  ${nsd_name}\r
109 \r
110 \r
111 Delete VNF Descriptor\r
112     [Tags]   cleanup\r
113 \r
114     Delete VNFD  ${vnfd_name}\r
115 \r
116 \r
117 \r
118 *** Keywords ***\r
119 Suite Cleanup\r
120     [Documentation]  Test Suite Cleanup: Deleting descriptors and NS instance\r
121 \r
122     Run Keyword If Any Tests Failed  Delete NS  ${ns_name}\r
123 \r
124     Run Keyword If Any Tests Failed  Delete NSD  ${nsd_name}\r
125 \r
126     Run Keyword If Any Tests Failed  Delete VNFD  ${vnfd_name}\r
127 \r