ScaleVNFToLevelTask.robot 5.83 KB
Newer Older
1
*** Settings ***
2
Resource    environment/variables.txt 
aureliano sinatra's avatar
aureliano sinatra committed
3
Resource    VnfLcmOperationKeywords.robot
4
5
6
7
8
9
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/

*** Test Cases ***
aureliano sinatra's avatar
aureliano sinatra committed
10
POST Scale a vnfInstance to level
aureliano sinatra's avatar
aureliano sinatra committed
11
12
13
14
15
16
17
18
19
20
21
    [Documentation]    Test ID: 6.3.5.5.1
    ...    Test title: POST Scale a vnfInstance to level
    ...    Test objective: The objective is to scale a VNF instance to a target level.
    ...    Pre-conditions: none
    ...    Reference: section 5.4.6.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:
    POST Scale vnfInstance to level     
    Check HTTP Response Status Code Is    202
    Check Operation Occurrence Id
22

aureliano sinatra's avatar
aureliano sinatra committed
23
POST Scale a vnfInstance to level Conflict (Not-Instantiated)
24
    # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state
aureliano sinatra's avatar
aureliano sinatra committed
25
    [Documentation]    Test ID: 6.3.5.5.2
aureliano sinatra's avatar
aureliano sinatra committed
26
    ...    Test title: POST Scale a vnfInstance to level Conflict (Not-Instantiated)
aureliano sinatra's avatar
aureliano sinatra committed
27
28
29
30
31
32
33
34
35
    ...    Test objective: The objective is to verify that the operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. 
    ...    Pre-conditions: VNF instance resource is in NOT-INSTANTIATED state
    ...    Reference: section 5.4.6.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:
    POST Scale vnfInstance to level   
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails 
36
37

    
aureliano sinatra's avatar
aureliano sinatra committed
38
POST Scale a vnfInstance Not Found
aureliano sinatra's avatar
aureliano sinatra committed
39
    [Documentation]    Test ID: 6.3.5.5.3
aureliano sinatra's avatar
aureliano sinatra committed
40
    ...    Test title: POST Scale a vnfInstance Not Found
aureliano sinatra's avatar
aureliano sinatra committed
41
42
43
44
45
46
47
48
49
    ...    Test objective: The objective is to verify that the operation cannot be executed , because the VNF instance resource can't be found.
    ...    Pre-conditions: VNF instance resource is in NOT-INSTANTIATED state
    ...    Reference: section 5.4.6.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:
    POST Scale vnfInstance to level    
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails 
50
51
52
   
    
GET Scale to level VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
53
54
55
56
57
58
59
60
61
62
    [Documentation]    Test ID: 6.3.5.5.4
    ...    Test title: GET Scale to level VNFInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented
    ...    Pre-conditions:  
    ...    Reference: section 5.4.6.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Scale vnfInstance to level
    Check HTTP Response Status Code Is    405
63
64

PUT Scale to level VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
65
    [Documentation]    Test ID: 6.3.5.5.5
aureliano sinatra's avatar
aureliano sinatra committed
66
    ...    Test title: PUT Scale to level VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
67
68
69
70
71
72
73
74
    ...    Test objective: The objective is to verify that the method is not implemented
    ...    Pre-conditions:  
    ...    Reference: section 5.4.6.3.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    PUT Scale vnfInstance to level
    Check HTTP Response Status Code Is    405
75
76

PATCH Scale to level VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
77
    [Documentation]    Test ID: 6.3.5.5.6
aureliano sinatra's avatar
aureliano sinatra committed
78
    ...    Test title: PATCH Scale to level VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
79
80
81
82
83
84
85
86
    ...    Test objective: The objective is to verify that the method is not implemented
    ...    Pre-conditions:  
    ...    Reference: section 5.4.6.3.4 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    PATCH Scale vnfInstance to level
    Check HTTP Response Status Code Is    405
87
88
    
DELETE Scale to level VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
89
90
91
92
93
94
95
96
97
98
    [Documentation]    Test ID: 6.3.5.5.7
    ...    Test title: DELETE Scale to level VNFInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented
    ...    Pre-conditions:  
    ...    Reference: section 5.4.6.3.5 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    DELETE Scale vnfInstance to level
    Check HTTP Response Status Code Is    405
99

Elian Kraja's avatar
Elian Kraja committed
100
*** Keywords ***
101
102
103
104
105
106
107
108
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    Integer    response status    200

Check resource not instantiated
109
    [Arguments]    ${instanceId}
110
111
112
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
113
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instanceId} 
114
115
116
117
118
119
120
121
122
123
124
125
126
    String    response body instantiationState    NOT_INSTANTIATED

 Check scale to level not supported
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    Missing    response body instantiatedVnfInfo scaleStatus

Launch another LCM operation
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
Elian Kraja's avatar
Elian Kraja committed
127
    ${body}=    Get File    jsons/scaleVnfRequest.json
128
129
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale    ${body}
    Integer    response status    202