| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [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 | |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 15 | *** Settings *** |
| 16 | Documentation [K8s-13] Two Helm-based KDU stored in public and private OCI repositories. |
| 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 |
| 30 | Resource ../lib/repo_lib.resource |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 31 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 32 | Test Tags k8s_13 cluster_k8s daily azure |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 33 | |
| 34 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 35 | |
| 36 | |
| 37 | *** Variables *** |
| 38 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 39 | ${VNFD_PKG} two_helm_oci_knf |
| 40 | ${VNFD_NAME} two_helm_oci_knf |
| 41 | ${NSD_PKG} two_helm_oci_ns |
| 42 | ${NSD_NAME} two_helm_oci_ns |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 43 | |
| 44 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 45 | ${NS_NAME} ldap |
| 46 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}}], additionalParamsForVnf: [ {member-vnf-index: two_helm_oci, additionalParamsForKdu: [ {kdu_name: haproxy, additionalParams: {service: {type: LoadBalancer }, adminPassword: admin}}, {kdu_name: ldap, additionalParams: {service: {type: LoadBalancer }, adminPassword: admin}} ] } ] } |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 47 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 48 | ${NS_ID} ${EMPTY} |
| 49 | ${PUBLICKEY} ${EMPTY} |
| 50 | ${VNF_MEMBER_INDEX} two_helm_oci |
| 51 | ${KDU1_NAME} haproxy |
| 52 | ${KDU2_NAME} ldap |
| 53 | ${UPGRADE_ACTION} upgrade |
| 54 | ${ROLLBACK_ACTION} rollback |
| 55 | ${REPLICA_COUNT} 3 |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 56 | |
| 57 | # OCI helm repo configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 58 | ${REPO_NAME} osm-gitlab |
| 59 | ${REPO_URI} %{OCI_REGISTRY_URL} |
| 60 | ${REPO_USER} %{OCI_REGISTRY_USER} |
| 61 | ${REPO_PASSWORD} %{OCI_REGISTRY_PASSWORD} |
| 62 | |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 63 | |
| 64 | *** Test Cases *** |
| 65 | Create Package For CNF |
| 66 | [Documentation] Create Package For CNF |
| 67 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 69 | |
| 70 | Create Package For NS |
| 71 | [Documentation] Create Package For NS |
| 72 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 73 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 74 | |
| 75 | Create Helm OCI Repo |
| 76 | [Documentation] Create Helm OCI Repo for openldap kdu |
| 77 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 78 | Create Repo ${REPO_NAME} ${REPO_URI} helm-chart ${REPO_USER} ${REPO_PASSWORD} --oci |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 79 | |
| 80 | Create Network Service Instance |
| 81 | [Documentation] Create Network Service Instance |
| 82 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 83 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} |
| 84 | Log ${id} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 85 | |
| 86 | Get Ns Id |
| 87 | [Documentation] Get ID of NS instance |
| 88 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 89 | ${id}= Get Ns Id ${NS_NAME} |
| 90 | Set Suite Variable ${NS_ID} ${id} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 91 | |
| 92 | Get Vnf Id |
| 93 | [Documentation] Get ID of VNF |
| 94 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 96 | @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 97 | Log List ${vnfr_list} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 98 | Set Suite Variable ${VNF_ID} ${vnfr_list}[0] |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 99 | |
| 100 | Execute Upgrade Operation over first KDU |
| 101 | [Documentation] Execute Upgrade Operation over first KDU |
| 102 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 103 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 104 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${UPGRADE_ACTION} ${VNF_MEMBER_INDEX} ${KDU1_NAME} replicaCount=${REPLICA_COUNT} |
| 105 | Log ${ns_op_id} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 106 | |
| 107 | Check Replicas After Upgrade Operation over first KDU |
| 108 | [Documentation] Check Replicas After Upgrade Operation over first KDU |
| 109 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 110 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 111 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU1_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 112 | Log ${count} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 113 | Should Be Equal As Integers ${count} ${REPLICA_COUNT} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 114 | |
| 115 | Execute Rollback Operation over first KDU |
| 116 | [Documentation] Execute Rollback Operation over first KDU |
| 117 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 118 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 119 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ROLLBACK_ACTION} ${VNF_MEMBER_INDEX} ${KDU1_NAME} |
| 120 | Log ${ns_op_id} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 121 | |
| 122 | Check Replicas After Rollback Operation over first KDU |
| 123 | [Documentation] Check Replicas After Rollback Operation over first KDU |
| 124 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 125 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 126 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU1_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 127 | Log ${count} |
| 128 | Should Be Empty ${count} |
| 129 | |
| 130 | Execute Upgrade Operation over second KDU |
| 131 | [Documentation] Execute Upgrade Operation over second KDU |
| 132 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 133 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 134 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${UPGRADE_ACTION} ${VNF_MEMBER_INDEX} ${KDU2_NAME} replicaCount=${REPLICA_COUNT} |
| 135 | Log ${ns_op_id} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 136 | |
| 137 | Check Replicas After Upgrade Operation over second KDU |
| 138 | [Documentation] Check Replicas After Upgrade Operation over second KDU |
| 139 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 140 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 141 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU2_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 142 | Log ${count} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 143 | Should Be Equal As Integers ${count} ${REPLICA_COUNT} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 144 | |
| 145 | Execute Rollback Operation over second KDU |
| 146 | [Documentation] Execute Rollback Operation over second KDU |
| 147 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 148 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 149 | ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ROLLBACK_ACTION} ${VNF_MEMBER_INDEX} ${KDU2_NAME} |
| 150 | Log ${ns_op_id} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 151 | |
| 152 | Check Replicas After Rollback Operation over second KDU |
| 153 | [Documentation] Check Replicas After Rollback Operation over second KDU |
| 154 | [Tags] verify |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 155 | Variable Should Exist ${NS_ID} msg=Network service instance is not available |
| 156 | ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU2_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 157 | Log ${count} |
| 158 | Should Be Empty ${count} |
| 159 | |
| 160 | Delete Network Service Instance |
| 161 | [Documentation] Delete Network Service Instance |
| 162 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 163 | Delete NS ${NS_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 164 | |
| 165 | Delete Helm OCI Repo |
| 166 | [Documentation] Delete Helm OCI Repo |
| 167 | [Tags] prepare |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 168 | Delete Repo ${REPO_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 169 | |
| 170 | Delete NS Descriptor Test |
| 171 | [Documentation] Delete NS Descriptor Test |
| 172 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 173 | Delete NSD ${NSD_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 174 | |
| 175 | Delete VNF Descriptor Test |
| 176 | [Documentation] Delete VNF Descriptor Test |
| 177 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 178 | Delete VNFD ${VNFD_NAME} |
| garciadeblas | b0db457 | 2023-11-23 16:02:56 +0100 | [diff] [blame] | 179 | |
| 180 | |
| 181 | *** Keywords *** |
| 182 | Suite Cleanup |
| 183 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 184 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 185 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 186 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME} |