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-11] Native Charms
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_11 cluster_ee_config cluster_relations regression azure
28 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
32 # NS and VNF descriptor package folder and ids
33 ${VNFD_PKG} charm-packages/native_charm_vnf
34 ${VNFD_NAME} native_charm-vnf
35 ${NSD_PKG} charm-packages/native_charm_ns
36 ${NSD_NAME} native_charm-ns
38 # NS instance name and configuration
39 ${NS_NAME} basic_11_native_charms
40 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43 # SSH keys and username to be used
44 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
45 ${PRIVATEKEY} %{HOME}/.ssh/id_rsa
50 ${VNF_MEMBER_INDEX_1} vnf1
51 ${VNF_MEMBER_INDEX_2} vnf2
52 ${DAY_1_FILE_NAME} /home/ubuntu/first-touch
53 ${DAY_2_FILE_NAME_1} /home/ubuntu/mytouch1
54 ${DAY_2_FILE_NAME_2} /home/ubuntu/mytouch2
58 Create Charm VNF Descriptor
59 [Documentation] Upload VNF package for the testsuite.
60 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
62 Create Charm NS Descriptor
63 [Documentation] Upload NS package for the testsuite.
64 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
66 Instantiate Charm Network Service
67 [Documentation] Instantiate NS for the testsuite.
68 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} ${NS_TIMEOUT}
69 Set Suite Variable ${NS_ID} ${id}
71 Get Management Ip Addresses
72 [Documentation] Get the mgmt IP address of the two VNF of the NS.
73 ${ip_addr_1}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX_1}
75 Set Suite Variable ${VNF_1_IP_ADDR} ${ip_addr_1}
76 ${ip_addr_2}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX_2}
78 Set Suite Variable ${VNF_2_IP_ADDR} ${ip_addr_2}
81 [Documentation] Check that both VNF are accessible via SSH in their respective mgmt IP address.
82 Variable Should Exist ${VNF_1_IP_ADDR} msg=IP address of the management VNF '${VNF_MEMBER_INDEX_1}' is not available
83 Variable Should Exist ${VNF_2_IP_ADDR} msg=IP address of the management VNF '${VNF_MEMBER_INDEX_2}' is not available
84 Sleep 30s Waiting ssh daemon to be up
85 Test SSH Connection ${VNF_1_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY}
86 Test SSH Connection ${VNF_2_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY}
88 Check Remote Files Created Via Day 1 Operations
89 [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}.
90 ... This test checks whether that files have been created or not.
91 Check If Remote File Exists ${VNF_1_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} ${DAY_1_FILE_NAME}
92 Check If Remote File Exists ${VNF_2_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} ${DAY_1_FILE_NAME}
95 [Documentation] Delete NS instance.
100 [Documentation] Delete NS package from OSM.
102 Delete NSD ${NSD_NAME}
104 Delete VNF Descriptor
105 [Documentation] Delete VNF package from OSM.
107 Delete VNFD ${VNFD_NAME}
112 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
113 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
114 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
115 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}