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 [BASIC-16] Advanced onboarding with override and complex scaling (3 initial instances, scaled by two).
18 Library OperatingSystem
22 Resource ../lib/vnfd_lib.resource
23 Resource ../lib/nsd_lib.resource
24 Resource ../lib/ns_lib.resource
25 Resource ../lib/ns_operation_lib.resource
26 Resource ../lib/ssh_lib.resource
28 Test Tags basic_16 cluster_main daily regression azure
30 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
34 # NS and VNF descriptor package folder and ids
35 ${VNFD_PKG} hackfest_basic_metrics_vnf
36 ${VNFD_NAME} hackfest_basic_metrics-vnf
37 ${NSD_PKG} hackfest_basic_metrics_ns
38 ${NSD_NAME} hackfest_basic-ns-metrics
40 # NS instance name and configuration
42 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
44 # SSH public keys file
45 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47 # Initial, delta, min and max number of VDU instances
52 ${SCALING_GROUP} vdu_autoscale
53 ${VNF_MEMBER_INDEX} vnf
57 Create Scaling VNF Descriptor
58 [Documentation] Upload VNF package for the testsuite.
59 Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${VNFD_PKG}' df.0.instantiation-level.0.vdu-level.0.number-of-instances=${INIT_INSTANCES};df.0.vdu-profile.0.min-number-of-instances=${MIN_INSTANCES};df.0.vdu-profile.0.max-number-of-instances=${MAX_INSTANCES};df.0.scaling-aspect.0.aspect-delta-details.deltas.0.vdu-delta.0.number-of-instances=${DELTA_INSTANCES}
61 Create Scaling NS Descriptor
62 [Documentation] Upload NS package for the testsuite.
63 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
65 Instantiate Scaling Network Service
66 [Documentation] Instantiate NS for the testsuite.
67 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
68 Set Suite Variable ${NS_ID} ${id}
71 [Documentation] Retrieve VNF instance id to be used later on.
72 Variable Should Exist ${NS_ID} msg=Network service instance is not available
73 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
75 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
77 Check Vdus Before Scale Out
78 [Documentation] Check the number of VDUs instances before the manual scaling.
79 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
81 ${vdurs}= Get Length ${vdur_list}
82 Set Suite Variable ${INITIAL_VDUR_COUNT} ${vdurs}
83 IF ${INIT_INSTANCES} != ${INITIAL_VDUR_COUNT} Fail msg=Instantiated VDUs (${INITIAL_VDUR_COUNT}) don't match specified number in descriptor (${INIT_INSTANCES})
85 Perform Manual Vdu Scale Out
86 [Documentation] Perform a manual scale-out operation of the VNF.
87 Variable Should Exist ${NS_ID} msg=Network service instance is not available
88 ${ns_op_id}= Execute Manual VNF Scale ${NS_NAME} ${VNF_MEMBER_INDEX} ${SCALING_GROUP} SCALE_OUT
91 Check Vdus After Scale Out
92 [Documentation] Check whether there is one extra VDU after scaling out.
93 Variable Should Exist ${NS_ID} msg=Network service instance is not available
94 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
96 ${vdurs}= Get Length ${vdur_list}
97 IF ${vdurs} != ${INITIAL_VDUR_COUNT} + ${DELTA_INSTANCES} Fail msg=VDU instances in the VNF (${vdurs}) don't match after Scale Out (${INITIAL_VDUR_COUNT} + ${DELTA_INSTANCES})
99 Perform Manual Vdu Scale In
100 [Documentation] Perform a manual scale-in operation of the VNF.
101 Variable Should Exist ${NS_ID} msg=Network service instance is not available
102 ${ns_op_id}= Execute Manual VNF Scale ${NS_NAME} ${VNF_MEMBER_INDEX} ${SCALING_GROUP} SCALE_IN
105 Check Vdus After Scaling In
106 [Documentation] Check whether there is one less VDU after scaling in.
107 Variable Should Exist ${NS_ID} msg=Network service instance is not available
108 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
109 Log List ${vdur_list}
110 ${vdurs}= Get Length ${vdur_list}
111 IF ${vdurs} != ${INITIAL_VDUR_COUNT} Fail msg=There is the same number of VDU records in the VNF after Scale In
114 [Documentation] Delete NS intance.
119 [Documentation] Delete NS package from OSM.
121 Delete NSD ${NSD_NAME}
123 Delete VNF Descriptor
124 [Documentation] Delete VNF package from OSM.
126 Delete VNFD ${VNFD_NAME}
131 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
132 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
133 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
134 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}