Newer
Older
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/variables.txt
Resource environment/pmJobs.txt
Library JSONLibrary
Library OperatingSystem
Library REST ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT} ssl_verify=false
Library MockServerLibrary
*** Test Cases ***
... Test title: Create a new NFV-MANO Performance Monitoring Job
... Test objective: The objective is to test the creation of a new NFV-MANO performance monitoring job and perform the JSON schema validation of the returned job data structure
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.1 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: The NFV-MANO Performance Job is successfully created on the NFV-MANO
Send Post Request Create new NFV-MANO Performance Monitoring Job
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is PmJob
Check Postcondition PmJob Exists
GET all NFV-MANO Performance Monitoring Jobs
[Documentation] Test ID: 8.3.2.1.2
... Test title: GET all NFV-MANO Performance Monitoring Jobs
... Test objective: The objective is to test the retrieval of all the available NFV-MANO performance monitoring jobs and perform a JSON schema validation
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
GET all NFV-MANO Performance Monitoring Jobs
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
GET NFV-MANO Performance Monitoring Jobs with attribute-based filter
... Test title: GET all NFV-MANO Performance Monitoring Jobs with attribute-based filter
... Test objective: The objective is to test the retrieval of NFV-MANO performance monitoring jobs using attribute-based filter, perform a JSON schema validation of the collected jobs data structure
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with attribute-based filter
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
GET all NFV-MANO Performance Monitoring Jobs with all_fields attribute selector
... Test title: GET all NFV-MANO Performance Monitoring Jobs with all_fields attribute selector
... Test objective: The objective is to test the retrieval of all NFV-MANO performance monitoring jobs all_fields attribute selector, perform a JSON schema validation of the collected jobs data structure
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with all_fields attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
GET all NFV-MANO Performance Monitoring Jobs with exclude_default attribute selector
... Test title: GET all NFV-MANO Performance Monitoring Jobs with exclude_default attribute selector
... Test objective: The objective is to test the retrieval of all NFV-MANO performance monitoring jobs exclude_default attribute selector, perform a JSON schema validation of the collected jobs data structure
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with exclude_default attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
GET all NFV-MANO Performance Monitoring Jobs with fields attribute selector
... Test title: GET all NFV-MANO Performance Monitoring Jobs with fields attribute selector
... Test objective: The objective is to test the retrieval of all NFV-MANO performance monitoring jobs fields attribute selector, perform a JSON schema validation of the collected jobs data structure
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: The NFV-MANO supports the use of fields attribute selector
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with fields attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
GET all NFV-MANO Performance Monitoring Jobs with exclude_fields attribute selector
... Test title: GET all NFV-MANO Performance Monitoring Jobs with exclude_fields attribute selector
... Test objective: The objective is to test the retrieval of all NFV-MANO performance monitoring jobs exclude_fields attribute selector, perform a JSON schema validation of the collected jobs data structure
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: The NFV-MANO supports the use of exclude_fields attribute selector
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with exclude_fields attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
GET NFV-MANO Performance Monitoring Jobs with invalid attribute-based filter
... Test title: GET NFV-MANO Performance Monitoring Jobs with invalid attribute-based filter
... Test objective: The objective is to test that the retrieval of NFV-MANO performance monitoring jobs fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with invalid attribute-based filter
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
GET NFV-MANO Performance Monitoring Jobs with invalid attribute selector
[Documentation] Test ID: 8.3.2.1.9
... Test title: GET NFV-MANO Performance Monitoring Jobs with invalid resource endpoint
... Test objective: The objective is to test that the retrieval of NFV-MANO performance monitoring jobs fails with invalid attribute selector
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
GET NFV-MANO Performance Monitoring Jobs with invalid attribute selector
Check HTTP Response Status Code Is 400
GET information about multiple Performance Monitoring Jobs to get Paged Response
[Documentation] Test ID: 8.3.2.1.10
... Test title: GET information about multiple Performance Monitoring Jobs to get Paged Response
... Test objective: The objective is to retrieve information about the performance monitoring jobs to get paged response
... Pre-conditions:
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Applicability:
... Post-Conditions:
GET all NFV-MANO Performance Monitoring Jobs
Check HTTP Response Status Code Is 200
Check LINK in Header
GET information about multiple Performance Monitoring Jobs for Bad Request Response too big
[Documentation] Test ID: 8.3.2.1.11
... Test title: GET information about multiple Performance Monitoring Jobs for Bad Request Response too big
... Test objective: The objective is to test that GET method fail retrieving status information about performance monitoring jobs when Response is too big, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions:
... Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability:
... Post-Conditions:
GET all NFV-MANO Performance Monitoring Jobs
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
PUT all NFV-MANO Performance Monitoring Jobs - Method not implemented
... Test title: PUT all NFV-MANO Performance Monitoring Jobs - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify NFV-MANO Performance Monitoring Jobs
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.3 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
Send PUT Request for all NFV-MANO Performance Monitoring Jobs
Check HTTP Response Status Code Is 405
PATCH all NFV-MANO Performance Monitoring Jobs - (Method not implemented)
... Test title: PATCH all NFV-MANO Performance Monitoring Jobs - Method not implemented
... Test objective: The objective is to test that PATCH method is not allowed to update NFV-MANO Performance Monitoring Jobs
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
Send PATCH Request for all NFV-MANO Performance Monitoring Jobs
Check HTTP Response Status Code Is 405
DELETE all NFV-MANO Performance Monitoring Jobs - Method not implemented
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
... Test title: DELETE all NFV-MANO Performance Monitoring Jobs - Method not implemented
... Test objective: The objective is to test that DELETE method is not allowed to update NFV-MANO Performance Monitoring Jobs
... Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
... Reference: clause 6.5.3.3.5 - ETSI GS NFV-SOL 009 [5] V3.3.1
... Config ID: Config_prod_NFV-MANO
... Applicability: none
... Post-Conditions: none
Send DELETE Request for all NFV-MANO Performance Monitoring Jobs
Check HTTP Response Status Code Is 405
Check Postcondition NFV-MANO Performance Monitoring Jobs Exist
*** Keywords ***
GET all NFV-MANO Performance Monitoring Jobs
Log Trying to get all PM Jobs present in the NFV-MANO
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with attribute-based filter
Log Trying to get all PM Jobs present in the NFV-MANO, using filter params
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?${POS_FILTER}
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with all_fields attribute selector
Log Trying to get all PM Jobs present in the NFV-MANO, using 'all_fields' filter
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?all_fields
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with exclude_default attribute selector
Log Trying to get all NFV-MANO Packages present in the NFV-MANO, using filter params
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?exclude_default
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with fields attribute selector
Log Trying to get all NFV-MANO Packages present in the NFV-MANO, using filter params
Pass Execution If ${FIELD_USAGE} == 0 Skipping test as NFV-MANO is not supporting 'fields'
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?fields=${fields}
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with exclude_fields attribute selector
Log Trying to get all NFV-MANO Packages present in the NFV-MANO, using filter params
Pass Execution If ${FIELD_USAGE} == 0 Skipping test as NFV-MANO is not supporting 'fields'
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?fields=${fields}
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with invalid attribute-based filter
Log Trying to get all PM Jobs present in the NFV-MANO, using an erroneous filter param
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?${NEG_FILTER}
${output}= Output response
Set Suite Variable ${response} ${output}
GET NFV-MANO Performance Monitoring Jobs with invalid attribute selector
Log Query VNF The GET method queries information about multiple VNF instances.
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances?fields=wrong_field
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
Send Post Request Create new NFV-MANO Performance Monitoring Job
Log Creating a new PM Job
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File jsons/CreatePmJobRequest.json
POST ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Send PUT Request for all NFV-MANO Performance Monitoring Jobs
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
${output}= Output response
Set Suite Variable ${response} ${output}
Send PATCH Request for all NFV-MANO Performance Monitoring Jobs
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
${output}= Output response
Set Suite Variable ${response} ${output}
Send DELETE Request for all NFV-MANO Performance Monitoring Jobs
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
${output}= Output response
Set Suite Variable ${response} ${output}
Check Postcondition PmJob Exists
Log Checking that Pm Job exists
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${response['body']['id']}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJob
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
${status}= Convert To Integer ${expected_status}
Should Be Equal ${response['status']} ${status}
Log Status code validated
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response['headers']} ${CONTENT_TYPE}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Should Contain ${response['headers']['Content-Type']} application/json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
Check Postcondition NFV-MANO Performance Monitoring Jobs Exist
Log Checking that Pm Job still exists
GET all NFV-MANO Performance Monitoring Jobs
Check LINK in Header
${linkURL}= Get Value From Json ${response['headers']} $..Link
Should Not Be Empty ${linkURL}