| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [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 | |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 15 | *** Settings *** |
| 16 | Documentation [K8s-12] Openldap Helm chart. |
| 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/ns_operation_lib.resource |
| 27 | Resource ../lib/connectivity_lib.resource |
| 28 | Resource ../lib/ssh_lib.resource |
| 29 | Resource ../lib/k8scluster_lib.resource |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 30 | |
| garciadeblas | 4487e9a | 2023-12-17 01:37:47 +0100 | [diff] [blame] | 31 | Test Tags k8s_12 cluster_k8s regression azure |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 32 | |
| 33 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 34 | |
| 35 | |
| 36 | *** Variables *** |
| 37 | # K8s cluster name and version |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 38 | ${K8SCLUSTER_NAME} k8s12 |
| 39 | ${K8SCLUSTER_VERSION} v1 |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 40 | |
| 41 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 42 | ${VNFD_PKG} openldap_primitives_knf |
| 43 | ${VNFD_NAME} openldap_knf |
| 44 | ${NSD_PKG} openldap_primitives_ns |
| 45 | ${NSD_NAME} openldap_ns |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 46 | |
| 47 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 48 | ${NS_NAME} ldap |
| 49 | ${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}} ] } ] } |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 50 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 51 | ${NS_ID} ${EMPTY} |
| 52 | ${PUBLICKEY} ${EMPTY} |
| 53 | ${VNF_MEMBER_INDEX} openldap |
| 54 | ${KDU_NAME} ldap |
| 55 | ${UPGRADE_ACTION} upgrade |
| 56 | ${ROLLBACK_ACTION} rollback |
| 57 | ${REPLICA_COUNT} 3 |
| 58 | ${ACTION_NAME} get-user-info |
| 59 | ${ACTION_PARAM_CN} admin |
| 60 | ${ACTION_PARAM_DC} example.org |
| 61 | |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 62 | |
| 63 | *** Test Cases *** |
| 64 | Create Package For OpenLDAP CNF |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | [Documentation] Upload VNF package for the testsuite. |
| 66 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 67 | |
| 68 | Create Package For OpenLDAP NS |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 69 | [Documentation] Upload NS package for the testsuite. |
| 70 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 71 | |
| 72 | Add K8s Cluster To OSM |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 73 | [Documentation] Register K8s cluster in OSM. |
| 74 | Create K8s Cluster %{K8S_CREDENTIALS} ${K8SCLUSTER_VERSION} %{VIM_TARGET} %{VIM_MGMT_NET} ${K8SCLUSTER_NAME} |
| garciadeblas | 93e5cc2 | 2023-12-17 01:40:23 +0100 | [diff] [blame] | 75 | Check For K8s Cluster To Be Enabled ${K8SCLUSTER_NAME} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 76 | |
| 77 | Create Network Service Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 78 | [Documentation] Instantiate NS for the testsuite. |
| 79 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 80 | Log ${id} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 81 | |
| 82 | Get Ns Id |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 83 | [Documentation] Get NS instance id from OSM. |
| 84 | ${id}= Get Ns Id ${NS_NAME} |
| 85 | Set Suite Variable ${NS_ID} ${id} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 86 | |
| 87 | Get Vnf Id |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 88 | [Documentation] Get VNF instance id from OSM. |
| 89 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 90 | @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 91 | Log List ${vnfr_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 92 | Set Suite Variable ${VNF_ID} ${vnfr_list}[0] |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 93 | |
| 94 | Execute Day 2 Operations |
| 95 | [Documentation] Performs one Day 2 operation. |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 96 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 97 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ACTION_NAME} ${VNF_MEMBER_INDEX} ${KDU_NAME} cn=${ACTION_PARAM_CN} dc=${ACTION_PARAM_DC} |
| 98 | Log ${ns_op_id} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 99 | |
| 100 | Execute Upgrade Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 101 | [Documentation] Perform OSM action to upgrade the number of replicas of a deployment in the CNF. |
| 102 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 103 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${UPGRADE_ACTION} ${VNF_MEMBER_INDEX} ${KDU_NAME} replicaCount=${REPLICA_COUNT} |
| 104 | Log ${ns_op_id} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 105 | |
| 106 | Check Replicas After Upgrade Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 107 | [Documentation] Check that the number of replicas after the upgrade is the expected one. |
| 108 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 109 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 110 | Log ${count} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 111 | Should Be Equal As Integers ${count} ${REPLICA_COUNT} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 112 | |
| 113 | Execute Rollback Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 114 | [Documentation] Perform OSM action to rollback the previous upgrade of the CNF. |
| 115 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 116 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ROLLBACK_ACTION} ${VNF_MEMBER_INDEX} ${KDU_NAME} |
| 117 | Log ${ns_op_id} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 118 | |
| 119 | Check Replicas After Rollback Operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 120 | [Documentation] Check that the number of replcias after the rollback is the expected one. |
| 121 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 122 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME} |
| garciadeblas | 321726f | 2022-12-21 11:43:06 +0100 | [diff] [blame] | 123 | Log ${count} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 124 | Should Be Empty ${count} |
| 125 | |
| 126 | Delete Network Service Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 127 | [Documentation] Delete NS instance. |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 128 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 129 | Delete NS ${NS_NAME} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 130 | |
| 131 | Remove K8s Cluster from OSM |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 132 | [Documentation] Delete K8s cluster from OSM. |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 133 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 134 | Delete K8s Cluster ${K8SCLUSTER_NAME} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 135 | |
| 136 | Delete NS Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 137 | [Documentation] Delete NS package from OSM. |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 138 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 139 | Delete NSD ${NSD_NAME} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 140 | |
| 141 | Delete VNF Descriptor Test |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 142 | [Documentation] Delete NF package from OSM. |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 143 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 144 | Delete VNFD ${VNFD_NAME} |
| Mark Beierl | 5871033 | 2022-08-03 14:14:14 -0400 | [diff] [blame] | 145 | |
| 146 | |
| 147 | *** Keywords *** |
| 148 | Suite Cleanup |
| 149 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 150 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 151 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 152 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |
| 153 | Run Keyword If Any Tests Failed Delete K8s Cluster ${K8SCLUSTER_NAME} |