Bug 2327 fix to verify ipaddress in sol003_02 testsuite
[osm/tests.git] / robot-systest / testsuite / epa_05-epa_underlay_passthrough.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-05] EPA underlay PASSTHROUGH.
17
18 Library   OperatingSystem
19 Library   String
20 Library   Collections
21 Library   SSHLibrary
22
23 Resource   ../lib/vnfd_lib.resource
24 Resource   ../lib/vnf_lib.resource
25 Resource   ../lib/nsd_lib.resource
26 Resource   ../lib/ns_lib.resource
27 Resource   ../lib/ssh_lib.resource
28 Resource   ../lib/openstack_lib.resource
29
30 Test Tags   epa_05   cluster_epa
31
32 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
33
34
35 *** Variables ***
36 # NS and VNF descriptor package folder and ids
37 ${VNFD_PKG}   epa_1vm_passthrough_vnf
38 ${VNFD_NAME}   epa_1vm_passthrough-vnf
39 ${NSD_PKG}   epa_1vm_passthrough_ns
40 ${NSD_NAME}   epa_1vm_passthrough-ns
41 ${NS_NAME}   epa_05
42
43 # Fixed IPs and subnet for datanet VL
44 ${DATANET_SUBNET}   192.168.110.0/24
45 ${DATANET_IP1}   192.168.110.11
46 ${DATANET_IP2}   192.168.110.22
47
48 ${VNF_MEMBER_INDEX_1}   vnf1
49 ${VNF_MEMBER_INDEX_2}   vnf2
50 ${USERNAME}   ubuntu
51 ${PASSWORD}   osm4u
52 ${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: "${VNF_MEMBER_INDEX_1}", vnfd-connection-point-ref: vnf-data-ext, ip-address: "${DATANET_IP1}"}, {member-vnf-index-ref: "${VNF_MEMBER_INDEX_2}", vnfd-connection-point-ref: vnf-data-ext, ip-address: "${DATANET_IP2}"}]} ] }
53 ${SUCCESS_RETURN_CODE}   0
54
55
56 *** Test Cases ***
57 Create VNF Descriptor
58     [Documentation]   Upload VNF package for the testsuite.
59     Remove Environment Variable   OVERRIDES
60     Create VNFD   '%{PACKAGES_FOLDER}/${VNFD_PKG}'
61
62 Create NS Descriptor
63     [Documentation]   Upload NS package for the testsuite.
64     Create NSD   '%{PACKAGES_FOLDER}/${NSD_PKG}'
65
66 Instantiate Network Service
67     [Documentation]   Instantiate NS for the testsuite.
68     ${id}=   Create Network Service   ${NSD_NAME}   %{VIM_TARGET}   ${NS_NAME}   ${NS_CONFIG}   ${EMPTY}
69     Set Suite Variable   ${NS_ID}   ${id}
70
71 Get Management Ip Addresses
72     [Documentation]   Get the mgmt IP addresses of both VNF of the NS.
73     Variable Should Exist   ${NS_ID}   msg=Network service instance is not available
74     ${ip}=   Get Vnf Management Ip Address   ${NS_ID}   ${VNF_MEMBER_INDEX_1}
75     Set Suite Variable   ${IP_MGMT_1}   ${ip}
76     Log   ${IP_MGMT_1}
77     ${ip}=   Get Vnf Management Ip Address   ${NS_ID}   ${VNF_MEMBER_INDEX_2}
78     Set Suite Variable   ${IP_MGMT_2}   ${ip}
79     Log   ${IP_MGMT_2}
80
81 Ping from Vnf1 to Vnf2
82     [Documentation]   Check connectivity from the first VNF to the second VNF using ping.
83     Variable Should Exist   ${IP_MGMT_1}   msg=IP address of the data VNF '${VNF_MEMBER_INDEX_1}' is not available
84     Sleep   30 seconds   Wait for SSH daemon to be up
85     ${stdout}=   Execute Remote Command Check Rc Return Output   ${IP_MGMT_1}   ${USERNAME}   ${PASSWORD}   ${EMPTY}   ip addr ; ping -c 5 ${DATANET_IP2}
86     Log   ${stdout}
87
88 Ping from Vnf2 to Vnf1
89     [Documentation]   Check connectivity from the second VNF to the first VNF using ping.
90     Variable Should Exist   ${IP_MGMT_2}   msg=IP address of the data VNF '${VNF_MEMBER_INDEX_2}' is not available
91     ${stdout}=   Execute Remote Command Check Rc Return Output   ${IP_MGMT_2}   ${USERNAME}   ${PASSWORD}   ${EMPTY}   ip addr ; ping -c 5 ${DATANET_IP1}
92     Log   ${stdout}
93
94 Delete NS Instance
95     [Documentation]   Delete NS instance.
96     [Tags]   cleanup
97     Delete NS   ${NS_NAME}
98
99 Delete NS Descriptor
100     [Documentation]   Delete NS package from OSM.
101     [Tags]   cleanup
102     Delete NSD   ${NSD_NAME}
103
104 Delete VNF Descriptor
105     [Documentation]   Delete VNF package from OSM.
106     [Tags]   cleanup
107     Delete VNFD   ${VNFD_NAME}
108
109
110 *** Keywords ***
111 Suite Cleanup
112     [Documentation]   Test Suite Cleanup: Deleting descriptors and NS instance
113     Run Keyword If Any Tests Failed   Delete NS   ${NS_NAME}
114     Run Keyword If Any Tests Failed   Delete NSD   ${NSD_NAME}
115     Run Keyword If Any Tests Failed   Delete VNFD   ${VNFD_NAME}