| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 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 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 14 | |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [EPA-02] Support for additional EPA capabilities. |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 17 | |
| 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library SSHLibrary |
| 22 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 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/openstack_lib.resource |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 28 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 29 | Test Tags epa_02 cluster_epa daily regression |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 30 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 31 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 32 | |
| 33 | |
| 34 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 35 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 36 | ${VNFD_PKG} epa_quota_vnf |
| 37 | ${VNFD_NAME} epa_quota-vnf |
| 38 | ${NSD_PKG} epa_quota_ns |
| 39 | ${NSD_NAME} epa_quota-ns |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 40 | |
| 41 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 42 | ${NS_NAME} epa_02-epa_quota_test |
| 43 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 44 | |
| 45 | # SSH public keys file |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 46 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 47 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 48 | ${NS_ID} ${EMPTY} |
| 49 | ${VNF_SERVER_ID} ${EMPTY} |
| 50 | ${FLAVOR_PROPERTIES} ${EMPTY} |
| 51 | ${SUCCESS_RETURN_CODE} 0 |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 52 | |
| 53 | |
| 54 | *** Test Cases *** |
| 55 | Create VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 56 | [Documentation] Upload VNF package for the testsuite. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 57 | Remove Environment Variable OVERRIDES |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 58 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 59 | |
| 60 | Create NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 61 | [Documentation] Upload NS package for the testsuite. |
| 62 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 63 | |
| 64 | Instantiate Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | [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} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 68 | |
| 69 | Get VNF Server ID |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 70 | [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} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 72 | ${vim_id}= Get VNF VIM ID ${vnfs_list}[0] |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 73 | Log ${vim_id} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 74 | Set Suite Variable ${VNF_SERVER_ID} ${vim_id} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 75 | |
| 76 | Get Server Flavor Properties |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 77 | [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} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 79 | ${properties}= Get Flavor Properties ${flavor_id} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 80 | Log ${properties} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 81 | Set Suite Variable ${FLAVOR_PROPERTIES} ${properties} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 82 | |
| 83 | Check Flavor Quota Properties |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 84 | [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} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 91 | |
| 92 | Delete NS Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 93 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 94 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | Delete NS ${NS_NAME} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 96 | |
| 97 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 98 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 99 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 100 | Delete NSD ${NSD_NAME} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 101 | |
| 102 | Delete VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 103 | [Documentation] Delete VNF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 104 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 105 | Delete VNFD ${VNFD_NAME} |
| garciaale | 0e69625 | 2020-09-24 18:04:27 +0000 | [diff] [blame] | 106 | |
| 107 | |
| 108 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 109 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 110 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 111 | 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} |