blob: 74cd4d5fbac75c1535f74f3b6fe8a8e130113168 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
ramonsalguer13b10742020-07-19 19:27:59 +00002# 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
ramonsalguer13b10742020-07-19 19:27:59 +000015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [K8s-04] Openldap Helm chart.
garciadeblas4cf45d72021-04-08 13:52:22 +020017
ramonsalguer13b10742020-07-19 19:27:59 +000018Library 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
ramonsalguer13b10742020-07-19 19:27:59 +000030
garciadeblas7a9e0312023-12-11 22:24:46 +010031Test Tags k8s_04 cluster_k8s daily regression sanity azure
garciadeblas4cf45d72021-04-08 13:52:22 +020032
garciadeblasd225e552020-10-02 16:10:14 +000033Suite Teardown Run Keyword And Ignore Error Suite Cleanup
ramonsalguer13b10742020-07-19 19:27:59 +000034
35
36*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020037# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010038${VNFD_PKG} openldap_knf
39${VNFD_NAME} openldap_knf
40${NSD_PKG} openldap_ns
41${NSD_NAME} openldap_ns
almagiab4697d32021-05-25 08:56:17 +020042
43# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010044${NS_NAME} ldap
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}} ] } ] }
almagiab4697d32021-05-25 08:56:17 +020046
garciadeblas7a9e0312023-12-11 22:24:46 +010047${NS_ID} ${EMPTY}
48${PUBLICKEY} ${EMPTY}
49${VNF_MEMBER_INDEX} openldap
50${KDU_NAME} ldap
51${UPGRADE_ACTION} upgrade
52${ROLLBACK_ACTION} rollback
53${REPLICA_COUNT} 3
54
ramonsalguer13b10742020-07-19 19:27:59 +000055
56*** Test Cases ***
57Create Package For OpenLDAP CNF
garciadeblas7a9e0312023-12-11 22:24:46 +010058 [Documentation] Upload NF package for the testsuite.
garciadeblasf4ebaa82022-06-23 13:33:26 +020059 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010060 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
ramonsalguer13b10742020-07-19 19:27:59 +000061
62Create Package For OpenLDAP NS
garciadeblas7a9e0312023-12-11 22:24:46 +010063 [Documentation] Upload NS package for the testsuite.
garciadeblasf4ebaa82022-06-23 13:33:26 +020064 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010065 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
ramonsalguer13b10742020-07-19 19:27:59 +000066
ramonsalguer13b10742020-07-19 19:27:59 +000067Create Network Service Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010068 [Documentation] Instantiate NS for the testsuite.
garciadeblasf4ebaa82022-06-23 13:33:26 +020069 [Tags] prepare
garciadeblas7a9e0312023-12-11 22:24:46 +010070 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
71 Log ${id}
rodriguezgarfbedfe02022-02-24 20:05:42 +010072
73Get Ns Id
garciadeblas7a9e0312023-12-11 22:24:46 +010074 [Documentation] Retrieve NS instance id to be used later on.
rodriguezgarfbedfe02022-02-24 20:05:42 +010075 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010076 ${id}= Get Ns Id ${NS_NAME}
77 Set Suite Variable ${NS_ID} ${id}
ramonsalguer13b10742020-07-19 19:27:59 +000078
aguilarherna045bd332021-03-25 10:25:59 +010079Get Vnf Id
garciadeblas7a9e0312023-12-11 22:24:46 +010080 [Documentation] Retrieve NF instance id to be used later on.
rodriguezgarfbedfe02022-02-24 20:05:42 +010081 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010082 Variable Should Exist ${NS_ID} msg=Network service instance is not available
83 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
garciadeblasf4ebaa82022-06-23 13:33:26 +020084 Log List ${vnfr_list}
garciadeblas7a9e0312023-12-11 22:24:46 +010085 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
aguilarherna045bd332021-03-25 10:25:59 +010086
87Execute Upgrade Operation
garciadeblas7a9e0312023-12-11 22:24:46 +010088 [Documentation] Perform OSM action to upgrade the number of replicas of a deployment in the CNF.
rodriguezgarfbedfe02022-02-24 20:05:42 +010089 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010090 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}
92 Log ${ns_op_id}
aguilarherna045bd332021-03-25 10:25:59 +010093
94Check Replicas After Upgrade Operation
garciadeblas7a9e0312023-12-11 22:24:46 +010095 [Documentation] Check that the number of replicas after the upgrade is the expected one.
rodriguezgarfbedfe02022-02-24 20:05:42 +010096 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +010097 Variable Should Exist ${NS_ID} msg=Network service instance is not available
98 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME}
garciadeblas321726f2022-12-21 11:43:06 +010099 Log ${count}
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 Should Be Equal As Integers ${count} ${REPLICA_COUNT}
aguilarherna045bd332021-03-25 10:25:59 +0100101
102Execute Rollback Operation
garciadeblas7a9e0312023-12-11 22:24:46 +0100103 [Documentation] Perform OSM action to rollback the previous upgrade of the CNF.
rodriguezgarfbedfe02022-02-24 20:05:42 +0100104 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 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}
107 Log ${ns_op_id}
aguilarherna045bd332021-03-25 10:25:59 +0100108
109Check Replicas After Rollback Operation
garciadeblas7a9e0312023-12-11 22:24:46 +0100110 [Documentation] Check that the number of replcias after the rollback is the expected one.
rodriguezgarfbedfe02022-02-24 20:05:42 +0100111 [Tags] verify
garciadeblas7a9e0312023-12-11 22:24:46 +0100112 Variable Should Exist ${NS_ID} msg=Network service instance is not available
113 ${count}= Get Vnf Kdu Replica Count ${VNF_ID} ${KDU_NAME}
garciadeblas321726f2022-12-21 11:43:06 +0100114 Log ${count}
aguilarherna045bd332021-03-25 10:25:59 +0100115 Should Be Empty ${count}
116
ramonsalguer13b10742020-07-19 19:27:59 +0000117Delete Network Service Instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100118 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +0200119 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100120 Delete NS ${NS_NAME}
ramonsalguer13b10742020-07-19 19:27:59 +0000121
ramonsalguer13b10742020-07-19 19:27:59 +0000122Delete NS Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +0100123 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200124 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100125 Delete NSD ${NSD_NAME}
ramonsalguer13b10742020-07-19 19:27:59 +0000126
127Delete VNF Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +0100128 [Documentation] Delete NF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200129 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100130 Delete VNFD ${VNFD_NAME}
ramonsalguer13b10742020-07-19 19:27:59 +0000131
132
133*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000134Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200135 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +0100136 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}