blob: 46860fbb2c266a5e4f9c4b4c5350d3f56f1f1bbd [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Alexis Romerodd1b09d2022-03-16 06:51:43 +01002# 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
Alexis Romerodd1b09d2022-03-16 06:51:43 +010015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [BASIC-24] VNF with two VDUs belonging to an Openstack server group
Alexis Romerodd1b09d2022-03-16 06:51:43 +010017
18Library OperatingSystem
19Library String
20Library Collections
21Library Process
22
garciadeblas7a9e0312023-12-11 22:24:46 +010023Resource ../lib/vnfd_lib.resource
24Resource ../lib/nsd_lib.resource
25Resource ../lib/ns_lib.resource
26Resource ../lib/vnf_lib.resource
27Resource ../lib/openstack_lib.resource
Alexis Romerodd1b09d2022-03-16 06:51:43 +010028
garciadeblas7a9e0312023-12-11 22:24:46 +010029Test Tags basic_24 cluster_main daily regression
Alexis Romerodd1b09d2022-03-16 06:51:43 +010030
31Suite Teardown Run Keyword And Ignore Error Suite Cleanup
32
33
34*** Variables ***
35# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010036${VNFD_PKG} affinity_basic_vnf
37${VNFD_NAME} affinity_basic-vnf
38${NSD_PKG} affinity_basic_ns
39${NSD_NAME} affinity_basic-ns
Alexis Romerodd1b09d2022-03-16 06:51:43 +010040
41# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010042${NS_NAME} basic_24
43${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
Alexis Romerodd1b09d2022-03-16 06:51:43 +010044
45# SSH keys and username to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010046${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47${PRIVATEKEY} %{HOME}/.ssh/id_rsa
48${USERNAME} ubuntu
49${PASSWORD} ${EMPTY}
Alexis Romerodd1b09d2022-03-16 06:51:43 +010050
garciadeblas7a9e0312023-12-11 22:24:46 +010051${NS_ID} ${EMPTY}
52${VNF_MEMBER_INDEX} affinity-basic-1
53${SUCCESS_RETURN_CODE} 0
54
Alexis Romerodd1b09d2022-03-16 06:51:43 +010055
56*** Test Cases ***
57Create VNF Package
garciadeblas7a9e0312023-12-11 22:24:46 +010058 [Documentation] Upload VNF package for the testsuite.
59 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Alexis Romerodd1b09d2022-03-16 06:51:43 +010060
61Create NS Package
garciadeblas7a9e0312023-12-11 22:24:46 +010062 [Documentation] Upload NS package for the testsuite.
63 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Alexis Romerodd1b09d2022-03-16 06:51:43 +010064
65Network Service Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010066 [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 Romerodd1b09d2022-03-16 06:51:43 +010069
70Check Vnf Affinity Groups
garciadeblas7a9e0312023-12-11 22:24:46 +010071 [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 Romerodd1b09d2022-03-16 06:51:43 +010075 FOR ${vdur_id} IN @{vdur_id_list}
garciadeblas7a9e0312023-12-11 22:24:46 +010076 ${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 Romerodd1b09d2022-03-16 06:51:43 +010078 Check VM In Server Group ${vm_vim_id} ${server_group_name}
79 END
80
Alexis Romerodd1b09d2022-03-16 06:51:43 +010081Delete NS Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010082 [Documentation] Delete NS instance.
Alexis Romerodd1b09d2022-03-16 06:51:43 +010083 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010084 Delete NS ${NS_NAME}
Alexis Romerodd1b09d2022-03-16 06:51:43 +010085
86Delete NS Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010087 [Documentation] Delete NS package from OSM.
Alexis Romerodd1b09d2022-03-16 06:51:43 +010088 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010089 Delete NSD ${NSD_NAME}
Alexis Romerodd1b09d2022-03-16 06:51:43 +010090
91Delete VNF Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010092 [Documentation] Delete VNF package from OSM.
Alexis Romerodd1b09d2022-03-16 06:51:43 +010093 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010094 Delete VNFD ${VNFD_NAME}
Alexis Romerodd1b09d2022-03-16 06:51:43 +010095
96
97*** Keywords ***
98Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +020099 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 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}