Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
*** Settings ***
Documentation This resource represents subscriptions. The client can use this resource to subscribe to notifications related to VNF
... performance management and to query its subscriptions.
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
Library OperatingSystem
Library JSONLibrary
Resource environment/subscriptions.txt
*** Test Cases ***
GET Subscription
[Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications
... subscribed by the client.
... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PmSubscriptions.schema.json ${json}
Log Validated PmSubscription schema
GET Subscription - Filter
[Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications
... subscribed by the client.
... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok}
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PmSubscriptions.schema.json ${json}
Log Validated PmSubscription schema
GET Subscription - Negative Filter (Erroneous filter)
[Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications
... subscribed by the client.
... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ko}
Integer response status 400
Log Received a 400 Bad Request as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validated ProblemDetails schema
GET Subscription - Negative (Not Found)
[Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications
... subscribed by the client.
... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscription
Integer response status 404
Log Received a 404 Not found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validated ProblemDetails schema
POST Subscription
[Documentation] The POST method creates a new subscription.
... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters,
... request and response data structures, and response codes.
... Creation of two subscription resources with the same callbackURI and the same filter can result in performance
... degradation and will provide duplicates of notifications to the EM or VNF, and might make sense only in very rare use
... cases. Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with
... the same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may
... decide to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code
... referencing the existing subscription resource with the same filter and callbackUri).
Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
${body_request}= Get File jsons/subscriptions.json
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request}
Integer response status 201
Log Received a 201 Created as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PmSubscriptions.schema.json ${json}
Log Validated PmSubscription schema
Log Trying to validate the Location header
${headers}= Output response headers
Should Contain ${headers} Location
POST Subscription - DUPLICATION
[Documentation] The POST method creates a new subscription.
... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters,
... request and response data structures, and response codes.
... Creation of two subscription resources with the same callbackURI and the same filter can result in performance
... degradation and will provide duplicates of notifications to the EM or VNF, and might make sense only in very rare use
... cases. Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with
... the same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may
... decide to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code
... referencing the existing subscription resource with the same filter and callbackUri).
Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM is permitting duplication. Skipping the test
Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
${body_request}= Get File jsons/subscriptions.json
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request}
Integer response status 303
Log Received a 303 See other as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
Should Be Empty ${result}
Log Body is empty
Log Trying to validate the Location header
${headers}= Output response headers
Should Contain ${headers} Location
POST Subscription - NO DUPLICATION
[Documentation] The POST method creates a new subscription.
... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters,
... request and response data structures, and response codes.
... Creation of two subscription resources with the same callbackURI and the same filter can result in performance
... degradation and will provide duplicates of notifications to the EM or VNF, and might make sense only in very rare use
... cases. Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with
... the same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may
... decide to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code
... referencing the existing subscription resource with the same filter and callbackUri).
Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test
Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Set headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"}
${body_request}= Get File jsons/subscriptions.json
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request}
Integer response status 201
Log Received a 201 Created as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PmSubscriptions.schema.json ${json}
Log Validated PmSubscription schema
Log Trying to validate the Location header
${headers}= Output response headers
Should Contain ${headers} Location
PUT Subscription - (Method not implemented)
[Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
... Not Allowed" response as defined in clause 4.3.5.4.
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
PATCH Subscription - (Method not implemented)
[Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
... Not Allowed" response as defined in clause 4.3.5.4.
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
DELETE Subscription - (Method not implemented)
[Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
... Not Allowed" response as defined in clause 4.3.5.4.
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected