blob: d278e6307e50c690f1ef58defebf5a26415616b0 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
garciaale0e696252020-09-24 18:04:27 +00002# 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
garciadeblas7a9e0312023-12-11 22:24:46 +010014
garciaale0e696252020-09-24 18:04:27 +000015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [EPA-02] Support for additional EPA capabilities.
garciaale0e696252020-09-24 18:04:27 +000017
18Library OperatingSystem
19Library String
20Library Collections
21Library SSHLibrary
22
garciadeblas7a9e0312023-12-11 22:24:46 +010023Resource ../lib/vnfd_lib.resource
24Resource ../lib/vnf_lib.resource
25Resource ../lib/nsd_lib.resource
26Resource ../lib/ns_lib.resource
27Resource ../lib/openstack_lib.resource
garciaale0e696252020-09-24 18:04:27 +000028
garciadeblas7a9e0312023-12-11 22:24:46 +010029Test Tags epa_02 cluster_epa daily regression
garciadeblas4cf45d72021-04-08 13:52:22 +020030
garciadeblasd225e552020-10-02 16:10:14 +000031Suite Teardown Run Keyword And Ignore Error Suite Cleanup
garciaale0e696252020-09-24 18:04:27 +000032
33
34*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020035# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010036${VNFD_PKG} epa_quota_vnf
37${VNFD_NAME} epa_quota-vnf
38${NSD_PKG} epa_quota_ns
39${NSD_NAME} epa_quota-ns
almagiab4697d32021-05-25 08:56:17 +020040
41# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010042${NS_NAME} epa_02-epa_quota_test
43${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
almagiab4697d32021-05-25 08:56:17 +020044
45# SSH public keys file
garciadeblas7a9e0312023-12-11 22:24:46 +010046${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
almagiab4697d32021-05-25 08:56:17 +020047
garciadeblas7a9e0312023-12-11 22:24:46 +010048${NS_ID} ${EMPTY}
49${VNF_SERVER_ID} ${EMPTY}
50${FLAVOR_PROPERTIES} ${EMPTY}
51${SUCCESS_RETURN_CODE} 0
garciaale0e696252020-09-24 18:04:27 +000052
53
54*** Test Cases ***
55Create VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010056 [Documentation] Upload VNF package for the testsuite.
garciadeblasf4ebaa82022-06-23 13:33:26 +020057 Remove Environment Variable OVERRIDES
garciadeblas7a9e0312023-12-11 22:24:46 +010058 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
garciaale0e696252020-09-24 18:04:27 +000059
60Create NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010061 [Documentation] Upload NS package for the testsuite.
62 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
garciaale0e696252020-09-24 18:04:27 +000063
64Instantiate Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010065 [Documentation] Instantiate the NS for the testsuite.
66 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
67 Set Suite Variable ${NS_ID} ${id}
garciaale0e696252020-09-24 18:04:27 +000068
69Get VNF Server ID
garciadeblas7a9e0312023-12-11 22:24:46 +010070 [Documentation] Get the id of the VM at the VIM and store in VNF_SERVER_ID suite variable to be used later on.
71 ${vnfs_list}= Get Ns Vnf List ${NS_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +020072 ${vim_id}= Get VNF VIM ID ${vnfs_list}[0]
garciadeblas321726f2022-12-21 11:43:06 +010073 Log ${vim_id}
garciadeblas7a9e0312023-12-11 22:24:46 +010074 Set Suite Variable ${VNF_SERVER_ID} ${vim_id}
garciaale0e696252020-09-24 18:04:27 +000075
76Get Server Flavor Properties
garciadeblas7a9e0312023-12-11 22:24:46 +010077 [Documentation] Get from the VIM the flavor properties of the VM with id VNF_SERVER_ID.
78 ${flavor_id}= Get Server Flavor ID ${VNF_SERVER_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +020079 ${properties}= Get Flavor Properties ${flavor_id}
garciadeblas321726f2022-12-21 11:43:06 +010080 Log ${properties}
garciadeblas7a9e0312023-12-11 22:24:46 +010081 Set Suite Variable ${FLAVOR_PROPERTIES} ${properties}
garciaale0e696252020-09-24 18:04:27 +000082
83Check Flavor Quota Properties
garciadeblas7a9e0312023-12-11 22:24:46 +010084 [Documentation] Assert that the flavor properties include the expected EPA parameters included in the descriptor.
85 ${rc}= Run And Return Rc echo ${FLAVOR_PROPERTIES} | grep "cpu_shares_level=custom"
86 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
87 ${rc}= Run And Return Rc echo ${FLAVOR_PROPERTIES} | grep "disk_io_shares_level=custom"
88 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
89 ${rc}= Run And Return Rc echo ${FLAVOR_PROPERTIES} | grep "memory_shares_level=custom"
90 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
garciaale0e696252020-09-24 18:04:27 +000091
92Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010093 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020094 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010095 Delete NS ${NS_NAME}
garciaale0e696252020-09-24 18:04:27 +000096
97Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010098 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020099 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 Delete NSD ${NSD_NAME}
garciaale0e696252020-09-24 18:04:27 +0000101
102Delete VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100103 [Documentation] Delete VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200104 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 Delete VNFD ${VNFD_NAME}
garciaale0e696252020-09-24 18:04:27 +0000106
107
108*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000109Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200110 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100111 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
112 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
113 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}