| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [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 | |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [FAIL-01] A single VNF with 2 VDUs, one of them unallocatable because of resources. |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [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/nsd_lib.resource |
| 25 | Resource ../lib/ns_lib.resource |
| 26 | Resource ../lib/openstack_lib.resource |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 27 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 28 | Test Tags fail_01 cluster_main daily regression |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 29 | |
| 30 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 31 | |
| 32 | |
| 33 | *** Variables *** |
| 34 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 35 | ${VNFD_PKG} simple_2vm_vnf |
| 36 | ${VNFD_NAME} simple_2vm-vnf |
| 37 | ${NSD_PKG} simple_2vm_ns |
| 38 | ${NSD_NAME} simple_2vm-ns |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 39 | |
| 40 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${NS_NAME_PREFIX} fail_01 |
| 42 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 43 | |
| 44 | # SSH keys to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 45 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 46 | |
| aguilard | ceb1cb4 | 2022-02-24 10:54:14 +0000 | [diff] [blame] | 47 | # Default memory in GB for dataVM VDU (can be overwritten by VM_MEMORY_OVERRIDE environment variable) |
| 48 | # Only used if no quota is defined in Openstack's project (VDU tries to allocate the full memory of the quota) |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 49 | ${DEFAULT_MEMORY} 250 |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 50 | |
| 51 | # NS launch timeout and polling time |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 52 | ${NS_LAUNCH_MAX_WAIT_TIME} 5min |
| 53 | ${NS_LAUNCH_POL_TIME} 15 |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 54 | |
| 55 | # Openstack delete operation timeout and polling time |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 56 | ${OS_DELETE_MAX_WAIT_TIME} 6min |
| 57 | ${OS_DELETE_POL_TIME} 20 |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 58 | |
| 59 | |
| 60 | *** Test Cases *** |
| 61 | Create VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 62 | [Documentation] Upload VNF package for the testsuite. |
| aguilard | ceb1cb4 | 2022-02-24 10:54:14 +0000 | [diff] [blame] | 63 | ${ram_quota}= Get Project Quota ram |
| 64 | IF ${ram_quota} == -1 |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | ${memory}= Get Environment Variable VM_MEMORY_OVERRIDE default=${DEFAULT_MEMORY} |
| aguilard | ceb1cb4 | 2022-02-24 10:54:14 +0000 | [diff] [blame] | 66 | ELSE |
| 67 | ${memory}= Evaluate ${ram_quota} / 1000 |
| 68 | END |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 69 | Log ${memory} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 70 | Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${VNFD_PKG}' virtual-compute-desc.1.virtual-memory.size=${memory} |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 71 | |
| 72 | Create NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 73 | [Documentation] Upload NS package for the testsuite. |
| 74 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 75 | |
| 76 | Cannot Instantiate Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 77 | [Documentation] Assert failure when trying to instantiate the NS instance and there are not enough resources in the VIM. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 78 | ${rand}= Generate Random String 4 [NUMBERS] |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 79 | ${ns_name}= Catenate SEPARATOR=_ ${NS_NAME_PREFIX} ${rand} |
| 80 | Set Suite Variable ${NS_NAME} |
| 81 | Log ${NS_NAME} |
| 82 | ${id}= Instantiate Network Service ${NS_NAME} ${NSD_NAME} %{VIM_TARGET} --config '${NS_CONFIG}' --ssh_keys ${PUBLICKEY} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 83 | Log ${id} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 84 | Set Suite Variable ${NS_ID} ${id} |
| 85 | WAIT UNTIL KEYWORD SUCCEEDS ${NS_LAUNCH_MAX_WAIT_TIME} ${NS_LAUNCH_POL_TIME} Check For Ns Instance To Configured ${NS_NAME} |
| 86 | ${rc} ${stdout}= Run And Return Rc And Output osm ns-list --filter id="${NS_ID}" | grep ${NS_ID} | awk '{print $8}' |
| 87 | Log ${rc},${stdout} |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 88 | Should Contain ${stdout} BROKEN |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 89 | ${rc} ${stdout}= Run And Return Rc And Output osm ns-show ${NS_ID} --literal | yq .errorDetail |
| 90 | Log ${rc},${stdout} |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 91 | Should Contain ${stdout} Deploying at VIM: Error at create vdu |
| 92 | |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 93 | Delete NS Instance And Check VIM |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 94 | [Documentation] Delete NS instance and check that the VMs have been deleted. |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 95 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 96 | Delete NS ${NS_NAME} |
| 97 | WAIT UNTIL KEYWORD SUCCEEDS ${OS_DELETE_MAX_WAIT_TIME} ${OS_DELETE_POL_TIME} Check NS Servers In VIM ${NS_NAME} 0 |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 98 | |
| 99 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 100 | [Documentation] Delete NS package from OSM. |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 101 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 102 | Delete NSD ${NSD_NAME} |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 103 | |
| 104 | Delete VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 105 | [Documentation] Delete VNF package from OSM. |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 106 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 107 | Delete VNFD ${VNFD_NAME} |
| aguilard | 3422ec3 | 2021-06-30 12:28:46 +0200 | [diff] [blame] | 108 | |
| 109 | |
| 110 | *** Keywords *** |
| 111 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 112 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 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} |