| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [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 | |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [K8s-04] Openldap Helm chart. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 17 | |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 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/ns_operation_lib.resource |
| 27 | Resource ../lib/connectivity_lib.resource |
| 28 | Resource ../lib/ssh_lib.resource |
| 29 | Resource ../lib/k8scluster_lib.resource |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 30 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 31 | Test Tags k8s_04 cluster_k8s daily regression sanity azure |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 32 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 33 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 34 | |
| 35 | |
| 36 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 37 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 38 | ${VNFD_PKG} openldap_knf |
| 39 | ${VNFD_NAME} openldap_knf |
| 40 | ${NSD_PKG} openldap_ns |
| 41 | ${NSD_NAME} openldap_ns |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 42 | |
| 43 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 44 | ${NS_NAME} ldap |
| 45 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}}], additionalParamsForVnf: [ {member-vnf-index: openldap, additionalParamsForKdu: [ {kdu_name: ldap, additionalParams: {service: {type: LoadBalancer }, adminPassword: admin}} ] } ] } |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 46 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 47 | ${NS_ID} ${EMPTY} |
| 48 | ${PUBLICKEY} ${EMPTY} |
| 49 | ${VNF_MEMBER_INDEX} openldap |
| 50 | ${KDU_NAME} ldap |
| 51 | ${UPGRADE_ACTION} upgrade |
| 52 | ${ROLLBACK_ACTION} rollback |
| 53 | ${REPLICA_COUNT} 3 |
| 54 | |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 55 | |
| 56 | *** Test Cases *** |
| 57 | Create Package For OpenLDAP CNF |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 58 | [Documentation] Upload NF package for the testsuite. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 59 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 60 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 61 | |
| 62 | Create Package For OpenLDAP NS |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 63 | [Documentation] Upload NS package for the testsuite. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 64 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 66 | |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 67 | Create Network Service Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | [Documentation] Instantiate NS for the testsuite. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 69 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 70 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 71 | Log ${id} |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 72 | |
| 73 | Get Ns Id |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 74 | [Documentation] Retrieve NS 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 | ${id}= Get Ns Id ${NS_NAME} |
| 77 | Set Suite Variable ${NS_ID} ${id} |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 78 | |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 79 | Get Vnf Id |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | [Documentation] Retrieve NF instance id to be used later on. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 81 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 83 | @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID} |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 84 | Log List ${vnfr_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | Set Suite Variable ${VNF_ID} ${vnfr_list}[0] |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 86 | |
| Pedro Pereira | 46b097a | 2024-06-22 12:23:51 +0100 | [diff] [blame] | 87 | Check Labels Injected Into Kubernetes Objects |
| 88 | [Documentation] Check that labels were correctly injected into the deployed Kubernetes objects. |
| 89 | [Tags] verify |
| 90 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 91 | ${stdout}= Check Kdu Labels ${NS_ID} ${VNF_ID} ${KDU_NAME} |
| 92 | Log ${stdout} |
| 93 | |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 94 | Execute Upgrade Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | [Documentation] Perform OSM action to upgrade the number of replicas of a deployment in the CNF. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 96 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 97 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 98 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${UPGRADE_ACTION} ${VNF_MEMBER_INDEX} ${KDU_NAME} replicaCount=${REPLICA_COUNT} |
| 99 | Log ${ns_op_id} |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 100 | |
| 101 | Check Replicas After Upgrade Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 102 | [Documentation] Check that the number of replicas after the upgrade is the expected one. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 103 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 104 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 105 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 106 | Log ${count} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 107 | Should Be Equal As Integers ${count} ${REPLICA_COUNT} |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 108 | |
| 109 | Execute Rollback Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 110 | [Documentation] Perform OSM action to rollback the previous upgrade of the CNF. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 111 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 112 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 113 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ROLLBACK_ACTION} ${VNF_MEMBER_INDEX} ${KDU_NAME} |
| 114 | Log ${ns_op_id} |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 115 | |
| 116 | Check Replicas After Rollback Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 117 | [Documentation] Check that the number of replcias after the rollback is the expected one. |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 118 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 119 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 120 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 121 | Log ${count} |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 122 | Should Be Empty ${count} |
| 123 | |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 124 | Delete Network Service Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 125 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 126 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 127 | Delete NS ${NS_NAME} |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 128 | |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 129 | Delete NS Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 130 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 131 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 132 | Delete NSD ${NSD_NAME} |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 133 | |
| 134 | Delete VNF Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 135 | [Documentation] Delete NF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 136 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 137 | Delete VNFD ${VNFD_NAME} |
| ramonsalguer | 13b1074 | 2020-07-19 19:27:59 +0000 | [diff] [blame] | 138 | |
| 139 | |
| 140 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 141 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 142 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 143 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 144 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 145 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |