blob: 47bc464c8d8e2f1e58a796561af2f7e865236f18 [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
garciadeblasbb0fb572025-11-25 17:48:05 +010039${VNFD_NAME} lcmop_01_vnf
40${VNFD_OVERRIDE} --override "id=lcmop_01_vnf;product-name=lcmop_01_vnf;df.0.lcm-operations-configuration.operate-vnf-op-config.day1-2.0.id=lcmop_01_vnf"
garciadeblas7a9e0312023-12-11 22:24:46 +010041${NSD_PKG} simple_ee_ns
garciadeblasbb0fb572025-11-25 17:48:05 +010042${NSD_NAME} lcmop_01_ns
43${NSD_OVERRIDE} --override "id=lcmop_01_ns;name=lcmop_01_ns;df.0.vnf-profile.0.vnfd-id=lcmop_01_vnf;vnfd-id.0=lcmop_01_vnf"
Gabriel Cubadb73aa72023-11-23 00:44:58 -050044# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010045${NS_NAME} lcmop_01_cancel_operation_basic
46${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
Gabriel Cubadb73aa72023-11-23 00:44:58 -050047
48
49*** Test Cases ***
50Create VNF Descriptor
51 [Documentation] Create the VNF descriptor
garciadeblasbb0fb572025-11-25 17:48:05 +010052 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' ${VNFD_OVERRIDE}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050053
54Create NS Descriptor
55 [Documentation] Create the NS descriptor
garciadeblasbb0fb572025-11-25 17:48:05 +010056 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' ${NSD_OVERRIDE}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050057
58Instantiate Network Service
59 [Documentation] Instantiate the Network service
garciadeblas7a9e0312023-12-11 22:24:46 +010060 ${id}= Instantiate Network Service ${NS_NAME} ${NSD_NAME} %{VIM_TARGET} --config '${NS_CONFIG}'
61 Set Suite Variable ${NS_ID} ${id}
garciadeblas23ff8f92023-12-11 16:26:40 +010062
garciadeblas7a9e0312023-12-11 22:24:46 +010063Get Operation ID
Gabriel Cubadb73aa72023-11-23 00:44:58 -050064 [Documentation] Obtain the operation ID of the NS instantiation
garciadeblas7a9e0312023-12-11 22:24:46 +010065 ${id}= Get Operations By Type ${NS_ID} instantiate
66 Set Suite Variable ${OP_ID} ${id}
garciadeblas23ff8f92023-12-11 16:26:40 +010067
garciadeblas7a9e0312023-12-11 22:24:46 +010068Cancel Operation
Gabriel Cubadb73aa72023-11-23 00:44:58 -050069 [Documentation] Cancel the ongoing NS instantiation
Gabriel Cubadb73aa72023-11-23 00:44:58 -050070 Sleep 5s Waiting before cancelling the operation
garciadeblas7a9e0312023-12-11 22:24:46 +010071 Cancel Operation By Id ${OP_ID}
garciadeblas23ff8f92023-12-11 16:26:40 +010072
garciadeblas7a9e0312023-12-11 22:24:46 +010073Check That Operation Is Cancelled
Gabriel Cubadb73aa72023-11-23 00:44:58 -050074 [Documentation] Check that the operation is succesfully cancelled
garciadeblas7a9e0312023-12-11 22:24:46 +010075 Check For NS Operation Cancelled ${OP_ID}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050076
77Delete NS Instance Test
78 [Documentation] Delete the cancelled NS instance
79 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010080 Delete NS ${NS_NAME}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050081
82Delete NS Descriptor Test
83 [Documentation] Delete the NS descriptor
84 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010085 Delete NSD ${NSD_NAME}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050086
87Delete VNF Descriptor Test
88 [Documentation] Delete the VNF descriptor
89 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010090 Delete VNFD ${VNFD_NAME}
Gabriel Cubadb73aa72023-11-23 00:44:58 -050091
92
93*** Keywords ***
94Suite Cleanup
95 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +010096 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
97 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
98 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}