| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +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 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [BASIC-09] Manual VNF/VDU Scaling. |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 17 | |
| 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 22 | Resource ../lib/vnfd_lib.resource |
| 23 | Resource ../lib/nsd_lib.resource |
| 24 | Resource ../lib/ns_lib.resource |
| 25 | Resource ../lib/ns_operation_lib.resource |
| 26 | Resource ../lib/ssh_lib.resource |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 27 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 28 | Test Tags basic_09 cluster_main daily regression azure |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 29 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 30 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 31 | |
| 32 | |
| 33 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 34 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 35 | ${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 |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 39 | |
| 40 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${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 Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 45 | |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 46 | # SSH public key file |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 47 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 48 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 49 | |
| 50 | *** Test Cases *** |
| 51 | Create Scaling VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 52 | [Documentation] Upload VNF package for the testsuite. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 53 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 54 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 55 | |
| 56 | Create Scaling NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 57 | [Documentation] Upload NS package for the testsuite. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 58 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 59 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 60 | |
| 61 | Instantiate Scaling Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 62 | [Documentation] Instantiate NS for the testsuite. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 63 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 64 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 65 | Log ${id} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 66 | |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 67 | Get Ns Id |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | [Documentation] Retrieve NS instance id to be used later on. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 69 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 70 | ${id}= Get Ns Id ${NS_NAME} |
| 71 | Set Suite Variable ${NS_ID} ${id} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 72 | |
| 73 | Get Vnf Id |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 74 | [Documentation] Retrieve VNF instance id to be used later on. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 75 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 76 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 77 | @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 78 | Log List ${vnfr_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 79 | Set Suite Variable ${VNF_ID} ${vnfr_list}[0] |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 80 | |
| 81 | Get Vdus Before Scale Out |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | [Documentation] Check the number of VDUs instances before the manual scaling. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 83 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 84 | @{vdur_list}= Get Vnf Vdur Names ${VNF_ID} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 85 | Log List ${vdur_list} |
| 86 | ${vdurs}= Get Length ${vdur_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 87 | Set Suite Variable ${INITIAL_VDUR_COUNT} ${vdurs} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 88 | |
| 89 | Perform Manual Vdu Scale Out |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | [Documentation] Perform a manual scale-out operation of the VNF. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 91 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 92 | 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 Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 95 | |
| 96 | Check Vdus After Scale Out |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 97 | [Documentation] Check whether there is one more VDU after scaling out. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 98 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 99 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 100 | @{vdur_list}= Get Vnf Vdur Names ${VNF_ID} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 101 | Log List ${vdur_list} |
| 102 | ${vdurs}= Get Length ${vdur_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 103 | IF ${vdurs} != ${INITIAL_VDUR_COUNT} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 104 | |
| 105 | Perform Manual Vdu Scale In |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 106 | [Documentation] Perform a manual scale-in operation of the VNF. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 107 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 108 | 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 Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 111 | |
| 112 | Check Vdus After Scaling In |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 113 | [Documentation] Check whether there is one less VDU after scaling in. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 114 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 115 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 116 | @{vdur_list}= Get Vnf Vdur Names ${VNF_ID} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 117 | Log List ${vdur_list} |
| 118 | ${vdurs}= Get Length ${vdur_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 119 | IF ${vdurs} != ${INITIAL_VDUR_COUNT} Fail msg=There is the same number of VDU records in the VNF after Scale In |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 120 | |
| 121 | Delete NS Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 122 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 123 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 124 | Delete NS ${NS_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 125 | |
| 126 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 127 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 128 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 129 | Delete NSD ${NSD_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 130 | |
| 131 | Delete VNF Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 132 | [Documentation] Delete VNF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 133 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 134 | Delete VNFD ${VNFD_NAME} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 135 | |
| 136 | |
| 137 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 138 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 139 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 140 | 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} |