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-27] Update Helm EE in Running VNF Instance.
16 Library OperatingSystem
19 Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
20 Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
21 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
22 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
24 Force Tags basic_27 cluster_ee_config daily regression
26 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
30 # NS and VNF descriptor package folder and ids
31 ${vnfd_pkg} simple_ee_vnf
32 ${updated_vnfd_pkg} updated_simple_ee_vnf
33 ${vnfd_name} simple_ee-vnf
34 ${nsd_pkg} simple_ee_ns
35 ${nsd_name} simple_ee-ns
37 # NS instance name and configuration
38 ${ns_name} basic_27_helm_ee_update_test
39 ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
41 # SSH keys and username to be used
42 ${publickey} %{HOME}/.ssh/id_rsa.pub
43 ${privatekey} %{HOME}/.ssh/id_rsa
48 ${new_action_name} mkdir
49 ${vnf_member_index} simple
50 ${day_1_file_name} /home/ubuntu/first-touch
51 ${day_2_file_name} /home/ubuntu/mytouch1
52 ${day_2_folder_name} /home/ubuntu/myfolder1
55 # NS update operation configuration
56 ${update_type} CHANGE_VNFPKG
57 ${ns_update_timeout} 500
63 ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
64 Set Suite Variable ${vnfd_id} ${id}
69 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
72 Instantiate Network Service
74 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout}
75 Set Suite Variable ${ns_id} ${id}
80 Variable Should Exist ${ns_id} msg=NS is not available
81 ${id} Get Vnf Id ${ns_id} ${vnf_member_index}
83 Set Suite Variable ${vnf_id} ${id}
84 Set Suite Variable ${ns_update_config} '{changeVnfPackageData: [{vnfInstanceId: "${vnf_id}", vnfdId: "${vnfd_id}"}]}'
87 Get Management Ip Address
89 ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
91 Set Suite Variable ${vnf_ip_addr} ${ip_addr}
96 Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF '${vnf_member_index}' is not available
97 Sleep 30s Waiting ssh daemon to be up
98 Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey}
101 Check Remote Files Created Via Day 1 Operation
102 [Documentation] The VNF has a Day 1 operation that creates a file named ${day_1_file_name}.
103 ... This test checks whether that files have been created or not.
105 Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name}
108 Execute Day 2 Operation
109 [Documentation] Performs one Day 2 operation on the VNF that creates a new file.
111 Variable Should Exist ${ns_id} msg=Network service instance is not available
112 ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} file-path=${day_2_file_name}
115 Check Remote File Created Via Day 2 Operation
116 [Documentation] Check whether the file created in the previous test via Day 2 operations exist or not.
118 Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name}
122 [Documentation] Updates the VNFD by using new VNFD package which includes the EE
123 ... which has new day2 operation.
125 Update VNFD '%{PACKAGES_FOLDER}/${updated_vnfd_pkg}' ${vnfd_name}
128 Update Running VNF Instance
129 [Documentation] Updates the running VNF instance by using new VNFD package.
130 ... As the VNFD has an updated Helm EE, this operation will trigger the upgrade of existing Helm EE
131 ... for the specific VNF.
133 Update Network Service ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout}
136 Execute Day 2 Operation on Upgraded Helm EE
137 [Documentation] Performs one Day 2 operation on the updated VNF that creates a new folder.
139 Variable Should Exist ${ns_id} msg=Network service instance is not available
140 ${ns_op_id_2}= Execute NS Action ${ns_name} ${new_action_name} ${vnf_member_index} foldername=${day_2_folder_name}
143 Check Remote Folder Created Via Day 2 Operation
144 [Documentation] Check whether the folder created in the previous test via Day 2 operations exist or not.
146 Check If remote Folder Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_2_folder_name}
158 Delete NSD ${nsd_name}
161 Delete VNF Descriptor
164 Delete VNFD ${vnfd_name}
169 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
171 Run Keyword If Any Tests Failed Delete NS ${ns_name}
173 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
175 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}