Skip to content
Snippets Groups Projects
Commit a2c59eaf authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added documentation to SOL002 VNFConf and VNFInd

parent d8da033d
No related branches found
No related tags found
1 merge request!4Master
......@@ -6,79 +6,108 @@ Library JSONSchemaLibrary schemas/
Library OperatingSystem
Library DependencyLibrary
*** Variables ***
${response}= httpresponse
*** Test Cases ***
POST Configuration - Method not implemented
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/configuration
Log Validate Status code
Integer response status 405
Set new VNF Configuration
[Documentation] Test ID: 6.3.1
... Test title: Set a new VNF Configuration
... Test objective: The objective is to test the creation of a new VNF configuration
... Pre-conditions: A VNF instance is up and running
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Post-Conditions: The VNF configuration is set
Send VNF configuration
Check HTTP Response Status Code Is 200
Check HTTP Response Header Contains Etag
Check HTTP Response Body Json Schema Is vnfConfigModifications
Check Postcondition VNF Is Configured
Get information about a configuration
[Documentation] Test ID: 9.4.2.2
... Test title: Get information about a configuration
Get information about a VNF configuration
[Tags] no-etag
[Documentation] Test ID: 6.3.2
... Test title: Get information about a VNF configuration
... Test objective: The objective is to test the retrieval of an existing VNF instance configuration
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID: 9.4.2.1)
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID 6.3.1)
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: The VNF configuration is not modified by the operation
Get VNF configuration
Check HTTP Response Status Code Is 200
Check HTTP Response Header Contains Etag
Check HTTP Response Body Json Schema Is vnfConfiguration
Check Postcondition VNF Configuration Untouched
PUT Config - Method not implemented
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/configuration
Log Validate Status code
Integer response status 405
Check Postcondition VNF Configuration Untouched (Implicit)
Set new VNF Configuration
[Documentation] Test ID: 9.4.2.1
... Test title: Set a new VNF Configuration
... Test objective: The objective is to test the creation of a new VNF configuration
... Pre-conditions: A VNF instance is up and running
Get information about a VNF configuration - with HTTP Etag
[Tags] etag
[Documentation] Test ID: 6.3.3
... Test title: Get information about a VNF configuration with HTTP Etag
... Test objective: The objective is to test the retrieval of an existing VNF instance configuration with usage of HTTP Etag
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID 6.3.1)
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Post-Conditions: The VNF configuration is set
Send VNF configuration
... Post-Conditions: The VNF configuration is not modified by the operation
Get VNF configuration
Check HTTP Response Status Code Is 200
Check HTTP Response Header Contains Etag
Check HTTP Response Body Json Schema Is vnfConfiModifications
Check Postcondition VNF Is Configured
Check HTTP Response Body Json Schema Is vnfConfiguration
Check Postcondition VNF Configuration Untouched (Implicit)
Set new VNF Configuration - HTTP Etag precondition failed
[Documentation] Test ID: 9.4.2.3
[Tags] etag
[Documentation] Test ID: 6.3.4
... Test title: Set a new VNF Configuration - HTTP Etag precondition failed
... Test objective: The objective is to test the failure in setting a duplication of VNF configuration identified by an already used HTTP Etag identifier.
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID: 9.4.2.1) with a given HTTP Etag identifier.
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID 6.3.1) with a given HTTP Etag identifier.
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
... Post-Conditions: The VNF configuration is not modified by the operation
Send Duplicated VNF configuration
Check HTTP Response Status Code Is 412
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Configuration Untouched
Check Postcondition VNF Configuration Untouched (Implicit)
DELETE Config - Method not implemented
log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/configuration
Log Validate Status code
Integer response status 405
POST VNF Configuration - Method not implemented
[Documentation] Test ID: 6.3.5
... Test title: POST VNF Configuration - Method not implemented
... Test objective: The objective is to test that POST method is not allowed to create a new VNF configuration
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID 6.3.1)
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: The VNF configuration is not modified by the operation
Send POST Request for VNF Configuration
Check HTTP Response Status Code Is 405
Check Postcondition VNF Configuration Untouched (Implicit)
PUT VNF Configuration - Method not implemented
[Documentation] Test ID: 6.3.6
... Test title: PUT VNF Configuration - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify an existing VNF configuration
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID 6.3.1)
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: The VNF configuration is not modified by the operation
Send PUT Request for VNF Configuration
Check HTTP Response Status Code Is 405
Check Postcondition VNF Configuration Untouched (Implicit)
DELETE VNF Configuration - Method not implemented
[Documentation] Test ID: 6.3.7
... Test title: Delete VNF Configuration - Method not implemented
... Test objective: The objective is to test that DELETE method is not allowed to delete an existing VNF configuration
... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID 6.3.1)
... Reference: section 9.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: The VNF configuration is not modified by the operation
Send DELETE Request for VNF Configuration
Check HTTP Response Status Code Is 405
Check Postcondition VNF Configuration Untouched (Implicit)
*** Keywords ***
*** Keywords ***
Get VNF configuration
Log Query VNF The GET method queries information about a configuration.
Set Headers {"Accept":"${ACCEPT}"}
......@@ -92,21 +121,7 @@ Send VNF configuration
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/vnfConfigModifications.json
${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
PATCH Config - Precondition failed
[Documentation] Precondition Failed
... Precondition Failed 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.
... The response body should contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error.
Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified
log Trying to perform a PATCH. This method modifies an individual alarm resource
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"If-Match": "${Etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/vnfConfigModifications.json
${body}= Get File jsons/vnfConfigModifications.json
${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
Check HTTP Response Status Code Is
......@@ -123,19 +138,20 @@ Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
${contentType}= Get Value From Json ${response.headers} $..Content-Type
Should Be Equal ${contentType} ${CONTENT_TYPE}
Validate Json ${schema} ${response.body}
${json}= evaluate json.loads('''${response.body}''') json
Validate Json ${schema} ${json}
Log Json Schema Validation OK
Check Postcondition VNF Configuration Untouched
Log Check Postcondition for GET
#todo
Check Postcondition VNF Configuration Untouched (Implicit)
Log Check Implicit Postcondition
Check Postcondition VNF Is Configured
Check Postcondition VNF Is Configured
Log Check Postcondition for PATCH
Log Check Postcondition for VNF Configuration
Get VNF configuration
${output}= evaluate json.loads('''${response.body}''') json
${input}= Get File json/vnfConfigModifications.json
Should Be Equal ${output} ${input}
${input}= Get File jsons/vnfConfigModifications.json
Should Be Equal ${output} ${input}
Send Duplicated VNF configuration
Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified
......@@ -144,5 +160,23 @@ Send Duplicated VNF configuration
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"If-Match": "${Etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/vnfConfigModifications.json
${body}= Get File jsons/vnfConfigModifications.json
${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
Send POST Request for VNF Configuration
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration
Send PUT Request for VNF Configuration
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Put ${apiRoot}/${apiName}/${apiVersion}/configuration
Send DELETE Request for VNF Configuration
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Delete ${apiRoot}/${apiName}/${apiVersion}/configuration
\ No newline at end of file
......@@ -7,124 +7,237 @@ Resource environment/vnfIndicators.txt
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
GET all Indicators
[Documentation] The GET method queries multiple VNF indicators.
... This method shall follow the provisions specified in the tables 8.4.2.3.2-1 and 8.4.2.3.2-2 for URI query parameters,
... request and response data structures, and response codes
Get all VNF Indicators
[Documentation] Test ID 6.4.1
... Test title: Get all VNF Indicators
... Test objective: The objective is to test the retrieval of all the available VNF indicators
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Get all VNF indicators
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is vnfIndicators
Check Postcondition VNF Indicators Untouched (Implicit)
Get VNF Indicators with attribute-based filter
[Documentation] Test ID 6.4.2
... Test title: Get VNF Indicators with attribute-based filter
... Test objective: The objective is to test the retrieval of VNF indicators using attribute-based filter
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Get VNF indicators with filter
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is vnfIndicators
Check HTTP Response Body Matches Attribute-Based Filter
Check Postcondition VNF Indicators Untouched (Implicit)
Get all VNF Indicators with invalid attribute-based filter
[Documentation] Test ID 6.4.3
... Test title: Get VNF Indicators with invalid attribute-based filter
... Test objective: The objective is to test that the retrieval of VNF indicators fails using invalid attribute-based filters
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Get VNF indicators with invalid filter
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Indicators Untouched (Implicit)
Get all VNF Indicators with invalid authorization token
[Documentation] Test ID 6.4.4
... Test title: GET all VNF Indicators One or more measures of VNF performance indicators are available in the VNF.
... Test objective: The objective is to test that the retrieval of VNF indicators fails using invalid authorization token
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Get all VNF indicators with invalid authorization token
Check HTTP Response Status Code Is 401
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Indicators Untouched (Implicit)
Get all VNF Indicators without authorization token
[Documentation] Test ID 6.4.5
... Test title: GET all VNF Indicators without authorization bearers
... Test objective: The objective is to test that the retrieval of VNF indicators fails by omitting the authorization token
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Get all VNF indicators without authorization token
Check HTTP Response Status Code Is 401
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Indicators Untouched (Implicit)
Get all VNF Indicators with invalid resource endpoint
[Documentation] Test ID 6.4.6
... Test title: GET all VNF Indicators with invalid resource endpoint
... Test objective: The objective is to test that the retrieval of VNF indicators fails when using invalid resource endpoint
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Get all VNF indicators with invalid resource endpoint
Check HTTP Response Status Code Is 404
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Indicators Untouched (Implicit)
POST all VNF Indicators - Method not implemented
[Documentation] Test ID 6.4.7
... Test title: POST all VNF Indicators - Method not implemented
... Test objective: The objective is to test that POST method is not allowed to create new VNF indicators
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Send POST Request for all VNF indicators
Check HTTP Response Status Code Is 405
Check Postcondition VNF Indicators Untouched (Implicit)
PUT all VNF Indicators - Method not implemented
[Documentation] Test ID 6.4.7
... Test title: PUT all VNF Indicators - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify VNF indicators
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Send PUT Request for all VNF indicators
Check HTTP Response Status Code Is 405
Check Postcondition VNF Indicators Untouched (Implicit)
PATCH all VNF Indicators - Method not implemented
[Documentation] Test ID 6.4.8
... Test title: POST all VNF Indicators - Method not implemented
... Test objective: The objective is to test that PATCH method is not allowed to update VNF indicators
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Send PATCH Request for all VNF indicators
Check HTTP Response Status Code Is 405
Check Postcondition VNF Indicators Untouched (Implicit)
DELETE all VNF Indicators (Method not implemented)
[Documentation] Test ID 6.4.9
... Test title: POST all VNF Indicators - Method not implemented
... Test objective: The objective is to test that DELETE method is not allowed to delete VNF indicators
... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF.
... Reference: section 8.4.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicators are not modified by the operation
Send DELETE Request for all VNF indicators
Check HTTP Response Status Code Is 405
Check Postcondition VNF Indicators Untouched (Implicit)
*** Keywords ***
Get all VNF indicators
Log The GET method queries multiple VNF indicators
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
Validate Json vnfIndicators.schema.json ${result}
Log Validation OK
GET all Indicators - Filter
[Documentation] The GET method queries multiple VNF indicators.
... This method shall follow the provisions specified in the tables 8.4.2.3.2-1 and 8.4.2.3.2-2 for URI query parameters,
... request and response data structures, and response codes
Log Execute Query and validate response
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators
${vnfIndicators}= evaluate json.loads('''${response.body}''') json
Get VNF indicators with filter
Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
Validate Json vnfIndicators.schema.json ${result}
Log Validation OK
GET all Indicators - Negative (wronge filter name)
Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters. Negative case, with erroneous attribute name
Log Execute Query and validate response
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS}
Get VNF indicators with invalid filter
Log The GET method queries multiple VNF indicators using invalid Attribute-based filtering parameters
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS}
Integer response status 400
Log Received 400 Bad Request as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
GET all Indicators - Negative (Unauthorized: Wrong Token)
Log Trying to perform a negative get, using wrong authorization bearer
Log Execute Query and validate response
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS}
Get all VNF indicators with invalid authorization token
Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication
Log The GET method queries multiple VNF indicators using invalid token
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Authorization": "${NEG_AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators
Integer response status 401
Log Received 401 Unauthorized as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
GET all Indicators - Negative (Unauthorized: No Token)
Log Trying to perform a negative get, using wrong authorization bearer
Log Execute Query and validate response
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators
Get all VNF indicators without authorization token
Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication
Log The GET method queries multiple VNF indicators omitting token
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Authorization": "${NEG_AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/indicators
Integer response status 401
Log Received 401 Unauthorized as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
GET all Indicators (Negative: Not found)
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}/indicator
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
POST all Indicators (Method not implemented)
Log Trying to perform a POST (method should not be implemented)
Log Execute Query and validate response
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators
Get all VNF indicators with invalid resource endpoint
Log The GET method queries multiple VNF indicators omitting token
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/indicators
Integer response status 405
Log Received 405 Method not implemented as expected
Log Execute Query and validate response
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicator
PUT all Indicators (Method not implemented)
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}/indicators
Integer response status 405
Log Received 405 Method not implemented as expected
Send POST Request for all VNF indicators
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration
Send PUT Request for all VNF indicators
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}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration
Send PATCH Request for all VNF indicators
log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept":"${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration
Send DELETE Request for all VNF indicators
log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept":"${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration
PATCH all Indicators (Method not implemented)
Log Trying to perform a PATCH. 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}/indicators
Integer response status 405
Log Received 405 Method not implemented as expected
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal ${response.status_code} ${expected_status}
Log Status code validated
DELETE all Indicators (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators
Integer response status 405
Log Received 405 Method not implemented as expected
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] ${schema}
${contentType}= Get Value From Json ${response.headers} $..Content-Type
Should Be Equal ${contentType} ${CONTENT_TYPE_JSON}
${json}= evaluate json.loads('''${response.body}''') json
Validate Json ${schema} ${json}
Log Json Schema Validation OK
Check Postcondition VNF Indicators Untouched (Implicit)
Log Check Implicit Postcondition
${input}= evaluate json.loads('''${vnfIndicators}''') json
Get all VNF indicators
${output}= evaluate json.loads('''${response.body}''') json
Should Be Equal ${output} ${input}
Check HTTP Response Body Matches Attribute-Based Filter
Log Check Response includes VNF Indicators according to filter
#todo
\ No newline at end of file
......@@ -3,6 +3,7 @@ ${PRODUCER_HOST} localhost
${PRODUCER_PORT} 8081
${PRODUCER_SCHEMA} https
${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${NEG_AUTHORIZATION} Bearer negativetoken
${CONTENT_TYPE_JSON} application/json
${EM-VNF_HOST} localhost
${EM-VNF_PORT} 8002
......
*** Variables ***
${POS_FIELDS} name=vnfIndicator&vnfInstanceId=80b0deba-c398-445b-bef0-ac0fe733e3d0
${NEG_FIELDS} wrongName=wrongValue
${response} some_response_object
${vnfIndicators} original_vnf_indicators
......@@ -12,6 +12,6 @@ ${CONTENT_TYPE_JSON} application/json
${ACCEPT_JSON} application/json
${NEG_AUTHORIZATION} Bearer negativetoken
${FIELD_USAGE} 1
${VNFM_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
${VNFM_AUTH_USAGE} 1
${AUTHORIZATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
${AUTH_USAGE} 1
${VNFM_DUPLICATION} 1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment