blob: 1f76c71c8be97b02bd816b429f0fe9a2ff79a889 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Felipe Vicensf96bb452020-06-22 08:12:30 +02002# 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
Felipe Vicensf96bb452020-06-22 08:12:30 +020015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [BASIC-09] Manual VNF/VDU Scaling.
Felipe Vicensf96bb452020-06-22 08:12:30 +020017
18Library OperatingSystem
19Library String
20Library Collections
21
garciadeblas7a9e0312023-12-11 22:24:46 +010022Resource ../lib/vnfd_lib.resource
23Resource ../lib/nsd_lib.resource
24Resource ../lib/ns_lib.resource
25Resource ../lib/ns_operation_lib.resource
26Resource ../lib/ssh_lib.resource
Felipe Vicensf96bb452020-06-22 08:12:30 +020027
garciadeblas7a9e0312023-12-11 22:24:46 +010028Test Tags basic_09 cluster_main daily regression azure
garciadeblas4cf45d72021-04-08 13:52:22 +020029
garciadeblasd225e552020-10-02 16:10:14 +000030Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +020031
32
33*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020034# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010035${VNFD_PKG} hackfest_basic_metrics_vnf
36${VNFD_NAME} hackfest_basic_metrics-vnf
37${NSD_PKG} hackfest_basic_metrics_ns
38${NSD_NAME} hackfest_basic-ns-metrics
almagiab4697d32021-05-25 08:56:17 +020039
40# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010041${NS_NAME} basic_09_manual_scaling_test
42${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43${SCALING_GROUP} vdu_autoscale
44${VNF_MEMBER_INDEX} vnf
Felipe Vicensf96bb452020-06-22 08:12:30 +020045
almagiab4697d32021-05-25 08:56:17 +020046# SSH public key file
garciadeblas7a9e0312023-12-11 22:24:46 +010047${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
almagiab4697d32021-05-25 08:56:17 +020048
Felipe Vicensf96bb452020-06-22 08:12:30 +020049
50*** Test Cases ***
51Create Scaling VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010052 [Documentation] Upload VNF package for the testsuite.
rodriguezgarfbedfe02022-02-24 20:05:42 +010053 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010054 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020055
56Create Scaling NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010057 [Documentation] Upload NS package for the testsuite.
rodriguezgarfbedfe02022-02-24 20:05:42 +010058 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010059 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020060
61Instantiate Scaling Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010062 [Documentation] Instantiate NS for the testsuite.
rodriguezgarfbedfe02022-02-24 20:05:42 +010063 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010064 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
65 Log ${id}
Felipe Vicensf96bb452020-06-22 08:12:30 +020066
rodriguezgarfbedfe02022-02-24 20:05:42 +010067Get Ns Id
garciadeblas7a9e0312023-12-11 22:24:46 +010068 [Documentation] Retrieve NS instance id to be used later on.
rodriguezgarfbedfe02022-02-24 20:05:42 +010069 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010070 ${id}= Get Ns Id ${NS_NAME}
71 Set Suite Variable ${NS_ID} ${id}
Felipe Vicensf96bb452020-06-22 08:12:30 +020072
73Get Vnf Id
garciadeblas7a9e0312023-12-11 22:24:46 +010074 [Documentation] Retrieve VNF instance id to be used later on.
rodriguezgarfbedfe02022-02-24 20:05:42 +010075 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010076 Variable Should Exist ${NS_ID} msg=Network service instance is not available
77 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +020078 Log List ${vnfr_list}
garciadeblas7a9e0312023-12-11 22:24:46 +010079 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
Felipe Vicensf96bb452020-06-22 08:12:30 +020080
81Get Vdus Before Scale Out
garciadeblas7a9e0312023-12-11 22:24:46 +010082 [Documentation] Check the number of VDUs instances before the manual scaling.
rodriguezgarfbedfe02022-02-24 20:05:42 +010083 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010084 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +020085 Log List ${vdur_list}
86 ${vdurs}= Get Length ${vdur_list}
garciadeblas7a9e0312023-12-11 22:24:46 +010087 Set Suite Variable ${INITIAL_VDUR_COUNT} ${vdurs}
Felipe Vicensf96bb452020-06-22 08:12:30 +020088
89Perform Manual Vdu Scale Out
garciadeblas7a9e0312023-12-11 22:24:46 +010090 [Documentation] Perform a manual scale-out operation of the VNF.
rodriguezgarfbedfe02022-02-24 20:05:42 +010091 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010092 Variable Should Exist ${NS_ID} msg=Network service instance is not available
93 ${ns_op_id}= Execute Manual VNF Scale ${NS_NAME} ${VNF_MEMBER_INDEX} ${SCALING_GROUP} SCALE_OUT
94 Log ${ns_op_id}
Felipe Vicensf96bb452020-06-22 08:12:30 +020095
96Check Vdus After Scale Out
garciadeblas7a9e0312023-12-11 22:24:46 +010097 [Documentation] Check whether there is one more VDU after scaling out.
rodriguezgarfbedfe02022-02-24 20:05:42 +010098 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010099 Variable Should Exist ${NS_ID} msg=Network service instance is not available
100 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +0200101 Log List ${vdur_list}
102 ${vdurs}= Get Length ${vdur_list}
garciadeblas7a9e0312023-12-11 22:24:46 +0100103 IF ${vdurs} != ${INITIAL_VDUR_COUNT} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out
Felipe Vicensf96bb452020-06-22 08:12:30 +0200104
105Perform Manual Vdu Scale In
garciadeblas7a9e0312023-12-11 22:24:46 +0100106 [Documentation] Perform a manual scale-in operation of the VNF.
rodriguezgarfbedfe02022-02-24 20:05:42 +0100107 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100108 Variable Should Exist ${NS_ID} msg=Network service instance is not available
109 ${ns_op_id}= Execute Manual VNF Scale ${NS_NAME} ${VNF_MEMBER_INDEX} ${SCALING_GROUP} SCALE_IN
110 Log ${ns_op_id}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200111
112Check Vdus After Scaling In
garciadeblas7a9e0312023-12-11 22:24:46 +0100113 [Documentation] Check whether there is one less VDU after scaling in.
rodriguezgarfbedfe02022-02-24 20:05:42 +0100114 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100115 Variable Should Exist ${NS_ID} msg=Network service instance is not available
116 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +0200117 Log List ${vdur_list}
118 ${vdurs}= Get Length ${vdur_list}
garciadeblas7a9e0312023-12-11 22:24:46 +0100119 IF ${vdurs} != ${INITIAL_VDUR_COUNT} Fail msg=There is the same number of VDU records in the VNF after Scale In
Felipe Vicensf96bb452020-06-22 08:12:30 +0200120
121Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100122 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +0200123 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100124 Delete NS ${NS_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200125
126Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100127 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200128 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100129 Delete NSD ${NSD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200130
131Delete VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100132 [Documentation] Delete VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200133 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100134 Delete VNFD ${VNFD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200135
136
137*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000138Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200139 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100140 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
141 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
142 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}