"SOL002/git@forge.etsi.org:nfv/api-tests.git" did not exist on "191e0cb43fa686e65a3ffb4f382e7dfb778efcba"
Newer
Older
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Library OperatingSystem
Resource environment/pmJobs.txt
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
*** Test Cases ***
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
GET all VNF Performance Monitoring Jobs
[Documentation] Test ID: 6.3.3.1.1
... Test title: GET all VNF Performance Monitoring Jobs
... Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET all VNF Performance Monitoring Jobs
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body Does Not Contain reports
GET VNF Performance Monitoring Jobs with attribute-based filter
[Documentation] Test ID: 6.3.3.1.2
... Test title: GET all VNF Performance Monitoring Jobs with attribute-based filter
... Test objective: The objective is to test the retrieval of VNF performance monitoring jobs using attribute-based filter, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued attribute-based filter
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with attribute-based filter
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body Matches filter
GET all VNF Performance Monitoring Jobs with all_fields attribute selector
[Documentation] Test ID: 6.3.3.1.3
... Test title: GET all VNF Performance Monitoring Jobs with all_fields attribute selector
... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs all_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued all_fileds selector
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with all_fields attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body Matches all_fields selector
GET all VNF Performance Monitoring Jobs with exclude_default attribute selector
[Documentation] Test ID: 6.3.3.1.4
... Test title: GET all VNF Performance Monitoring Jobs with exclude_default attribute selector
... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_default attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_default selector
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with exclude_default attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body Matches exclude_default selector
GET all VNF Performance Monitoring Jobs with fields attribute selector
[Documentation] Test ID: 6.3.3.1.5
... Test title: GET all VNF Performance Monitoring Jobs with fields attribute selector
... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued fields selector
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: The VNFM supports the use of exclude_fields attribute selector
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with fields attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body Matches fields selector
GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector
[Documentation] Test ID: 6.3.3.1.6
... Test title: GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector
... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_fields selector
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: The VNFM supports the use of exclude_fields attribute selector
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with exclude_fields attribute selector
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body Matches exclude_fields selector
GET VNF Performance Monitoring Jobs with invalid attribute-based filter
[Documentation] Test ID: 6.3.3.1.7
... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter
... Test objective: The objective is to test that the retrieval of VNF 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 VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with invalid attribute-based filter
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
GET VNF Performance Monitoring Jobs with invalid resource endpoint
[Documentation] Test ID: 6.3.3.1.8
... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter
... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid resource endpoint, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
GET VNF Performance Monitoring Jobs with invalid resource endpoint
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
Create new VNF Performance Monitoring Job
... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter
... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid resource endpoint, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.1 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: The VNF Performance Job is successfully created on the VNFM
Send Post Request Create new VNF Performance Monitoring Job
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is PmJob
Check Postcondition PmJob Exists
PUT all VNF Performance Monitoring Jobs - Method not implemented
... Test title: PUT all VNF Performance Monitoring Jobs - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify VNF Performance Monitoring Jobs
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.3 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Send PUT Request for all VNF Performance Monitoring Jobs
Check HTTP Response Status Code Is 405
PATCH all VNF Performance Monitoring Jobs - (Method not implemented)
... Test title: PATCH all VNF Performance Monitoring Jobs - Method not implemented
... Test objective: The objective is to test that PATCH method is not allowed to update VNF Performance Monitoring Jobs
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.3 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Send PATCH Request for all VNF Performance Monitoring Jobs
Check HTTP Response Status Code Is 405
DELETE all VNF Performance Monitoring Jobs - Method not implemented
... Test title: DELETE all VNF Performance Monitoring Jobs - Method not implemented
... Test objective: The objective is to test that DELETE method is not allowed to update VNF Performance Monitoring Jobs
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
... Reference: section 6.4.2.3.3 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
Send PATCH Request for all VNF Performance Monitoring Jobs
Check HTTP Response Status Code Is 405
Check Postcondition VNF Performance Monitoring Jobs Exist
*** Keywords ***
GET all VNF Performance Monitoring Jobs
Log Trying to get all PM Jobs present in the VNFM
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with attribute-based filter
Log Trying to get all PM Jobs present in the VNFM, using filter params
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${POS_FILTER}
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with all_fields attribute selector
Log Trying to get all PM Jobs present in the VNFM, using 'all_fields' filter
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?all_fields
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with exclude_default attribute selector
Log Trying to get all VNF Packages present in the VNFM, using filter params
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?exclude_default
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with fields attribute selector
Log Trying to get all VNF Packages present in the VNFM, using filter params
Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields'
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with exclude_fields attribute selector
Log Trying to get all VNF Packages present in the VNFM, using filter params
Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields'
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with invalid attribute-based filter
Log Trying to get all PM Jobs present in the VNFM, using an erroneous filter param
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${NEG_FILTER}
${output}= Output response
Set Suite Variable @{response} ${output}
GET VNF Performance Monitoring Jobs with invalid resource endpoint
Log Trying to perform a GET on a erroneous URI
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pm_job # wrong URI /pm_job instead of /pm_jobs
${output}= Output response
Set Suite Variable @{response} ${output}
Send Post Request Create new VNF 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}/${apiVersion}/pm_jobs ${body}
${output}= Output response
Set Suite Variable @{response} ${output}
Send PUT Request for all VNF 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}/${apiVersion}/pm_jobs
${output}= Output response
Set Suite Variable @{response} ${output}
Send PATCH Request for all VNF 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}/${apiVersion}/pm_jobs
${output}= Output response
Set Suite Variable @{response} ${output}
Send DELETE Request for all VNF 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}/${apiVersion}/pm_jobs
${output}= Output response
Set Suite Variable @{response} ${output}
Check Postcondition VNF Performance Monitoring Jobs Exist
Log Checking that Pm Job still exists
GET all VNF Performance Monitoring Jobs
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}"}
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${response[0]['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 Body Matches exclude_fields selector
Log Checking that reports element is missing
${reports}= Get Value From Json ${response[0]['body']} $..reports
Should Be Empty ${reports}
Log Checking that reports element is missing
${criteria}= Get Value From Json ${response[0]['body']} $..criteria
Should Be Empty ${criteria}
Log Reports element is empty as expected
Check HTTP Response Body Matches fields selector
Log Trying to validate criteria schema
${criteria}= Get Value From Json ${response[0]['body']} $..criteria
Validate Json criteria.schema.json ${criteria[0]}
Log Validation for criteria schema OK
Log Trying to validate criteria schema
${reports}= Get Value From Json ${response[0]['body']} $..reports
Validate Json reports.schema.json ${reports[0]}
Log Validation for reports schema OK
Check HTTP Response Body Matches exclude_default selector
Log Checking that reports element is missing
${reports}= Get Value From Json ${response[0]['body']} $..reports
Should Be Empty ${reports}
Log Reports element is empty as expected
Check HTTP Response Body Matches all_fields selector
Log Trying to validate criteria schema
${criteria}= Get Value From Json ${response[0]['body']} $..criteria
Validate Json criteria.schema.json ${criteria[0]}
Log Validation for criteria schema OK
Log Trying to validate criteria schema
${reports}= Get Value From Json ${response[0]['body']} $..reports
Validate Json reports.schema.json ${reports[0]}
Log Validation for reports schema OK
Log Validating _links schema
${links}= Get Value From Json ${response[0]['body']} $.._links
Validate Json links.schema.json ${links[0]}
Log Validation for _links schema OK
Check HTTP Response Body Matches filter
Log Checking that attribute-based filter is matched
#todo
Check HTTP Response Body Does Not Contain reports
Log Checking that field element is missing
${reports}= Get Value From Json ${response[0]['body']} $..reports
Should Be Empty ${reports}
Log Reports element is empty as expected
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
${status}= Convert To Integer ${expected_status}
Should Be Equal ${response[0]['status']} ${status}
Log Status code validated
Check HTTP Response Status Code Is 40x
Should Contain Any ${response[0]['status']} 401 403
Log Status code validated
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response[0]['headers']} ${CONTENT_TYPE}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Should Contain ${response[0]['headers']['Content-Type']} application/json
${schema} = Catenate ${input} .schema.json
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK