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-05] Instantiation parameters in cloud-init.
18 Library OperatingSystem
21 Resource ../lib/vnfd_lib.resource
22 Resource ../lib/nsd_lib.resource
23 Resource ../lib/ns_lib.resource
24 Resource ../lib/ssh_lib.resource
26 Test Tags basic_05 cluster_main daily regression azure
28 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
32 # NS and VNF descriptor package folder and ids
33 ${VNFD_PKG} ubuntu_cloudinit_vnf
34 ${VNFD_NAME} ubuntu_cloudinit-vnf
35 ${NSD_PKG} ubuntu_cloudinit_ns
36 ${NSD_NAME} ubuntu_cloudinit-ns
38 # NS instance name and configuration
39 ${NS_NAME} basic_05_instantiation_params_cloud_init
40 ${VNF_MEMBER_INDEX} vnf
41 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ], additionalParamsForVnf: [ { member-vnf-index: "${VNF_MEMBER_INDEX}", additionalParams: { password: "${NEW_PASSWORD}" } } ] }
43 # SSH user and password
45 ${NEW_PASSWORD} newpassword
49 Create Cloudinit VNF Descriptor
50 [Documentation] Upload VNF package for the testsuite.
51 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
53 Create Cloudinit NS Descriptor
54 [Documentation] Upload NS package for the testsuite.
55 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
57 Instantiate Cloudinit Network Service Using Instantiation Parameters
58 [Documentation] Instantiates the NS using the instantiation parameter 'additionalParamsForVnf' to change the password of the default user.
59 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${EMPTY}
60 Set Suite Variable ${NS_ID} ${id}
62 Get Management Ip Addresses
63 [Documentation] Retrieve VNF mgmt IP address from OSM.
64 ${ip_addr}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX}
66 Set Suite Variable ${VNF_IP_ADDR} ${ip_addr}
68 Test SSH Access With The New Password
69 [Documentation] Test SSH access with the new password configured via cloud-init.
70 Variable Should Exist ${VNF_IP_ADDR} msg=IP address of the management VNF is not available
71 Sleep 30s Waiting ssh daemon to be up
72 Test SSH Connection ${VNF_IP_ADDR} ${USERNAME} ${NEW_PASSWORD} ${EMPTY}
75 [Documentation] Delete NS instance.
80 [Documentation] Delete NS package from OSM.
82 Delete NSD ${NSD_NAME}
85 [Documentation] Delete VNF package from OSM.
87 Delete VNFD ${VNFD_NAME}
92 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
93 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
94 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
95 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}