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-04] Openldap Helm chart.
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
31 Test Tags k8s_04 cluster_k8s daily regression sanity azure
33 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
37 # NS and VNF descriptor package folder and ids
38 ${VNFD_PKG} openldap_knf
39 ${VNFD_NAME} openldap_knf
40 ${NSD_PKG} openldap_ns
41 ${NSD_NAME} openldap_ns
43 # NS instance name and configuration
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}} ] } ] }
49 ${VNF_MEMBER_INDEX} openldap
51 ${UPGRADE_ACTION} upgrade
52 ${ROLLBACK_ACTION} rollback
57 Create Package For OpenLDAP CNF
58 [Documentation] Upload NF package for the testsuite.
60 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
62 Create Package For OpenLDAP NS
63 [Documentation] Upload NS package for the testsuite.
65 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
67 Create Network Service Instance
68 [Documentation] Instantiate NS for the testsuite.
70 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
74 [Documentation] Retrieve NS instance id to be used later on.
76 ${id}= Get Ns Id ${NS_NAME}
77 Set Suite Variable ${NS_ID} ${id}
80 [Documentation] Retrieve NF instance id to be used later on.
82 Variable Should Exist ${NS_ID} msg=Network service instance is not available
83 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
85 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
87 Execute Upgrade Operation
88 [Documentation] Perform OSM action to upgrade the number of replicas of a deployment in the CNF.
90 Variable Should Exist ${NS_ID} msg=Network service instance is not available
91 ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${UPGRADE_ACTION} ${VNF_MEMBER_INDEX} ${KDU_NAME} replicaCount=${REPLICA_COUNT}
94 Check Replicas After Upgrade Operation
95 [Documentation] Check that the number of replicas after the upgrade is the expected one.
97 Variable Should Exist ${NS_ID} msg=Network service instance is not available
98 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME}
100 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
102 Execute Rollback Operation
103 [Documentation] Perform OSM action to rollback the previous upgrade of the CNF.
105 Variable Should Exist ${NS_ID} msg=Network service instance is not available
106 ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ROLLBACK_ACTION} ${VNF_MEMBER_INDEX} ${KDU_NAME}
109 Check Replicas After Rollback Operation
110 [Documentation] Check that the number of replcias after the rollback is the expected one.
112 Variable Should Exist ${NS_ID} msg=Network service instance is not available
113 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME}
115 Should Be Empty ${count}
117 Delete Network Service Instance
118 [Documentation] Delete NS instance.
122 Delete NS Descriptor Test
123 [Documentation] Delete NS package from OSM.
125 Delete NSD ${NSD_NAME}
127 Delete VNF Descriptor Test
128 [Documentation] Delete NF package from OSM.
130 Delete VNFD ${VNFD_NAME}
135 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
136 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
137 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
138 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}