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-09] Manual VNF/VDU Scaling.
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_09 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
41 ${NS_NAME} basic_09_manual_scaling_test
42 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43 ${SCALING_GROUP} vdu_autoscale
44 ${VNF_MEMBER_INDEX} vnf
47 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
51 Create Scaling VNF Descriptor
52 [Documentation] Upload VNF package for the testsuite.
54 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
56 Create Scaling NS Descriptor
57 [Documentation] Upload NS package for the testsuite.
59 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
61 Instantiate Scaling Network Service
62 [Documentation] Instantiate NS for the testsuite.
64 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
68 [Documentation] Retrieve NS instance id to be used later on.
70 ${id}= Get Ns Id ${NS_NAME}
71 Set Suite Variable ${NS_ID} ${id}
74 [Documentation] Retrieve VNF instance id to be used later on.
76 Variable Should Exist ${NS_ID} msg=Network service instance is not available
77 @{vnfr_list}= Get Ns Vnfr Ids ${NS_ID}
79 Set Suite Variable ${VNF_ID} ${vnfr_list}[0]
81 Get Vdus Before Scale Out
82 [Documentation] Check the number of VDUs instances before the manual scaling.
84 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
86 ${vdurs}= Get Length ${vdur_list}
87 Set Suite Variable ${INITIAL_VDUR_COUNT} ${vdurs}
89 Perform Manual Vdu Scale Out
90 [Documentation] Perform a manual scale-out operation of the VNF.
92 Variable Should Exist ${NS_ID} msg=Network service instance is not available
93 ${ns_op_id}= Execute Manual VNF Scale ${NS_NAME} ${VNF_MEMBER_INDEX} ${SCALING_GROUP} SCALE_OUT
96 Check Vdus After Scale Out
97 [Documentation] Check whether there is one more VDU after scaling out.
99 Variable Should Exist ${NS_ID} msg=Network service instance is not available
100 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
101 Log List ${vdur_list}
102 ${vdurs}= Get Length ${vdur_list}
103 IF ${vdurs} != ${INITIAL_VDUR_COUNT} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out
105 Perform Manual Vdu Scale In
106 [Documentation] Perform a manual scale-in operation of the VNF.
108 Variable Should Exist ${NS_ID} msg=Network service instance is not available
109 ${ns_op_id}= Execute Manual VNF Scale ${NS_NAME} ${VNF_MEMBER_INDEX} ${SCALING_GROUP} SCALE_IN
112 Check Vdus After Scaling In
113 [Documentation] Check whether there is one less VDU after scaling in.
115 Variable Should Exist ${NS_ID} msg=Network service instance is not available
116 @{vdur_list}= Get Vnf Vdur Names ${VNF_ID}
117 Log List ${vdur_list}
118 ${vdurs}= Get Length ${vdur_list}
119 IF ${vdurs} != ${INITIAL_VDUR_COUNT} Fail msg=There is the same number of VDU records in the VNF after Scale In
122 [Documentation] Delete NS instance.
127 [Documentation] Delete NS package from OSM.
129 Delete NSD ${NSD_NAME}
131 Delete VNF Descriptor
132 [Documentation] Delete VNF package from OSM.
134 Delete VNFD ${VNFD_NAME}
139 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
140 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
141 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
142 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}