blob: 3b9d215843e76cb6c0948e410d84fd86e6303b43 [file] [log] [blame]
Gabriel Cubadb73aa72023-11-23 00:44:58 -05001# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10# See the License for the specific language governing permissions and
11# limitations under the License.
12
13*** Settings ***
14Documentation [LCMOP_01] Cancel an ongoing NS operation
15
16Library OperatingSystem
17Library String
18Library Collections
19Library Process
20Library SSHLibrary
21
22Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
23Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
24Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
25Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot
26Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
27
28Force Tags lcmop_01 cluster_lcmop daily
29
30Suite Teardown Run Keyword And Ignore Error Suite Cleanup
31
32
33*** Variables ***
34# NS and VNF descriptor package folder and ids
35${vnfd_pkg} simple_ee_vnf
36${vnfd_name} simple_ee-vnf
37${nsd_pkg} simple_ee_ns
38${nsd_name} simple_ee-ns
39
40# NS instance name and configuration
41${ns_name} lcmop_01_cancel_operation_basic
42${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43
44
45*** Test Cases ***
46Create VNF Descriptor
47 [Documentation] Create the VNF descriptor
48
49 ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
50 Set Suite Variable ${vnfd_id} ${id}
51
52
53Create NS Descriptor
54 [Documentation] Create the NS descriptor
55
56 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
57
58
59Instantiate Network Service
60 [Documentation] Instantiate the Network service
61
62 ${id}= Instantiate Network Service ${ns_name} ${nsd_name} %{VIM_TARGET} --config '${ns_config}'
63 Set Suite Variable ${ns_id} ${id}
64
65
66Get operation ID
67 [Documentation] Obtain the operation ID of the NS instantiation
68
69 ${id}= Get Operations By Type ${ns_id} instantiate
70 Set Suite Variable ${op_id} ${id}
71
72
73Cancel operation
74 [Documentation] Cancel the ongoing NS instantiation
75
76 Sleep 5s Waiting before cancelling the operation
77 Cancel operation By Id ${op_id}
78
79
80Check that operation is cancelled
81 [Documentation] Check that the operation is succesfully cancelled
82
83 Check For NS Operation Cancelled ${op_id}
84
85
86Delete NS Instance Test
87 [Documentation] Delete the cancelled NS instance
88 [Tags] cleanup
89
90 Delete NS ${ns_name}
91
92
93Delete NS Descriptor Test
94 [Documentation] Delete the NS descriptor
95 [Tags] cleanup
96
97 Delete NSD ${nsd_name}
98
99
100Delete VNF Descriptor Test
101 [Documentation] Delete the VNF descriptor
102 [Tags] cleanup
103
104 Delete VNFD ${vnfd_name}
105
106
107*** Keywords ***
108Suite Cleanup
109 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
110
111 Run Keyword If Any Tests Failed Delete NS ${ns_name}
112
113 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
114
115 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}