blob: 6c14e57667bb3738fd828e70a00b2f5cc24a28ce [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
aguilard3422ec32021-06-30 12:28:46 +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
aguilard3422ec32021-06-30 12:28:46 +020015*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020016Documentation [FAIL-01] A single VNF with 2 VDUs, one of them unallocatable because of resources.
aguilard3422ec32021-06-30 12:28:46 +020017
18Library OperatingSystem
19Library String
20Library Collections
21Library SSHLibrary
22
garciadeblas7a9e0312023-12-11 22:24:46 +010023Resource ../lib/vnfd_lib.resource
24Resource ../lib/nsd_lib.resource
25Resource ../lib/ns_lib.resource
26Resource ../lib/openstack_lib.resource
aguilard3422ec32021-06-30 12:28:46 +020027
garciadeblas7a9e0312023-12-11 22:24:46 +010028Test Tags fail_01 cluster_main daily regression
aguilard3422ec32021-06-30 12:28:46 +020029
30Suite Teardown Run Keyword And Ignore Error Suite Cleanup
31
32
33*** Variables ***
34# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010035${VNFD_PKG} simple_2vm_vnf
36${VNFD_NAME} simple_2vm-vnf
37${NSD_PKG} simple_2vm_ns
38${NSD_NAME} simple_2vm-ns
aguilard3422ec32021-06-30 12:28:46 +020039
40# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010041${NS_NAME_PREFIX} fail_01
42${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
aguilard3422ec32021-06-30 12:28:46 +020043
44# SSH keys to be used
garciadeblas7a9e0312023-12-11 22:24:46 +010045${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
aguilard3422ec32021-06-30 12:28:46 +020046
aguilardceb1cb42022-02-24 10:54:14 +000047# Default memory in GB for dataVM VDU (can be overwritten by VM_MEMORY_OVERRIDE environment variable)
48# Only used if no quota is defined in Openstack's project (VDU tries to allocate the full memory of the quota)
garciadeblas7a9e0312023-12-11 22:24:46 +010049${DEFAULT_MEMORY} 250
aguilard3422ec32021-06-30 12:28:46 +020050
51# NS launch timeout and polling time
garciadeblas7a9e0312023-12-11 22:24:46 +010052${NS_LAUNCH_MAX_WAIT_TIME} 5min
53${NS_LAUNCH_POL_TIME} 15
aguilard3422ec32021-06-30 12:28:46 +020054
55# Openstack delete operation timeout and polling time
garciadeblas7a9e0312023-12-11 22:24:46 +010056${OS_DELETE_MAX_WAIT_TIME} 6min
57${OS_DELETE_POL_TIME} 20
aguilard3422ec32021-06-30 12:28:46 +020058
59
60*** Test Cases ***
61Create VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010062 [Documentation] Upload VNF package for the testsuite.
aguilardceb1cb42022-02-24 10:54:14 +000063 ${ram_quota}= Get Project Quota ram
64 IF ${ram_quota} == -1
garciadeblas7a9e0312023-12-11 22:24:46 +010065 ${memory}= Get Environment Variable VM_MEMORY_OVERRIDE default=${DEFAULT_MEMORY}
aguilardceb1cb42022-02-24 10:54:14 +000066 ELSE
67 ${memory}= Evaluate ${ram_quota} / 1000
68 END
garciadeblas321726f2022-12-21 11:43:06 +010069 Log ${memory}
garciadeblas7a9e0312023-12-11 22:24:46 +010070 Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${VNFD_PKG}' virtual-compute-desc.1.virtual-memory.size=${memory}
aguilard3422ec32021-06-30 12:28:46 +020071
72Create NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010073 [Documentation] Upload NS package for the testsuite.
74 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
aguilard3422ec32021-06-30 12:28:46 +020075
76Cannot Instantiate Network Service
garciadeblas7a9e0312023-12-11 22:24:46 +010077 [Documentation] Assert failure when trying to instantiate the NS instance and there are not enough resources in the VIM.
garciadeblasf4ebaa82022-06-23 13:33:26 +020078 ${rand}= Generate Random String 4 [NUMBERS]
garciadeblas7a9e0312023-12-11 22:24:46 +010079 ${ns_name}= Catenate SEPARATOR=_ ${NS_NAME_PREFIX} ${rand}
80 Set Suite Variable ${NS_NAME}
81 Log ${NS_NAME}
82 ${id}= Instantiate Network Service ${NS_NAME} ${NSD_NAME} %{VIM_TARGET} --config '${NS_CONFIG}' --ssh_keys ${PUBLICKEY}
garciadeblas321726f2022-12-21 11:43:06 +010083 Log ${id}
garciadeblas7a9e0312023-12-11 22:24:46 +010084 Set Suite Variable ${NS_ID} ${id}
85 WAIT UNTIL KEYWORD SUCCEEDS ${NS_LAUNCH_MAX_WAIT_TIME} ${NS_LAUNCH_POL_TIME} Check For Ns Instance To Configured ${NS_NAME}
86 ${rc} ${stdout}= Run And Return Rc And Output osm ns-list --filter id="${NS_ID}" | grep ${NS_ID} | awk '{print $8}'
87 Log ${rc},${stdout}
aguilard3422ec32021-06-30 12:28:46 +020088 Should Contain ${stdout} BROKEN
garciadeblas7a9e0312023-12-11 22:24:46 +010089 ${rc} ${stdout}= Run And Return Rc And Output osm ns-show ${NS_ID} --literal | yq .errorDetail
90 Log ${rc},${stdout}
aguilard3422ec32021-06-30 12:28:46 +020091 Should Contain ${stdout} Deploying at VIM: Error at create vdu
92
aguilard3422ec32021-06-30 12:28:46 +020093Delete NS Instance And Check VIM
garciadeblas7a9e0312023-12-11 22:24:46 +010094 [Documentation] Delete NS instance and check that the VMs have been deleted.
aguilard3422ec32021-06-30 12:28:46 +020095 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010096 Delete NS ${NS_NAME}
97 WAIT UNTIL KEYWORD SUCCEEDS ${OS_DELETE_MAX_WAIT_TIME} ${OS_DELETE_POL_TIME} Check NS Servers In VIM ${NS_NAME} 0
aguilard3422ec32021-06-30 12:28:46 +020098
99Delete NS Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100100 [Documentation] Delete NS package from OSM.
aguilard3422ec32021-06-30 12:28:46 +0200101 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100102 Delete NSD ${NSD_NAME}
aguilard3422ec32021-06-30 12:28:46 +0200103
104Delete VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +0100105 [Documentation] Delete VNF package from OSM.
aguilard3422ec32021-06-30 12:28:46 +0200106 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +0100107 Delete VNFD ${VNFD_NAME}
aguilard3422ec32021-06-30 12:28:46 +0200108
109
110*** Keywords ***
111Suite 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}