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
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 Documentation [K8s-13] Two Helm-based KDU stored in public and private OCI repositories.
18 Library OperatingSystem
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
32 Test Tags k8s_13 cluster_k8s daily azure
34 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
38 # NS and VNF descriptor package folder and ids
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
44 # NS instance name and configuration
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}} ] } ] }
50 ${VNF_MEMBER_INDEX} two_helm_oci
53 ${UPGRADE_ACTION} upgrade
54 ${ROLLBACK_ACTION} rollback
57 # OCI helm repo configuration
58 ${REPO_NAME} osm-gitlab
59 ${REPO_URI} %{OCI_REGISTRY_URL}
60 ${REPO_USER} %{OCI_REGISTRY_USER}
61 ${REPO_PASSWORD} %{OCI_REGISTRY_PASSWORD}
65 Create Package For CNF
66 [Documentation] Create Package For CNF
68 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
71 [Documentation] Create Package For NS
73 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
76 [Documentation] Create Helm OCI Repo for openldap kdu
78 Create Repo ${REPO_NAME} ${REPO_URI} helm-chart ${REPO_USER} ${REPO_PASSWORD} --oci
80 Create Network Service Instance
81 [Documentation] Create Network Service Instance
83 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
87 [Documentation] Get ID of NS instance
89 ${id}= Get Ns Id ${NS_NAME}
90 Set Suite Variable ${NS_ID} ${id}
93 [Documentation] Get ID of VNF
95 Variable Should Exist ${NS_ID} msg=Network service instance is not available
96 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
98 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
100 Execute Upgrade Operation over first KDU
101 [Documentation] Execute Upgrade Operation over first KDU
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}
107 Check Replicas After Upgrade Operation over first KDU
108 [Documentation] Check Replicas After Upgrade Operation over first KDU
110 Variable Should Exist ${NS_ID} msg=Network service instance is not available
111 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU1_NAME}
113 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
115 Execute Rollback Operation over first KDU
116 [Documentation] Execute Rollback Operation over first KDU
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}
122 Check Replicas After Rollback Operation over first KDU
123 [Documentation] Check Replicas After Rollback Operation over first KDU
125 Variable Should Exist ${NS_ID} msg=Network service instance is not available
126 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU1_NAME}
128 Should Be Empty ${count}
130 Execute Upgrade Operation over second KDU
131 [Documentation] Execute Upgrade Operation over second KDU
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}
137 Check Replicas After Upgrade Operation over second KDU
138 [Documentation] Check Replicas After Upgrade Operation over second KDU
140 Variable Should Exist ${NS_ID} msg=Network service instance is not available
141 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU2_NAME}
143 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
145 Execute Rollback Operation over second KDU
146 [Documentation] Execute Rollback Operation over second KDU
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}
152 Check Replicas After Rollback Operation over second KDU
153 [Documentation] Check Replicas After Rollback Operation over second KDU
155 Variable Should Exist ${NS_ID} msg=Network service instance is not available
156 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU2_NAME}
158 Should Be Empty ${count}
160 Delete Network Service Instance
161 [Documentation] Delete Network Service Instance
166 [Documentation] Delete Helm OCI Repo
168 Delete Repo ${REPO_NAME}
170 Delete NS Descriptor Test
171 [Documentation] Delete NS Descriptor Test
173 Delete NSD ${NSD_NAME}
175 Delete VNF Descriptor Test
176 [Documentation] Delete VNF Descriptor Test
178 Delete VNFD ${VNFD_NAME}
183 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
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}