blob: 09d8aa58438eb909ef62ca6f21a895e36598ff4d [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Felipe Vicensf96bb452020-06-22 08:12:30 +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
Felipe Vicensf96bb452020-06-22 08:12:30 +020015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [HACKFEST-BASIC] Basic NS with a single-VDU VNF
garciadeblas4cf45d72021-04-08 13:52:22 +020017
Felipe Vicensf96bb452020-06-22 08:12:30 +020018Library OperatingSystem
19Library String
20Library Collections
21Library Process
22Library SSHLibrary
23
garciadeblas7a9e0312023-12-11 22:24:46 +010024Resource ../lib/vnfd_lib.resource
25Resource ../lib/nsd_lib.resource
26Resource ../lib/ns_lib.resource
27Resource ../lib/connectivity_lib.resource
28Resource ../lib/ssh_lib.resource
Felipe Vicensf96bb452020-06-22 08:12:30 +020029
garciadeblas7a9e0312023-12-11 22:24:46 +010030Test Tags hackfest_basic cluster_main daily regression sanity azure
garciadeblas4cf45d72021-04-08 13:52:22 +020031
garciadeblasd225e552020-10-02 16:10:14 +000032Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +020033
34
35*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020036# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010037${VNFD_PKG} hackfest_basic_vnf
38${VNFD_NAME} hackfest_basic-vnf
39${NSD_PKG} hackfest_basic_ns
40${NSD_NAME} hackfest_basic-ns
almagiab4697d32021-05-25 08:56:17 +020041
42# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010043${NS_NAME} hfbasic
44${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
almagiab4697d32021-05-25 08:56:17 +020045
46# SSH keys and username to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010047${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
48${PRIVATEKEY} %{HOME}/.ssh/id_rsa
49${USERNAME} ubuntu
50${PASSWORD} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020051
garciadeblas7a9e0312023-12-11 22:24:46 +010052${NS_ID} ${EMPTY}
53${VNF_MEMBER_INDEX} vnf
54${VNF_IP_ADDR} ${EMPTY}
almagiab4697d32021-05-25 08:56:17 +020055
Felipe Vicensf96bb452020-06-22 08:12:30 +020056
57*** Test Cases ***
58Create Hackfest Basic VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010059 [Documentation] Upload VNF package for the testsuite.
60 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020061
62Create Hackfest Basic NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010063 [Documentation] Upload NS package for the testsuite.
64 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020065
66Network Service Instance Test
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}
69 Set Suite Variable ${NS_ID} ${id}
Felipe Vicensf96bb452020-06-22 08:12:30 +020070
71Get Vnf Ip Address
garciadeblas7a9e0312023-12-11 22:24:46 +010072 [Documentation] Get the mgmt IP address of the VNF of the NS.
73 ${ip_addr}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX}
garciadeblas321726f2022-12-21 11:43:06 +010074 Log ${ip_addr}
garciadeblas7a9e0312023-12-11 22:24:46 +010075 Set Suite Variable ${VNF_IP_ADDR} ${ip_addr}
Felipe Vicensf96bb452020-06-22 08:12:30 +020076
77Test Ping
garciadeblas7a9e0312023-12-11 22:24:46 +010078 [Documentation] Test that the mgmt IP address of the VNF is reachable with ping.
79 Test Connectivity ${VNF_IP_ADDR}
Felipe Vicensf96bb452020-06-22 08:12:30 +020080
81Test SSH Access
garciadeblas7a9e0312023-12-11 22:24:46 +010082 [Documentation] Check that the VNF is accessible via SSH in its mgmt IP address.
Felipe Vicensf96bb452020-06-22 08:12:30 +020083 Sleep 30s Waiting ssh daemon to be up
garciadeblas7a9e0312023-12-11 22:24:46 +010084 Test SSH Connection ${VNF_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY}
Felipe Vicensf96bb452020-06-22 08:12:30 +020085
86Delete NS Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010087 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020088 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010089 Delete NS ${NS_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +020090
91Delete NS Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010092 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020093 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010094 Delete NSD ${NSD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +020095
96Delete VNF Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010097 [Documentation] Delete VNF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020098 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010099 Delete VNFD ${VNFD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200100
101
102*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000103Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200104 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
106 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
107 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}