blob: 219c7c999071c1ae70b34dd4631ae0b263775a29 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
Gabriel Cubadb73aa72023-11-23 00:44:58 -05002# 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
Gabriel Cubadb73aa72023-11-23 00:44:58 -050015*** Settings ***
16Documentation [LCMOP_01] Cancel an ongoing NS operation
17
18Library 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/ns_operation_lib.resource
28Resource ../lib/connectivity_lib.resource
29Resource ../lib/ssh_lib.resource
Gabriel Cubadb73aa72023-11-23 00:44:58 -050030
garciadeblas7a9e0312023-12-11 22:24:46 +010031Test Tags lcmop_01 cluster_lcmop daily
Gabriel Cubadb73aa72023-11-23 00:44:58 -050032
33Suite Teardown Run Keyword And Ignore Error Suite Cleanup
34
35
36*** Variables ***
37# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010038${VNFD_PKG} simple_ee_vnf
39${VNFD_NAME} simple_ee-vnf
40${NSD_PKG} simple_ee_ns
41${NSD_NAME} simple_ee-ns
Gabriel Cubadb73aa72023-11-23 00:44:58 -050042
43# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010044${NS_NAME} lcmop_01_cancel_operation_basic
45${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
Gabriel Cubadb73aa72023-11-23 00:44:58 -050046
47
48*** Test Cases ***
49Create VNF Descriptor
50 [Documentation] Create the VNF descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010051 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Gabriel Cubadb73aa72023-11-23 00:44:58 -050052
53Create NS Descriptor
54 [Documentation] Create the NS descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010055 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Gabriel Cubadb73aa72023-11-23 00:44:58 -050056
57Instantiate Network Service
58 [Documentation] Instantiate the Network service
garciadeblas7a9e0312023-12-11 22:24:46 +010059 ${id}= Instantiate Network Service ${NS_NAME} ${NSD_NAME} %{VIM_TARGET} --config '${NS_CONFIG}'
60 Set Suite Variable ${NS_ID} ${id}
garciadeblas23ff8f92023-12-11 16:26:40 +010061
garciadeblas7a9e0312023-12-11 22:24:46 +010062Get Operation ID
Gabriel Cubadb73aa72023-11-23 00:44:58 -050063 [Documentation] Obtain the operation ID of the NS instantiation
garciadeblas7a9e0312023-12-11 22:24:46 +010064 ${id}= Get Operations By Type ${NS_ID} instantiate
65 Set Suite Variable ${OP_ID} ${id}
garciadeblas23ff8f92023-12-11 16:26:40 +010066
garciadeblas7a9e0312023-12-11 22:24:46 +010067Cancel Operation
Gabriel Cubadb73aa72023-11-23 00:44:58 -050068 [Documentation] Cancel the ongoing NS instantiation
Gabriel Cubadb73aa72023-11-23 00:44:58 -050069 Sleep 5s Waiting before cancelling the operation
garciadeblas7a9e0312023-12-11 22:24:46 +010070 Cancel Operation By Id ${OP_ID}
garciadeblas23ff8f92023-12-11 16:26:40 +010071
garciadeblas7a9e0312023-12-11 22:24:46 +010072Check That Operation Is Cancelled
Gabriel Cubadb73aa72023-11-23 00:44:58 -050073 [Documentation] Check that the operation is succesfully cancelled
garciadeblas7a9e0312023-12-11 22:24:46 +010074 Check For NS Operation Cancelled ${OP_ID}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050075
76Delete NS Instance Test
77 [Documentation] Delete the cancelled NS instance
78 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010079 Delete NS ${NS_NAME}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050080
81Delete NS Descriptor Test
82 [Documentation] Delete the NS descriptor
83 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010084 Delete NSD ${NSD_NAME}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050085
86Delete VNF Descriptor Test
87 [Documentation] Delete the VNF descriptor
88 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010089 Delete VNFD ${VNFD_NAME}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050090
91
92*** Keywords ***
93Suite Cleanup
94 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +010095 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
96 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
97 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}