blob: 38a7023cd72ee02287ee85560c87ae0408279991 [file] [log] [blame]
aguilarda504c5f2022-04-21 15:42:52 +02001# 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 ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020014Documentation [EPA-04] EPA underlay SR-IOV.
aguilarda504c5f2022-04-21 15:42:52 +020015
16Library OperatingSystem
17Library String
18Library Collections
19Library SSHLibrary
20
21Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
22Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnf_lib.robot
23Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
24Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
25Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
26Resource %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot
27
28Force Tags epa_04 cluster_epa daily regression
29
30Suite Teardown Run Keyword And Ignore Error Suite Cleanup
31
32
33*** Variables ***
34# NS and VNF descriptor package folder and ids
35${vnfd_pkg} epa_1vm_sriov_vnf
36${vnfd_name} epa_1vm_sriov-vnf
37${nsd_pkg} epa_1vm_sriov_ns
38${nsd_name} epa_1vm_sriov-ns
39${ns_name} epa_04
40
41# Fixed IPs and subnet for datanet VL
42${datanet_subnet} 192.168.100.0/24
43${datanet_ip1} 192.168.100.11
44${datanet_ip2} 192.168.100.22
45
46${vnf_member_index_1} vnf1
47${vnf_member_index_2} vnf2
48${username} ubuntu
49${password} osm4u
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: "${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}"}]} ] }
51${success_return_code} 0
52
53
54*** Test Cases ***
55Create VNF Descriptor
56
garciadeblasf4ebaa82022-06-23 13:33:26 +020057 Remove Environment Variable OVERRIDES
58 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
aguilarda504c5f2022-04-21 15:42:52 +020059
60
61Create NS Descriptor
62
garciadeblasf4ebaa82022-06-23 13:33:26 +020063 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
aguilarda504c5f2022-04-21 15:42:52 +020064
65
66Instantiate Network Service
67
garciadeblasf4ebaa82022-06-23 13:33:26 +020068 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY}
69 Set Suite Variable ${ns_id} ${id}
aguilarda504c5f2022-04-21 15:42:52 +020070
71
72Get Management Ip Addresses
73
garciadeblasf4ebaa82022-06-23 13:33:26 +020074 Variable Should Exist ${ns_id} msg=Network service instance is not available
75 ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1}
76 Set Suite Variable ${ip_mgmt_1} ${ip}
garciadeblas321726f2022-12-21 11:43:06 +010077 Log ${ip_mgmt_1}
aguilarda504c5f2022-04-21 15:42:52 +020078
garciadeblasf4ebaa82022-06-23 13:33:26 +020079 ${ip} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2}
80 Set Suite Variable ${ip_mgmt_2} ${ip}
garciadeblas321726f2022-12-21 11:43:06 +010081 Log ${ip_mgmt_2}
aguilarda504c5f2022-04-21 15:42:52 +020082
83
84Ping from Vnf1 to Vnf2
85
garciadeblasf4ebaa82022-06-23 13:33:26 +020086 Variable Should Exist ${ip_mgmt_1} msg=IP address of the data VNF '${vnf_member_index_1}' is not available
aguilarda504c5f2022-04-21 15:42:52 +020087 Sleep 30 seconds Wait for SSH daemon to be up
88 ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_1} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip2}
garciadeblas321726f2022-12-21 11:43:06 +010089 Log ${stdout}
aguilarda504c5f2022-04-21 15:42:52 +020090
91
92Ping from Vnf2 to Vnf1
93
garciadeblasf4ebaa82022-06-23 13:33:26 +020094 Variable Should Exist ${ip_mgmt_2} msg=IP address of the data VNF '${vnf_member_index_2}' is not available
aguilarda504c5f2022-04-21 15:42:52 +020095 ${stdout}= Execute Remote Command Check Rc Return Output ${ip_mgmt_2} ${username} ${password} ${EMPTY} ip addr ; ping -c 5 ${datanet_ip1}
garciadeblas321726f2022-12-21 11:43:06 +010096 Log ${stdout}
aguilarda504c5f2022-04-21 15:42:52 +020097
98
99Delete NS Instance
100 [Tags] cleanup
101
garciadeblasf4ebaa82022-06-23 13:33:26 +0200102 Delete NS ${ns_name}
aguilarda504c5f2022-04-21 15:42:52 +0200103
104
105Delete NS Descriptor
106 [Tags] cleanup
107
garciadeblasf4ebaa82022-06-23 13:33:26 +0200108 Delete NSD ${nsd_name}
aguilarda504c5f2022-04-21 15:42:52 +0200109
110
111Delete VNF Descriptor
112 [Tags] cleanup
113
garciadeblasf4ebaa82022-06-23 13:33:26 +0200114 Delete VNFD ${vnfd_name}
aguilarda504c5f2022-04-21 15:42:52 +0200115
116
117
118*** Keywords ***
119Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200120 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
aguilarda504c5f2022-04-21 15:42:52 +0200121
garciadeblasf4ebaa82022-06-23 13:33:26 +0200122 Run Keyword If Any Tests Failed Delete NS ${ns_name}
aguilarda504c5f2022-04-21 15:42:52 +0200123
garciadeblasf4ebaa82022-06-23 13:33:26 +0200124 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
aguilarda504c5f2022-04-21 15:42:52 +0200125
garciadeblasf4ebaa82022-06-23 13:33:26 +0200126 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
aguilarda504c5f2022-04-21 15:42:52 +0200127