| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 2 | # 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 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 14 | |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 15 | *** Settings *** |
| 16 | Documentation [LCMOP_01] Cancel an ongoing NS operation |
| 17 | |
| 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library Process |
| 22 | Library SSHLibrary |
| 23 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 24 | Resource ../lib/vnfd_lib.resource |
| 25 | Resource ../lib/nsd_lib.resource |
| 26 | Resource ../lib/ns_lib.resource |
| 27 | Resource ../lib/ns_operation_lib.resource |
| 28 | Resource ../lib/connectivity_lib.resource |
| 29 | Resource ../lib/ssh_lib.resource |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 30 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 31 | Test Tags lcmop_01 cluster_lcmop daily |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 32 | |
| 33 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| 34 | |
| 35 | |
| 36 | *** Variables *** |
| 37 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 38 | ${VNFD_PKG} simple_ee_vnf |
| garciadeblas | bb0fb57 | 2025-11-25 17:48:05 +0100 | [diff] [blame] | 39 | ${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" |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${NSD_PKG} simple_ee_ns |
| garciadeblas | bb0fb57 | 2025-11-25 17:48:05 +0100 | [diff] [blame] | 42 | ${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 Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 44 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 45 | ${NS_NAME} lcmop_01_cancel_operation_basic |
| 46 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 47 | |
| 48 | |
| 49 | *** Test Cases *** |
| 50 | Create VNF Descriptor |
| 51 | [Documentation] Create the VNF descriptor |
| garciadeblas | bb0fb57 | 2025-11-25 17:48:05 +0100 | [diff] [blame] | 52 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' ${VNFD_OVERRIDE} |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 53 | |
| 54 | Create NS Descriptor |
| 55 | [Documentation] Create the NS descriptor |
| garciadeblas | bb0fb57 | 2025-11-25 17:48:05 +0100 | [diff] [blame] | 56 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' ${NSD_OVERRIDE} |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 57 | |
| 58 | Instantiate Network Service |
| 59 | [Documentation] Instantiate the Network service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 60 | ${id}= Instantiate Network Service ${NS_NAME} ${NSD_NAME} %{VIM_TARGET} --config '${NS_CONFIG}' |
| 61 | Set Suite Variable ${NS_ID} ${id} |
| garciadeblas | 23ff8f9 | 2023-12-11 16:26:40 +0100 | [diff] [blame] | 62 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 63 | Get Operation ID |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 64 | [Documentation] Obtain the operation ID of the NS instantiation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | ${id}= Get Operations By Type ${NS_ID} instantiate |
| 66 | Set Suite Variable ${OP_ID} ${id} |
| garciadeblas | 23ff8f9 | 2023-12-11 16:26:40 +0100 | [diff] [blame] | 67 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | Cancel Operation |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 69 | [Documentation] Cancel the ongoing NS instantiation |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 70 | Sleep 5s Waiting before cancelling the operation |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 71 | Cancel Operation By Id ${OP_ID} |
| garciadeblas | 23ff8f9 | 2023-12-11 16:26:40 +0100 | [diff] [blame] | 72 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 73 | Check That Operation Is Cancelled |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 74 | [Documentation] Check that the operation is succesfully cancelled |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 75 | Check For NS Operation Cancelled ${OP_ID} |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 76 | |
| 77 | Delete NS Instance Test |
| 78 | [Documentation] Delete the cancelled NS instance |
| 79 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | Delete NS ${NS_NAME} |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 81 | |
| 82 | Delete NS Descriptor Test |
| 83 | [Documentation] Delete the NS descriptor |
| 84 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | Delete NSD ${NSD_NAME} |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 86 | |
| 87 | Delete VNF Descriptor Test |
| 88 | [Documentation] Delete the VNF descriptor |
| 89 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | Delete VNFD ${VNFD_NAME} |
| Gabriel Cuba | db73aa7 | 2023-11-23 00:44:58 -0500 | [diff] [blame] | 91 | |
| 92 | |
| 93 | *** Keywords *** |
| 94 | Suite Cleanup |
| 95 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 96 | 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} |