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 [BASIC-09] Manual VNF/VDU Scaling.
16 Library OperatingSystem
20 Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
21 Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
22 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
23 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
25 Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_09-manual_vdu_scaling_data.py
27 Force Tags basic_09 cluster_main daily regression
29 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
33 ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
34 ${scaling_group} vdu_autoscale
39 Create Scaling VNF Descriptor
41 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
44 Create Scaling NS Descriptor
46 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
49 Instantiate Scaling Network Service
51 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
52 Set Suite Variable ${ns_id} ${id}
57 Variable Should Exist ${ns_id} msg=Network service instance is not available
58 @{vnfr_list}= Get Ns Vnfr Ids ${ns_id}
60 Set Suite Variable ${vnf_id} ${vnfr_list}[0]
63 Get Vdus Before Scale Out
64 [Documentation] Get the number of VDU records before the manual scaling.
66 @{vdur_list}= Get Vnf Vdur Names ${vnf_id}
68 ${vdurs}= Get Length ${vdur_list}
69 Set Suite Variable ${initial_vdur_count} ${vdurs}
72 Perform Manual Vdu Scale Out
74 Variable Should Exist ${ns_id} msg=Network service instance is not available
75 ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT
78 Check Vdus After Scale Out
79 [Documentation] Check whether there is one more VDU after scaling or not.
81 Variable Should Exist ${ns_id} msg=Network service instance is not available
82 @{vdur_list}= Get Vnf Vdur Names ${vnf_id}
84 ${vdurs}= Get Length ${vdur_list}
85 Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out
88 Perform Manual Vdu Scale In
90 Variable Should Exist ${ns_id} msg=Network service instance is not available
91 ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN
94 Check Vdus After Scaling In
95 [Documentation] Check whether there is one less VDU after scaling or not.
97 Variable Should Exist ${ns_id} msg=Network service instance is not available
98 @{vdur_list}= Get Vnf Vdur Names ${vnf_id}
100 ${vdurs}= Get Length ${vdur_list}
101 Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In
113 Delete NSD ${nsd_name}
116 Delete VNF Descriptor
119 Delete VNFD ${vnfd_name}
124 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
126 Run Keyword If Any Tests Failed Delete NS ${ns_name}
128 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
130 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}