ScaleVNFTask.robot 5.76 KB
Newer Older
mengxuan.zhao's avatar
mengxuan.zhao committed
1
*** Settings ***
2
Resource    environment/configuration.txt
3
Resource    environment/variables.txt 
4
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
mengxuan.zhao's avatar
mengxuan.zhao committed
5
Library    OperatingSystem
6
7
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
aureliano sinatra's avatar
aureliano sinatra committed
8
Resource    VnfLcmMntOperationKeywords.robot
Elian Kraja's avatar
Elian Kraja committed
9
Suite Setup    Check resource existance
mengxuan.zhao's avatar
mengxuan.zhao committed
10
11

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

aureliano sinatra's avatar
aureliano sinatra committed
25
POST Scale a vnfInstance Conflict (Not-Instantiated)
26
    # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state
aureliano sinatra's avatar
aureliano sinatra committed
27
28
29
30
31
32
33
34
    [Documentation]    Test ID: 7.3.1.4.2
    ...    Test title: POST Scale a vnfInstance Conflict (Not-Instantiated)
    ...    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.5.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
aureliano sinatra's avatar
aureliano sinatra committed
35
    POST Scale vnfInstance  
aureliano sinatra's avatar
aureliano sinatra committed
36
37
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails 
mengxuan.zhao's avatar
mengxuan.zhao committed
38
    
aureliano sinatra's avatar
aureliano sinatra committed
39
POST Scale a vnfInstance Not Found
mengxuan.zhao's avatar
mengxuan.zhao committed
40
    # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
aureliano sinatra's avatar
aureliano sinatra committed
41
42
43
44
45
46
47
48
     [Documentation]    Test ID: 7.3.1.4.3
    ...    Test title: POST Scale a vnfInstance Not Found
    ...    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:  
    ...    Reference: section 5.4.5.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
aureliano sinatra's avatar
aureliano sinatra committed
49
    POST Scale vnfInstance  
aureliano sinatra's avatar
aureliano sinatra committed
50
51
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails 
mengxuan.zhao's avatar
mengxuan.zhao committed
52
   
mengxuan.zhao's avatar
mengxuan.zhao committed
53
GET Scale VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
54
55
56
57
58
59
60
61
62
63
    [Documentation]    Test ID: 7.3.1.4.4
    ...    Test title: GET Scale VNFInstance - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented
    ...    Pre-conditions:  
    ...    Reference: section 5.4.5.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Scale vnfInstance
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed
64

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

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

101
*** Keywords ***
mengxuan.zhao's avatar
mengxuan.zhao committed
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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
    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} 
    String    response body instantiationState    NOT_INSTANTIATED

Check scale 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/scaleVnfToLevelRequest.json
mengxuan.zhao's avatar
mengxuan.zhao committed
128
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level    ${body}
mengxuan.zhao's avatar
mengxuan.zhao committed
129
    Integer    response status    202