| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 1 | *** Comments *** |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [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 | |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [BASIC-24] VNF with two VDUs belonging to an Openstack server group |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 17 | |
| 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library Process |
| 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/vnf_lib.resource |
| 27 | Resource ../lib/openstack_lib.resource |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 28 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 29 | Test Tags basic_24 cluster_main daily regression |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 30 | |
| 31 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 32 | |
| 33 | |
| 34 | *** Variables *** |
| 35 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 36 | ${VNFD_PKG} affinity_basic_vnf |
| 37 | ${VNFD_NAME} affinity_basic-vnf |
| 38 | ${NSD_PKG} affinity_basic_ns |
| 39 | ${NSD_NAME} affinity_basic-ns |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 40 | |
| 41 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 42 | ${NS_NAME} basic_24 |
| 43 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 44 | |
| 45 | # SSH keys and username to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 46 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| 47 | ${PRIVATEKEY} %{HOME}/.ssh/id_rsa |
| 48 | ${USERNAME} ubuntu |
| 49 | ${PASSWORD} ${EMPTY} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 50 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 51 | ${NS_ID} ${EMPTY} |
| 52 | ${VNF_MEMBER_INDEX} affinity-basic-1 |
| 53 | ${SUCCESS_RETURN_CODE} 0 |
| 54 | |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 55 | |
| 56 | *** Test Cases *** |
| 57 | Create VNF Package |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 58 | [Documentation] Upload VNF package for the testsuite. |
| 59 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 60 | |
| 61 | Create NS Package |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 62 | [Documentation] Upload NS package for the testsuite. |
| 63 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 64 | |
| 65 | Network Service Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 66 | [Documentation] Instantiate NS for the testsuite. |
| 67 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 68 | Set Suite Variable ${NS_ID} ${id} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 69 | |
| 70 | Check Vnf Affinity Groups |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 71 | [Documentation] Check that all VDUs of the VNF belong to the expected affinity group. |
| 72 | Variable Should Exist ${NS_ID} msg=NS is not available |
| 73 | ${vnf_id}= Get Vnf Id ${NS_ID} ${VNF_MEMBER_INDEX} |
| 74 | @{vdur_id_list}= Get VDU List From VNF ${vnf_id} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 75 | FOR ${vdur_id} IN @{vdur_id_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 76 | ${server_group_name}= Get VDU Affinity Group Name ${NS_NAME} ${vnf_id} ${vdur_id} |
| 77 | ${vm_vim_id}= Get VDU VIM Id ${vnf_id} ${vdur_id} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 78 | Check VM In Server Group ${vm_vim_id} ${server_group_name} |
| 79 | END |
| 80 | |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 81 | Delete NS Instance Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 82 | [Documentation] Delete NS instance. |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 83 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 84 | Delete NS ${NS_NAME} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 85 | |
| 86 | Delete NS Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 87 | [Documentation] Delete NS package from OSM. |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 88 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 89 | Delete NSD ${NSD_NAME} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 90 | |
| 91 | Delete VNF Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 92 | [Documentation] Delete VNF package from OSM. |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 93 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 94 | Delete VNFD ${VNFD_NAME} |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 95 | |
| 96 | |
| 97 | *** Keywords *** |
| 98 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 99 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame^] | 100 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 101 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 102 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |