Bug 2327 fix to verify ipaddress in sol003_02 testsuite
[osm/tests.git] / robot-systest / testsuite / lcmop_01-cancel_operation_basic.robot
1 *** Comments ***
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
14
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
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
30
31 Test Tags   lcmop_01   cluster_lcmop   daily
32
33 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
34
35
36 *** Variables ***
37 # NS and VNF descriptor package folder and ids
38 ${VNFD_PKG}   simple_ee_vnf
39 ${VNFD_NAME}   simple_ee-vnf
40 ${NSD_PKG}   simple_ee_ns
41 ${NSD_NAME}   simple_ee-ns
42
43 # NS instance name and configuration
44 ${NS_NAME}   lcmop_01_cancel_operation_basic
45 ${NS_CONFIG}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
46
47
48 *** Test Cases ***
49 Create VNF Descriptor
50     [Documentation]   Create the VNF descriptor
51     Create VNFD   '%{PACKAGES_FOLDER}/${VNFD_PKG}'
52
53 Create NS Descriptor
54     [Documentation]   Create the NS descriptor
55     Create NSD   '%{PACKAGES_FOLDER}/${NSD_PKG}'
56
57 Instantiate Network Service
58     [Documentation]   Instantiate the Network service
59     ${id}=   Instantiate Network Service   ${NS_NAME}   ${NSD_NAME}   %{VIM_TARGET}   --config '${NS_CONFIG}'
60     Set Suite Variable   ${NS_ID}   ${id}
61
62 Get Operation ID
63     [Documentation]   Obtain the operation ID of the NS instantiation
64     ${id}=   Get Operations By Type   ${NS_ID}   instantiate
65     Set Suite Variable   ${OP_ID}   ${id}
66
67 Cancel Operation
68     [Documentation]   Cancel the ongoing NS instantiation
69     Sleep   5s   Waiting before cancelling the operation
70     Cancel Operation By Id   ${OP_ID}
71
72 Check That Operation Is Cancelled
73     [Documentation]   Check that the operation is succesfully cancelled
74     Check For NS Operation Cancelled   ${OP_ID}
75
76 Delete NS Instance Test
77     [Documentation]   Delete the cancelled NS instance
78     [Tags]   cleanup
79     Delete NS   ${NS_NAME}
80
81 Delete NS Descriptor Test
82     [Documentation]   Delete the NS descriptor
83     [Tags]   cleanup
84     Delete NSD   ${NSD_NAME}
85
86 Delete VNF Descriptor Test
87     [Documentation]   Delete the VNF descriptor
88     [Tags]   cleanup
89     Delete VNFD   ${VNFD_NAME}
90
91
92 *** Keywords ***
93 Suite Cleanup
94     [Documentation]   Test Suit Cleanup: Deleting Descriptor, instance and vim
95     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}