1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
14 Documentation [K8s-13] Two Helm-based KDU stored in public and private OCI repositories.
16 Library OperatingSystem
21 Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
22 Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
23 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
24 Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot
25 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
26 Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot
27 Resource %{ROBOT_DEVOPS_FOLDER}/lib/repo_lib.robot
29 Force Tags k8s_13 cluster_k8s daily azure
31 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
35 # NS and VNF descriptor package folder and ids
36 ${vnfd_pkg} two_helm_oci_knf
37 ${vnfd_name} two_helm_oci_knf
38 ${nsd_pkg} two_helm_oci_ns
39 ${nsd_name} two_helm_oci_ns
41 # NS instance name and configuration
43 ${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}} ] } ] }
47 ${vnf_member_index} two_helm_oci
50 ${upgrade_action} upgrade
51 ${rollback_action} rollback
54 # OCI helm repo configuration
55 ${repo_name} osm-gitlab
56 ${repo_uri} %{OCI_REGISTRY_URL}
57 ${repo_user} %{OCI_REGISTRY_USER}
58 ${repo_password} %{OCI_REGISTRY_PASSWORD}
61 Create Package For CNF
62 [Documentation] Create Package For CNF
64 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
67 [Documentation] Create Package For NS
69 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
72 [Documentation] Create Helm OCI Repo for openldap kdu
74 Create Repo ${repo_name} ${repo_uri} helm-chart ${repo_user} ${repo_password} --oci
76 Create Network Service Instance
77 [Documentation] Create Network Service Instance
79 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
82 [Documentation] Get ID of NS instance
84 ${id}= Get Ns Id ${ns_name}
85 Set Suite Variable ${ns_id} ${id}
88 [Documentation] Get ID of VNF
90 Variable Should Exist ${ns_id} msg=Network service instance is not available
91 @{vnfr_list}= Get Ns Vnfr Ids ${ns_id}
93 Set Suite Variable ${vnf_id} ${vnfr_list}[0]
95 Execute Upgrade Operation over first KDU
96 [Documentation] Execute Upgrade Operation over first KDU
98 Variable Should Exist ${ns_id} msg=Network service instance is not available
99 ${ns_op_id}= Execute NS K8s Action ${ns_name} ${upgrade_action} ${vnf_member_index} ${kdu1_name} replicaCount=${replica_count}
101 Check Replicas After Upgrade Operation over first KDU
102 [Documentation] Check Replicas After Upgrade Operation over first KDU
104 Variable Should Exist ${ns_id} msg=Network service instance is not available
105 ${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu1_name}
107 Should Be Equal As Integers ${count} ${replica_count}
109 Execute Rollback Operation over first KDU
110 [Documentation] Execute Rollback Operation over first KDU
112 Variable Should Exist ${ns_id} msg=Network service instance is not available
113 ${ns_op_id}= Execute NS K8s Action ${ns_name} ${rollback_action} ${vnf_member_index} ${kdu1_name}
115 Check Replicas After Rollback Operation over first KDU
116 [Documentation] Check Replicas After Rollback Operation over first KDU
118 Variable Should Exist ${ns_id} msg=Network service instance is not available
119 ${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu1_name}
121 Should Be Empty ${count}
123 Execute Upgrade Operation over second KDU
124 [Documentation] Execute Upgrade Operation over second KDU
126 Variable Should Exist ${ns_id} msg=Network service instance is not available
127 ${ns_op_id}= Execute NS K8s Action ${ns_name} ${upgrade_action} ${vnf_member_index} ${kdu2_name} replicaCount=${replica_count}
129 Check Replicas After Upgrade Operation over second KDU
130 [Documentation] Check Replicas After Upgrade Operation over second KDU
132 Variable Should Exist ${ns_id} msg=Network service instance is not available
133 ${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu2_name}
135 Should Be Equal As Integers ${count} ${replica_count}
137 Execute Rollback Operation over second KDU
138 [Documentation] Execute Rollback Operation over second KDU
140 Variable Should Exist ${ns_id} msg=Network service instance is not available
141 ${ns_op_id}= Execute NS K8s Action ${ns_name} ${rollback_action} ${vnf_member_index} ${kdu2_name}
143 Check Replicas After Rollback Operation over second KDU
144 [Documentation] Check Replicas After Rollback Operation over second KDU
146 Variable Should Exist ${ns_id} msg=Network service instance is not available
147 ${count}= Get Vnf Kdu Replica Count ${vnf_id} ${kdu2_name}
149 Should Be Empty ${count}
151 Delete Network Service Instance
152 [Documentation] Delete Network Service Instance
157 [Documentation] Delete Helm OCI Repo
159 Delete Repo ${repo_name}
161 Delete NS Descriptor Test
162 [Documentation] Delete NS Descriptor Test
164 Delete NSD ${nsd_name}
166 Delete VNF Descriptor Test
167 [Documentation] Delete VNF Descriptor Test
169 Delete VNFD ${vnfd_name}
174 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
175 Run Keyword If Any Tests Failed Delete NS ${ns_name}
176 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
177 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}