blob: 07043239269de30eac768d862bed377f799f8376 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Dominik Fleischmann46186c82020-07-23 13:28:01 +02002# 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
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
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.
13
garciadeblas7a9e0312023-12-11 22:24:46 +010014
Dominik Fleischmann46186c82020-07-23 13:28:01 +020015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [BASIC-11] Native Charms
Dominik Fleischmann46186c82020-07-23 13:28:01 +020017
18Library OperatingSystem
19Library SSHLibrary
20
garciadeblas7a9e0312023-12-11 22:24:46 +010021Resource ../lib/vnfd_lib.resource
22Resource ../lib/nsd_lib.resource
23Resource ../lib/ns_lib.resource
24Resource ../lib/ssh_lib.resource
Dominik Fleischmann46186c82020-07-23 13:28:01 +020025
garciadeblas7a9e0312023-12-11 22:24:46 +010026Test Tags basic_11 cluster_ee_config cluster_relations regression azure
garciadeblas4cf45d72021-04-08 13:52:22 +020027
garciadeblasd225e552020-10-02 16:10:14 +000028Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Dominik Fleischmann46186c82020-07-23 13:28:01 +020029
30
31*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020032# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010033${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
almagiab4697d32021-05-25 08:56:17 +020037
38# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010039${NS_NAME} basic_11_native_charms
40${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
41${NS_TIMEOUT} 15min
almagiab4697d32021-05-25 08:56:17 +020042
43# SSH keys and username to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010044${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
45${PRIVATEKEY} %{HOME}/.ssh/id_rsa
46${USERNAME} ubuntu
47${PASSWORD} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020048
garciadeblas7a9e0312023-12-11 22:24:46 +010049${ACTION_NAME} touch
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
Dominik Fleischmann46186c82020-07-23 13:28:01 +020055
56
57*** Test Cases ***
58Create Charm VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010059 [Documentation] Upload VNF package for the testsuite.
60 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Dominik Fleischmann46186c82020-07-23 13:28:01 +020061
62Create Charm NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010063 [Documentation] Upload NS package for the testsuite.
64 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Dominik Fleischmann46186c82020-07-23 13:28:01 +020065
66Instantiate Charm Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010067 [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}
Dominik Fleischmann46186c82020-07-23 13:28:01 +020070
71Get Management Ip Addresses
garciadeblas7a9e0312023-12-11 22:24:46 +010072 [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}
garciadeblas321726f2022-12-21 11:43:06 +010074 Log ${ip_addr_1}
garciadeblas7a9e0312023-12-11 22:24:46 +010075 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}
garciadeblas321726f2022-12-21 11:43:06 +010077 Log ${ip_addr_2}
garciadeblas7a9e0312023-12-11 22:24:46 +010078 Set Suite Variable ${VNF_2_IP_ADDR} ${ip_addr_2}
Dominik Fleischmann46186c82020-07-23 13:28:01 +020079
80Test SSH Access
garciadeblas7a9e0312023-12-11 22:24:46 +010081 [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
garciadeblasf4ebaa82022-06-23 13:33:26 +020084 Sleep 30s Waiting ssh daemon to be up
garciadeblas7a9e0312023-12-11 22:24:46 +010085 Test SSH Connection ${VNF_1_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY}
86 Test SSH Connection ${VNF_2_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY}
Dominik Fleischmann46186c82020-07-23 13:28:01 +020087
88Check Remote Files Created Via Day 1 Operations
garciadeblasf4ebaa82022-06-23 13:33:26 +020089 [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.
garciadeblas7a9e0312023-12-11 22:24:46 +010091 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}
Dominik Fleischmann46186c82020-07-23 13:28:01 +020093
94Delete NS Instance
garciadeblas7a9e0312023-12-11 22:24:46 +010095 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020096 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010097 Delete NS ${NS_NAME}
Dominik Fleischmann46186c82020-07-23 13:28:01 +020098
99Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200101 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100102 Delete NSD ${NSD_NAME}
Dominik Fleischmann46186c82020-07-23 13:28:01 +0200103
104Delete VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 [Documentation] Delete VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +0200106 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100107 Delete VNFD ${VNFD_NAME}
Dominik Fleischmann46186c82020-07-23 13:28:01 +0200108
109
110*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000111Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200112 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
garciadeblas7a9e0312023-12-11 22:24:46 +0100113 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}