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-12] 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_12 cluster_k8s regression azure
33 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
37 # K8s cluster name and version
38 ${K8SCLUSTER_NAME} k8s12
39 ${K8SCLUSTER_VERSION} v1
41 # NS and VNF descriptor package folder and ids
42 ${VNFD_PKG} openldap_primitives_knf
43 ${VNFD_NAME} openldap_knf
44 ${NSD_PKG} openldap_primitives_ns
45 ${NSD_NAME} openldap_ns
47 # NS instance name and configuration
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}} ] } ] }
53 ${VNF_MEMBER_INDEX} openldap
55 ${UPGRADE_ACTION} upgrade
56 ${ROLLBACK_ACTION} rollback
58 ${ACTION_NAME} get-user-info
59 ${ACTION_PARAM_CN} admin
60 ${ACTION_PARAM_DC} example.org
64 Create Package For OpenLDAP CNF
65 [Documentation] Upload VNF package for the testsuite.
66 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
68 Create Package For OpenLDAP NS
69 [Documentation] Upload NS package for the testsuite.
70 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
72 Add K8s Cluster To OSM
73 [Documentation] Register K8s cluster in OSM.
74 Create K8s Cluster %{K8S_CREDENTIALS} ${K8SCLUSTER_VERSION} %{VIM_TARGET} %{VIM_MGMT_NET} ${K8SCLUSTER_NAME}
75 Check For K8s Cluster To Be Enabled ${K8SCLUSTER_NAME}
77 Create Network Service Instance
78 [Documentation] Instantiate NS for the testsuite.
79 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
83 [Documentation] Get NS instance id from OSM.
84 ${id}= Get Ns Id ${NS_NAME}
85 Set Suite Variable ${NS_ID} ${id}
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}
92 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
94 Execute Day 2 Operations
95 [Documentation] Performs one Day 2 operation.
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}
100 Execute Upgrade Operation
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}
106 Check Replicas After Upgrade Operation
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}
111 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
113 Execute Rollback Operation
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}
119 Check Replicas After Rollback Operation
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}
124 Should Be Empty ${count}
126 Delete Network Service Instance
127 [Documentation] Delete NS instance.
131 Remove K8s Cluster from OSM
132 [Documentation] Delete K8s cluster from OSM.
134 Delete K8s Cluster ${K8SCLUSTER_NAME}
136 Delete NS Descriptor Test
137 [Documentation] Delete NS package from OSM.
139 Delete NSD ${NSD_NAME}
141 Delete VNF Descriptor Test
142 [Documentation] Delete NF package from OSM.
144 Delete VNFD ${VNFD_NAME}
149 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
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}