IndividualVNFInstance.robot 6.39 KB
Newer Older
1
*** Settings ***
2
Resource    environment/configuration.txt
aureliano sinatra's avatar
aureliano sinatra committed
3
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
4
Resource    environment/variables.txt 
aureliano sinatra's avatar
aureliano sinatra committed
5
6
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}  
Resource    VnfLcmMntOperationKeywords.robot
mengxuan.zhao's avatar
mengxuan.zhao committed
7
Library    OperatingSystem
8
9
10
Library    DependencyLibrary
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
mengxuan.zhao's avatar
mengxuan.zhao committed
11

12
*** Variables ***
13
${original_etag}    1234
14
15
16

*** Test Cases ***
Post Individual VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
17
18
19
20
    [Documentation]    Test ID: 7.3.1.2.1
    ...    Test title: Post Individual VNFInstance - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
aureliano sinatra's avatar
aureliano sinatra committed
21
    ...    Reference: section 5.4.3.3.1 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
22
23
24
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
aureliano sinatra's avatar
aureliano sinatra committed
25
    POST individual vnfInstance
aureliano sinatra's avatar
aureliano sinatra committed
26
	Check HTTP Response Status Code Is    405
27
28

Get Information about an individual VNF Instance
aureliano sinatra's avatar
aureliano sinatra committed
29
30
31
32
     [Documentation]    Test ID: 7.3.1.2.2
    ...    Test title: Get Information about an individual VNF Instance
    ...    Test objective: The objective is to create a new VNF instance resource
    ...    Pre-conditions: none
aureliano sinatra's avatar
aureliano sinatra committed
33
    ...    Reference: section 5.4.3.3.2 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
34
35
36
37
38
39
40
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    GET individual vnfInstance
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    vnfInstance
    SET etag
41
    
mengxuan.zhao's avatar
mengxuan.zhao committed
42
PUT Individual VNFInstance - Method not implemented 
aureliano sinatra's avatar
aureliano sinatra committed
43
44
45
46
    [Documentation]    Test ID: 7.3.1.2.3
    ...    Test title: PUT Individual VNFInstance - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
aureliano sinatra's avatar
aureliano sinatra committed
47
    ...    Reference: section 5.4.3.3.3 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
48
49
50
51
52
53
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    PUT individual vnfInstance
    Check HTTP Response Status Code Is    405
    
54
PATCH Individual VNFInstance
aureliano sinatra's avatar
aureliano sinatra committed
55
56
57
     [Documentation]    Test ID: 7.3.1.2.4
    ...    Test title: PATCH Individual VNFInstance
    ...    Test objective: This method modifies an individual VNF instance resource
aureliano sinatra's avatar
aureliano sinatra committed
58
59
    ...    Pre-conditions: the VNF instance resource is existing
    ...    Reference: section 5.4.3.3.4 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
60
61
62
63
64
65
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    PATCH individual vnfInstance
    Check HTTP Response Status Code Is    202
    Check Operation Occurrence Id
66

67
PATCH Individual VNFInstance Precondition failed
aureliano sinatra's avatar
aureliano sinatra committed
68
69
70
71
     [Documentation]    Test ID: 7.3.1.2.5
    ...    Test title: PATCH Individual VNFInstance Precondition failed
    ...    Test objective: The objective is to create a new VNF instance resource
    ...    Pre-conditions:  A precondition given in an HTTP request header is not fulfilled. Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity
aureliano sinatra's avatar
aureliano sinatra committed
72
    ...    Reference: section 5.4.3.3.4 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
73
74
75
76
77
78
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    PATCH individual vnfInstance
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is    ProblemDetails
79

80
PATCH Individual VNFInstance Conflict
aureliano sinatra's avatar
aureliano sinatra committed
81
82
83
84
     [Documentation]    Test ID: 7.3.1.2.6
    ...    Test title: PATCH Individual VNFInstance Precondition failed
    ...    Test objective: The objective is to create a new VNF instance resource
    ...    Pre-conditions: none
aureliano sinatra's avatar
aureliano sinatra committed
85
    ...    Reference: section 5.4.3.3.4 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
86
87
88
89
90
91
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    PATCH individual vnfInstance
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
Elian Kraja's avatar
Elian Kraja committed
92
    #[Teardown]    #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished
93
94

DELETE Individual VNFInstance
aureliano sinatra's avatar
aureliano sinatra committed
95
96
97
     [Documentation]    Test ID: 7.3.1.2.7
    ...    Test title: DELETE Individual VNFInstance
    ...    Test objective: The objective is to delete a VNF instance
aureliano sinatra's avatar
aureliano sinatra committed
98
99
    ...    Pre-conditions: the VNF instance resource is existing
    ...    Reference: section 5.4.3.3.5 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
100
101
102
103
104
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    DELETE individual vnfInstance
    Check HTTP Response Status Code Is    204
105
106

DELETE Individual VNFInstance Conflict
aureliano sinatra's avatar
aureliano sinatra committed
107
108
109
110
     [Documentation]    Test ID: 7.3.1.2.8
    ...    Test title: DELETE Individual VNFInstance
    ...    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 INSTANTIATED state
aureliano sinatra's avatar
aureliano sinatra committed
111
    ...    Reference: section 5.4.3.3.5 - SOL003 v2.4.1
aureliano sinatra's avatar
aureliano sinatra committed
112
113
114
115
116
117
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions: 
    DELETE individual vnfInstance
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
118
    
Elian Kraja's avatar
Elian Kraja committed
119
*** Keywords ***
mengxuan.zhao's avatar
mengxuan.zhao committed
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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 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    INSTANTIATED

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
138
    ${body}=    Get File    jsons/scaleVnfToLevelRequest.json
mengxuan.zhao's avatar
mengxuan.zhao committed
139
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level    ${body}
mengxuan.zhao's avatar
mengxuan.zhao committed
140
    Integer    response status    202
aureliano sinatra's avatar
aureliano sinatra committed
141
142
143
SET etag
    ${etag}    Output    response headers ETag
    Set Suite Variable    ${original_etag}    ${etag}