blob: 763488b4db0e897923bc1a8f7a94a96fe6c9fcf3 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
garciadeblasb0db4572023-11-23 16:02:56 +01002# 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
garciadeblasb0db4572023-11-23 16:02:56 +010015*** Settings ***
16Documentation [K8s-13] Two Helm-based KDU stored in public and private OCI repositories.
17
18Library OperatingSystem
19Library String
20Library Collections
21Library Process
22
garciadeblas7a9e0312023-12-11 22:24:46 +010023Resource ../lib/vnfd_lib.resource
24Resource ../lib/nsd_lib.resource
25Resource ../lib/ns_lib.resource
26Resource ../lib/ns_operation_lib.resource
27Resource ../lib/connectivity_lib.resource
28Resource ../lib/ssh_lib.resource
29Resource ../lib/k8scluster_lib.resource
30Resource ../lib/repo_lib.resource
garciadeblasb0db4572023-11-23 16:02:56 +010031
garciadeblas7a9e0312023-12-11 22:24:46 +010032Test Tags k8s_13 cluster_k8s daily azure
garciadeblasb0db4572023-11-23 16:02:56 +010033
34Suite Teardown Run Keyword And Ignore Error Suite Cleanup
35
36
37*** Variables ***
38# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010039${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
garciadeblasb0db4572023-11-23 16:02:56 +010043
44# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010045${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}} ] } ] }
garciadeblasb0db4572023-11-23 16:02:56 +010047
garciadeblas7a9e0312023-12-11 22:24:46 +010048${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
garciadeblasb0db4572023-11-23 16:02:56 +010056
57# OCI helm repo configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010058${REPO_NAME} osm-gitlab
59${REPO_URI} %{OCI_REGISTRY_URL}
60${REPO_USER} %{OCI_REGISTRY_USER}
61${REPO_PASSWORD} %{OCI_REGISTRY_PASSWORD}
62
garciadeblasb0db4572023-11-23 16:02:56 +010063
64*** Test Cases ***
65Create Package For CNF
66 [Documentation] Create Package For CNF
67 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010068 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
garciadeblasb0db4572023-11-23 16:02:56 +010069
70Create Package For NS
71 [Documentation] Create Package For NS
72 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010073 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
garciadeblasb0db4572023-11-23 16:02:56 +010074
75Create Helm OCI Repo
76 [Documentation] Create Helm OCI Repo for openldap kdu
77 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010078 Create Repo ${REPO_NAME} ${REPO_URI} helm-chart ${REPO_USER} ${REPO_PASSWORD} --oci
garciadeblasb0db4572023-11-23 16:02:56 +010079
80Create Network Service Instance
81 [Documentation] Create Network Service Instance
82 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010083 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
84 Log ${id}
garciadeblasb0db4572023-11-23 16:02:56 +010085
86Get Ns Id
87 [Documentation] Get ID of NS instance
88 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010089 ${id}= Get Ns Id ${NS_NAME}
90 Set Suite Variable ${NS_ID} ${id}
garciadeblasb0db4572023-11-23 16:02:56 +010091
92Get Vnf Id
93 [Documentation] Get ID of VNF
94 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010095 Variable Should Exist ${NS_ID} msg=Network service instance is not available
96 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
garciadeblasb0db4572023-11-23 16:02:56 +010097 Log List ${vnfr_list}
garciadeblas7a9e0312023-12-11 22:24:46 +010098 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
garciadeblasb0db4572023-11-23 16:02:56 +010099
100Execute Upgrade Operation over first KDU
101 [Documentation] Execute Upgrade Operation over first KDU
102 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100103 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}
garciadeblasb0db4572023-11-23 16:02:56 +0100106
107Check Replicas After Upgrade Operation over first KDU
108 [Documentation] Check Replicas After Upgrade Operation over first KDU
109 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100110 Variable Should Exist ${NS_ID} msg=Network service instance is not available
111 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU1_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100112 Log ${count}
garciadeblas7a9e0312023-12-11 22:24:46 +0100113 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
garciadeblasb0db4572023-11-23 16:02:56 +0100114
115Execute Rollback Operation over first KDU
116 [Documentation] Execute Rollback Operation over first KDU
117 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100118 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}
garciadeblasb0db4572023-11-23 16:02:56 +0100121
122Check Replicas After Rollback Operation over first KDU
123 [Documentation] Check Replicas After Rollback Operation over first KDU
124 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100125 Variable Should Exist ${NS_ID} msg=Network service instance is not available
126 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU1_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100127 Log ${count}
128 Should Be Empty ${count}
129
130Execute Upgrade Operation over second KDU
131 [Documentation] Execute Upgrade Operation over second KDU
132 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100133 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}
garciadeblasb0db4572023-11-23 16:02:56 +0100136
137Check Replicas After Upgrade Operation over second KDU
138 [Documentation] Check Replicas After Upgrade Operation over second KDU
139 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100140 Variable Should Exist ${NS_ID} msg=Network service instance is not available
141 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU2_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100142 Log ${count}
garciadeblas7a9e0312023-12-11 22:24:46 +0100143 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
garciadeblasb0db4572023-11-23 16:02:56 +0100144
145Execute Rollback Operation over second KDU
146 [Documentation] Execute Rollback Operation over second KDU
147 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100148 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}
garciadeblasb0db4572023-11-23 16:02:56 +0100151
152Check Replicas After Rollback Operation over second KDU
153 [Documentation] Check Replicas After Rollback Operation over second KDU
154 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100155 Variable Should Exist ${NS_ID} msg=Network service instance is not available
156 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU2_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100157 Log ${count}
158 Should Be Empty ${count}
159
160Delete Network Service Instance
161 [Documentation] Delete Network Service Instance
162 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100163 Delete NS ${NS_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100164
165Delete Helm OCI Repo
166 [Documentation] Delete Helm OCI Repo
167 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +0100168 Delete Repo ${REPO_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100169
170Delete NS Descriptor Test
171 [Documentation] Delete NS Descriptor Test
172 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100173 Delete NSD ${NSD_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100174
175Delete VNF Descriptor Test
176 [Documentation] Delete VNF Descriptor Test
177 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100178 Delete VNFD ${VNFD_NAME}
garciadeblasb0db4572023-11-23 16:02:56 +0100179
180
181*** Keywords ***
182Suite Cleanup
183 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +0100184 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}