blob: a4ddf3333f6a19f3c05da647b1dd8a1efaa62af7 [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-MULTIVDU] Basic NS with two multi-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_multivdu cluster_main daily regression 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_multivdu_vnf
38${VNFD_NAME} hackfest_multivdu-vnf
39${NSD_PKG} hackfest_multivdu_ns
40${NSD_NAME} hackfest_multivdu-ns
almagiab4697d32021-05-25 08:56:17 +020041
42# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010043${NS_NAME} hfmultivdu
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} vnf1
54${VNF_IP_ADDR} ${EMPTY}
55${WAIT_GUARD_FOR_VM_BOOT} 50s
almagiab4697d32021-05-25 08:56:17 +020056
Felipe Vicensf96bb452020-06-22 08:12:30 +020057
58*** Test Cases ***
59Create Hackfest multivdu VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010060 [Documentation] Upload VNF package for the testsuite.
61 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020062
63Create Hackfest Multivdu NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010064 [Documentation] Upload NS package for the testsuite.
65 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020066
67Network Service Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010068 [Documentation] Instantiate NS for the testsuite.
69 ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${PUBLICKEY}
70 Log ${status},${message}
71 IF "${status}" == "FAIL" Set Global Variable ${PUBLICKEY} ${EMPTY}
72 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
73 Set Suite Variable ${NS_ID} ${id}
74 Sleep ${WAIT_GUARD_FOR_VM_BOOT} Waiting for VM's daemons to be up and running
Felipe Vicensf96bb452020-06-22 08:12:30 +020075
76Get Vnf Ip Address
garciadeblas7a9e0312023-12-11 22:24:46 +010077 [Documentation] Get the mgmt IP address of the VNF of the NS.
78 ${ip_addr}= Get Vnf Management Ip Address ${NS_ID} ${VNF_MEMBER_INDEX}
garciadeblas321726f2022-12-21 11:43:06 +010079 Log ${ip_addr}
garciadeblas7a9e0312023-12-11 22:24:46 +010080 Set Suite Variable ${VNF_IP_ADDR} ${ip_addr}
Felipe Vicensf96bb452020-06-22 08:12:30 +020081
82Test Ping
garciadeblas7a9e0312023-12-11 22:24:46 +010083 [Documentation] Test that the mgmt IP address of the VNF is reachable with ping.
84 Test Connectivity ${VNF_IP_ADDR}
Felipe Vicensf96bb452020-06-22 08:12:30 +020085
86Test SSH Access
garciadeblas7a9e0312023-12-11 22:24:46 +010087 [Documentation] Check that the VNF is accessible via SSH in its mgmt IP address.
88 ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${PRIVATEKEY}
89 Log ${status},${message}
garciadeblas66e307d2023-12-14 10:30:09 +010090 IF "${status}" == "FAIL" Set Global Variable ${PRIVATEKEY} ${EMPTY}
garciadeblas7a9e0312023-12-11 22:24:46 +010091 Test SSH Connection ${VNF_IP_ADDR} ${USERNAME} ${PASSWORD} ${PRIVATEKEY}
Felipe Vicensf96bb452020-06-22 08:12:30 +020092
93Delete NS Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010094 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020095 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010096 Delete NS ${NS_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +020097
98Delete NS Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010099 [Documentation] Delete NS package.
garciadeblas4cf45d72021-04-08 13:52:22 +0200100 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100101 Delete NSD ${NSD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200102
103Delete VNF Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +0100104 [Documentation] Delete VNF package.
garciadeblas4cf45d72021-04-08 13:52:22 +0200105 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100106 Delete VNFD ${VNFD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +0200107
108
109*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000110Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200111 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +0100112 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
113 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
114 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}