blob: 9b0138b9ebd6fb2465062568822f65aff906750b [file] [log] [blame]
Felipe Vicensf96bb452020-06-22 08:12:30 +02001# 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
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
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.
12
13*** Settings ***
14Documentation [BASIC-09] Manual VNF/VDU Scaling.
15
16Library OperatingSystem
17Library String
18Library Collections
19
20Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
21Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
22Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
23Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
24
aguilarhernac0b3a8e2021-05-12 08:56:23 +000025Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_09-manual_vdu_scaling_data.py
26
garciadeblas4cf45d72021-04-08 13:52:22 +020027Force Tags basic_09 cluster_main daily regression
28
garciadeblasd225e552020-10-02 16:10:14 +000029Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +020030
31
32*** Variables ***
33${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
34${scaling_group} vdu_autoscale
35${vnf_member_index} 1
36
37
38*** Test Cases ***
39Create Scaling VNF Descriptor
Felipe Vicensf96bb452020-06-22 08:12:30 +020040
41 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
42
43
44Create Scaling NS Descriptor
Felipe Vicensf96bb452020-06-22 08:12:30 +020045
46 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
47
48
49Instantiate Scaling Network Service
Felipe Vicensf96bb452020-06-22 08:12:30 +020050
51 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
52 Set Suite Variable ${ns_id} ${id}
53
54
55Get Vnf Id
Felipe Vicensf96bb452020-06-22 08:12:30 +020056
57 Variable Should Exist ${ns_id} msg=Network service instance is not available
58 @{vnfr_list}= Get Ns Vnfr Ids ${ns_id}
59 Log List ${vnfr_list}
60 Set Suite Variable ${vnf_id} ${vnfr_list}[0]
61
62
63Get Vdus Before Scale Out
64 [Documentation] Get the number of VDU records before the manual scaling.
Felipe Vicensf96bb452020-06-22 08:12:30 +020065
66 @{vdur_list}= Get Vnf Vdur Names ${vnf_id}
67 Log List ${vdur_list}
68 ${vdurs}= Get Length ${vdur_list}
69 Set Suite Variable ${initial_vdur_count} ${vdurs}
70
71
72Perform Manual Vdu Scale Out
Felipe Vicensf96bb452020-06-22 08:12:30 +020073
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
76
77
78Check Vdus After Scale Out
79 [Documentation] Check whether there is one more VDU after scaling or not.
Felipe Vicensf96bb452020-06-22 08:12:30 +020080
81 Variable Should Exist ${ns_id} msg=Network service instance is not available
82 @{vdur_list}= Get Vnf Vdur Names ${vnf_id}
83 Log List ${vdur_list}
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
86
87
88Perform Manual Vdu Scale In
Felipe Vicensf96bb452020-06-22 08:12:30 +020089
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
92
93
94Check Vdus After Scaling In
95 [Documentation] Check whether there is one less VDU after scaling or not.
Felipe Vicensf96bb452020-06-22 08:12:30 +020096
97 Variable Should Exist ${ns_id} msg=Network service instance is not available
98 @{vdur_list}= Get Vnf Vdur Names ${vnf_id}
99 Log List ${vdur_list}
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
102
103
104Delete NS Instance
garciadeblas4cf45d72021-04-08 13:52:22 +0200105 [Tags] cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +0200106
107 Delete NS ${ns_name}
108
109
110Delete NS Descriptor
garciadeblas4cf45d72021-04-08 13:52:22 +0200111 [Tags] cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +0200112
113 Delete NSD ${nsd_name}
114
115
116Delete VNF Descriptor
garciadeblas4cf45d72021-04-08 13:52:22 +0200117 [Tags] cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +0200118
119 Delete VNFD ${vnfd_name}
120
121
122*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000123Suite Cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +0200124 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
125
garciadeblasd225e552020-10-02 16:10:14 +0000126 Run Keyword If Any Tests Failed Delete NS ${ns_name}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200127
garciadeblasd225e552020-10-02 16:10:14 +0000128 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200129
garciadeblasd225e552020-10-02 16:10:14 +0000130 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200131