CancelOperationTask.robot 5.52 KB
Newer Older
1
*** Settings ***
2
3
Resource    environment/configuration.txt
Resource    environment/variables.txt
aureliano sinatra's avatar
aureliano sinatra committed
4
Resource    VnfLcmMntOperationKeywords.robot
5
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
6
Library    DependencyLibrary
7
8
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
9
10

*** Test Cases ***
aureliano sinatra's avatar
aureliano sinatra committed
11
12
13
Post Cancel operation task
    [Documentation]    Test ID: 7.3.1.16.1
    ...    Test title: POST Cancel operation task
aureliano sinatra's avatar
aureliano sinatra committed
14
15
    ...    Test objective: The POST method initiates cancelling an ongoing VNF lifecycle operation while it is being executed or rolled back, i.e. the "VNF LCM operation occurrence" is either in "PROCESSING" or "ROLLING_BACK" state.
    ...    Pre-conditions: the "VNF LCM operation occurrence" is either in "PROCESSING" or "ROLLING_BACK" state.
aureliano sinatra's avatar
aureliano sinatra committed
16
17
18
    ...    Reference:  section 5.4.17.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
19
    ...    Post-Conditions: VNF instance status equal to FAILED_TEMP     
aureliano sinatra's avatar
aureliano sinatra committed
20
21
    POST Cancel operation task
    Check HTTP Response Status Code Is    202
22
    Check operation resource state is FAILED_TEMP
aureliano sinatra's avatar
aureliano sinatra committed
23
    
mengxuan.zhao's avatar
mengxuan.zhao committed
24
Post Cancel operation task Conflict
aureliano sinatra's avatar
aureliano sinatra committed
25
26
27
28
29
30
31
    [Documentation]    Test ID: 7.3.1.16.2
    ...    Test title: POST Cancel operation task
    ...    Test objective: The POST method is NOT cancelling an ongoing VNF lifecycle operation due to the fact that the VNF instance resource is not in STARTING, PROCESSING or ROLLING_BACK state
    ...    Pre-conditions: operation is not in STARTING, PROCESSING or ROLLING_BACK state
    ...    Reference:  section 5.4.17.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
32
    ...    Post-Conditions: none
aureliano sinatra's avatar
aureliano sinatra committed
33
34
35
    POST Cancel operation task
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
36

mengxuan.zhao's avatar
mengxuan.zhao committed
37
Post Cancel operation task Not Found
38
    # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
39
40
     [Documentation]    Test ID: 7.3.1.16.2
    ...    Test title: POST Cancel operation task
aureliano sinatra's avatar
aureliano sinatra committed
41
    ...    Test objective: The objective is to test that POST method cannot cancel a VNF lifecycle operation because the resource is not found
42
43
44
45
    ...    Pre-conditions: 
    ...    Reference:  section 5.4.17.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
46
    ...    Post-Conditions: none
aureliano sinatra's avatar
aureliano sinatra committed
47
    POST Cancel operation task
48
    Check HTTP Response Status Code Is    404
aureliano sinatra's avatar
aureliano sinatra committed
49
    
mengxuan.zhao's avatar
mengxuan.zhao committed
50
GET Cancel operation task - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
51
52
53
54
55
56
57
58
59
60
    [Documentation]    Test ID: 7.3.1.16.3
    ...    Test title: GET Cancel operation task - Method not implemented
    ...    Test objective: The objective is to test that GET method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.17.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    GET Cancel operation task
	Check HTTP Response Status Code Is    405
61

mengxuan.zhao's avatar
mengxuan.zhao committed
62
PUT Cancel operation task - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
63
64
65
66
67
68
69
70
71
72
    [Documentation]    Test ID: 7.3.1.16.3
    ...    Test title: PUT Cancel operation task - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.17.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT Cancel operation task
	Check HTTP Response Status Code Is    405
73

mengxuan.zhao's avatar
mengxuan.zhao committed
74
PATCH Cancel operation task - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
75
76
77
78
79
80
81
82
83
84
    [Documentation]    Test ID: 7.3.1.16.4
    ...    Test title: PATCH Cancel operation task - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.17.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    PATCH Cancel operation task
	Check HTTP Response Status Code Is    405
85
    
mengxuan.zhao's avatar
mengxuan.zhao committed
86
DELETE Cancel operation task - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
87
88
89
90
91
92
93
94
95
96
    [Documentation]    Test ID: 7.3.1.16.5
    ...    Test title: DELETE Cancel operation task - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.17.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    DELETE Cancel operation task
	Check HTTP Response Status Code Is    405
97

98
*** Keywords ***
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
    Integer    response status    200

Launch another error handling action
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry
    Integer    response status    202
    
Check Fail not supported
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
113
114
115
116
117
118
    # how to check if Fail is not supported?

Check resource FAILED_TEMP
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} 
    String    response body operationState    FAILED_TEMP