1 # 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
5 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 Documentation [LCMOP_01] Cancel an ongoing NS operation
16 Library OperatingSystem
22 Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
23 Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
24 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
25 Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot
26 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
28 Force Tags lcmop_01 cluster_lcmop daily
30 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
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
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}} ] }
47 [Documentation] Create the VNF descriptor
49 ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
50 Set Suite Variable ${vnfd_id} ${id}
54 [Documentation] Create the NS descriptor
56 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
59 Instantiate Network Service
60 [Documentation] Instantiate the Network service
62 ${id}= Instantiate Network Service ${ns_name} ${nsd_name} %{VIM_TARGET} --config '${ns_config}'
63 Set Suite Variable ${ns_id} ${id}
67 [Documentation] Obtain the operation ID of the NS instantiation
69 ${id}= Get Operations By Type ${ns_id} instantiate
70 Set Suite Variable ${op_id} ${id}
74 [Documentation] Cancel the ongoing NS instantiation
76 Sleep 5s Waiting before cancelling the operation
77 Cancel operation By Id ${op_id}
80 Check that operation is cancelled
81 [Documentation] Check that the operation is succesfully cancelled
83 Check For NS Operation Cancelled ${op_id}
86 Delete NS Instance Test
87 [Documentation] Delete the cancelled NS instance
93 Delete NS Descriptor Test
94 [Documentation] Delete the NS descriptor
97 Delete NSD ${nsd_name}
100 Delete VNF Descriptor Test
101 [Documentation] Delete the VNF descriptor
104 Delete VNFD ${vnfd_name}
109 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
111 Run Keyword If Any Tests Failed Delete NS ${ns_name}
113 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
115 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}