Commit 8a805049 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added test doc for SOL002 vnf indicators

parent dd795e1a
......@@ -139,7 +139,7 @@ Check HTTP Response Header Contains
Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
Should Contain ${response[0]['headers']['Content-Type']} ${CONTENT_TYPE}
Should Contain ${response[0]['headers']['Content-Type']} application/json
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK
......
......@@ -6,76 +6,189 @@ Library OperatingSystem
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
GET Individual Subscription
GET Individual VNF Indicator Subscription
[Documentation] Test ID: 6.3.2.5.1
... Test title: Get individual subscription to VNF performance indicators
... Test objective: The objective is to test the retrieval of individual VNF performance indicator subscription and perform a JSON schema validation of the returned subscription data structure
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.6.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: none
Get Individual VNF Indicator Subscription
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is VnfIndicatorSubscription
GET Individual VNF Indicator Subscription with invalid resource identifier
[Documentation] Test ID: 6.3.2.5.2
... Test title: Get individual subscription to VNF performance indicators
... Test objective: The objective is to test that the retrieval of individual VNF performance indicator subscription fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response.
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.6.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: none
GET Individual VNF Indicator Subscription with invalid resource identifier
Check HTTP Response Status Code Is 404
Check HTTP Response Body Json Schema Is ProblemDetails
DELETE Individual VNF Indicator Subscription
[Documentation] Test ID: 6.3.2.5.3
... Test title: Delete individual subscription to VNF performance indicators
... Test objective: The objective is to test the deletion of an individual VNF performance indicator subscription.
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.6.3.5 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: The subscription to VNF performance indicators is deleted
Send Delete Request for Individual VNF Indicator Subscription
Check HTTP Response Status Code Is 204
Check Postcondition Individual VNF Indicator Subscription is Deleted
DELETE Individual VNF Indicator Subscription with invalid resource identifier
[Documentation] Test ID: 6.3.2.5.4
... Test title: Delete individual subscription to VNF performance indicators
... Test objective: The objective is to test that the deletion of an individual VNF performance indicator subscription fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response.
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.6.3.5 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: none
Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier
Check HTTP Response Status Code Is 404
Check HTTP Response Body Json Schema Is ProblemDetails
PUT Individual VNF Indicator Subscription - Method not implemented
[Documentation] Test ID 6.3.2.5.5
... Test title: PUT individual VNF indicator subscription - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF performance indicator subscription
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.3 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The individual VNF indicator subscription is not modified by the operation
Send Put Request for Individual VNF Indicator Subscription
Check HTTP Response Status Code Is 405
Check Postcondition VNF individual subscription Unmodified (Implicit)
PATCH Individual VNF Indicator Subscription - Method not implemented
[Documentation] Test ID 6.3.2.5.6
... Test title: PUT individual VNF indicator subscription - Method not implemented
... Test objective: The objective is to test that PATCH method is not allowed to update an individual VNF performance indicator subscription
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.4 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The individual VNF indicator subscription is not modified by the operation
Send Patch Request for Individual VNF Indicator Subscription
Check HTTP Response Status Code Is 405
Check Postcondition VNF individual subscription Unmodified (Implicit)
POST Individual VNF Indicator Subscription - Method not implemented
[Documentation] Test ID 6.3.2.5.7
... Test title: PUT individual VNF indicator subscription - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF performance indicator subscription
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.1 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The individual VNF indicator subscription is not created by the operation
Send Post Request for Individual VNF Indicator Subscription
Check HTTP Response Status Code Is 405
Check Postcondition VNF individual subscription is not created
*** Keywords ***
Get Individual VNF Indicator Subscription
Log Trying to get a given subscription identified by subscriptionId
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
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
Log Trying to validate result with VnfIndicatorSubscription schema
Validate Json VnfIndicatorSubscription.schema.json ${result}
Log Validated VnfIndicatorSubscription schema
GET Subscription - Negative (Not Found)
${output}= Output response
Set Suite Variable @{response} ${output}
GET Individual VNF Indicator Subscription with invalid resource identifier
Log Trying to perform a request on a subscriptionID which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${problemDetails}= Output response body
Log Trying to validate ProblemDetails
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
DELETE Subscription
${output}= Output response
Set Suite Variable @{response} ${output}
Send Delete Request for Individual VNF Indicator Subscription
Log Trying to perform a DELETE on a subscriptionId
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 204
Log Received 204 No Content as expected
${output}= Output response
Set Suite Variable @{response} ${output}
DELETE Subscription - Negative (Not Found)
Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier
Log Trying to perform a DELETE on a subscriptionId which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
Integer response status 404
Log The subscriptionId is not present in database
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
${problemDetails}= Output response body
Log Trying to validate ProblemDetails
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
PUT Subscription - (Method not implemented)
${output}= Output response
Set Suite Variable @{response} ${output}
Send Post Request for Individual VNF Indicator Subscription
Log Trying to create a new subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
${output}= Output response
Set Suite Variable @{response} ${output}
Send Put Request for Individual VNF Indicator Subscription
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}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${origOutput}= Output response
Set Suite Variable @{origResponse} ${origOutput}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
${output}= Output response
Set Suite Variable @{response} ${output}
PATCH Subscription - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Send Patch Request for Individual VNF Indicator Subscription
Log Trying to create a new subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${origOutput}= Output response
Set Suite Variable @{origResponse} ${origOutput}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
${output}= Output response
Set Suite Variable @{response} ${output}
POST Subscription - (Method not implemented)
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}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented 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 Header Contains
[Arguments] ${CONTENT_TYPE}
Log ${response[0]['headers']}
Should Contain ${response[0]['headers']} ${CONTENT_TYPE}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
Should Contain ${response[0]['headers']['Content-Type']} application/json
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK
Check Postcondition Individual VNF Indicator Subscription is Deleted
Log Check Postcondition subscription is deleted
GET Individual VNF Indicator Subscription
Check HTTP Response Status Code Is 404
Check Postcondition VNF individual subscription Unmodified (Implicit)
Log Check Postcondition subscription is not modified
GET Individual VNF Indicator Subscription
Log Check Response matches original subscription
${subscription}= evaluate json.loads('''${response[0]['body']}''') json
Should Be Equal ${origResponse[0]['body']['callbackUri']} ${subscription.callbackUri}
Check Postcondition VNF individual subscription is not created
Log Check Postcondition subscription is not created
GET Individual VNF Indicator Subscription with invalid resource identifier
Check HTTP Response Status Code Is 404
......@@ -82,7 +82,7 @@ DELETE Individual VNF Indicator - Method not implemented
Check HTTP Response Status Code Is 405
Check Postcondition Indicator for VNF instance Exist
*** Keywords ***
*** Keywords ***
Get Individual Indicator for a VNF instance
Log This resource represents a VNF indicator related to a VNF instance.
Set Headers {"Accept": "${ACCEPT_JSON}"}
......
......@@ -7,96 +7,211 @@ Library JSONLibrary
Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
GET Subscription
GET VNF Indicators Subscriptions
[Documentation] Test ID: 6.3.2.4.1
... Test title: Get all subscriptions to VNF performance indicators
... Test objective: The objective is to test the retrieval of all VNF performance indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: none
Get VNF Indicators Subscriptions
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is VnfIndicatorSubscriptions
GET VNF Indicators Subscriptions with attribute-based filter
[Documentation] Test ID: 6.3.2.4.2
... Test title: Get all subscriptions to VNF performance indicators with attribute-based filter
... Test objective: The objective is to test the retrieval of all VNF performance indicators subscriptions using attribute-based filter and perform a JSON schema and content validation of the returned subscriptions data structure
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: none
Get VNF Indicators Subscriptions with filter
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is VnfIndicatorSubscriptions
Check HTTP Response Body Matches Attribute-Based Filter
GET VNF Indicators Subscriptions with invalid attribute-based filter
[Documentation] Test ID: 6.3.2.4.3
... Test title: Get all subscriptions to VNF performance indicators with invalid attribute-based filter
... Test objective: The objective is to test that the retrieval of all VNF performance indicators subscriptions fails when using invalid attribute-based filter. The test also checks the JSON schema of the unsuccessful operation HTTP response.
... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators
... Post-Conditions: none
Get VNF Indicators Subscriptions with invalid filter
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
GET VNF Indicators Subscriptions with invalid resource endpoint
[Documentation] Test ID 6.3.2.4.4
... Test title: Get all subscriptions to VNF performance indicators with invalid resource endpoint
... Test objective: The objective is to test that the retrieval of all VNF performance indicators subscriptions fails when using invalid resource endpoint. The test also checks the JSON schema of the unsuccessful operation HTTP response.
... Pre-conditions: A VNF instance is up and running. At least one VNF indicator subscription is available in the VNF.
... Reference: section 8.4.5.3.2 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: none
Get VNF Indicators Subscriptions with invalid resource endpoint
Check HTTP Response Status Code Is 404
Check HTTP Response Body Json Schema Is ProblemDetails
POST VNF Indicator Subscription
[Documentation] Test ID 6.3.2.4.5
... Test title: Create a new VNF performance indicator subscription
... Test objective: The objective is to test the creation of a new VNF performance indicator subscription perform a JSON schema and content validation of the returned subscriptions data structure
... Pre-conditions: A VNF instance is up and running
... Reference: section 8.4.5.3.1 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: The VNF indicator subscription is successfully set and it matches the issued subscription
Send Post Request for VNF Indicator Subscription
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is VnfIndicatorSubscription
Check HTTP Response Body Matches the Subscription
Check Postcondition VNF Performance Indicator Subscription Is Set
PUT VNF Indicator Subscriptions - Method not implemented
[Documentation] Test ID 6.3.2.4.6
... Test title: PUT VNF indicator subscriptions - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to modify VNF performance indicator subscriptions
... Pre-conditions: A VNF instance is instantiated.
... Reference: section 8.4.5.3.3 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: none
Send Put Request for VNF Indicator Subscriptions
Check HTTP Response Status Code Is 405
PATCH VNF Indicator Subscriptions - Method not implemented
[Documentation] Test ID 6.3.2.4.7
... Test title: PATCH VNF indicator subscriptions - Method not implemented
... Test objective: The objective is to test that PATCH method is not allowed to update VNF performance indicator subscriptions
... Pre-conditions: A VNF instance is instantiated.
... Reference: section 8.4.5.3.4 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: none
Send Patch Request for VNF Indicator Subscriptions
Check HTTP Response Status Code Is 405
DELETE VNF Indicator Subscriptions - Method not implemented
[Documentation] Test ID 6.3.2.4.8
... Test title: DELETE VNF indicator subscriptions - Method not implemented
... Test objective: The objective is to test that PUT method is not allowed to delete VNF performance indicator subscriptions
... Pre-conditions: A VNF instance is instantiated.
... Reference: section 8.4.5.3.5 - SOL002 v2.4.1
... Config ID: Config_prod_VE
... Applicability: The VNF supports the generation and maintenance of performance indicators.
... Post-Conditions: none
Send Delete Request for VNF Indicator Subscriptions
Check HTTP Response Status Code Is 405
*** Keywords ***
Get VNF Indicators Subscriptions
Log Trying to get the list of subscriptions
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
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
Validate Json VnfIndicatorSubscriptions.schema.json ${result}
Log Validated VnfIndicatorSubscription schema
GET Subscription - Filter
${output}= Output response
Set Suite Variable @{response} ${output}
Get VNF Indicators Subscriptions with filter
Log Trying to get the list of subscriptions using filters
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Received a 200 OK as expected
${result}= Output response body
Validate Json VnfIndicatorSubscriptions.schema.json ${result}
Log Validated VnfIndicatorSubscriptions schema
GET Subscription - Negative Filter
${output}= Output response
Set Suite Variable @{response} ${output}
Get VNF Indicators Subscriptions with invalid filter
Log Trying to get the list of subscriptions using filters with wrong attribute name
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER}
Integer response status 400
Log Received a 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 Subscription - Negative (Not Found)
Log Trying to perform a request on a Uri which doesn't exist
${output}= Output response
Set Suite Variable @{response} ${output}
Get VNF Indicators Subscriptions with invalid resource endpoint
Log Trying to perform a request on a Uri which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscription
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 Subscription
${output}= Output response
Set Suite Variable @{response} ${output}
Send Post Request for VNF Indicator Subscription
Log Trying to create a new subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File jsons/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Integer response status 201
Log Received 201 Created as expected
${headers}= Output response headers
Should Contain ${headers} Location
Log Response has header Location
${result}= Output response body
Validate Json VnfIndicatorSubscription.schema.json ${result}
Log Validation of VnfIndicatorSubscription OK
PUT Subscription - (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
${output}= Output response
Set Suite Variable @{response} ${output}
Send Put Request for VNF Indicator Subscriptions
Log Trying to create a new subscription
${body}= Get File jsons/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
${output}= Output response
Set Suite Variable @{response} ${output}
PATCH Subscription - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Send Patch Request for VNF Indicator Subscriptions
Log Trying to create a new subscription
${body}= Get File jsons/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
${output}= Output response
Set Suite Variable @{response} ${output}
DELETE Subscription - (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Send Delete Request for VNF Indicator Subscriptions
Log Trying to create a new subscription
${body}= Get File jsons/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
${output}= Output response
Set Suite Variable @{response} ${output}
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 Header Contains
[Arguments] ${CONTENT_TYPE}
Log ${response[0]['headers']}
Should Contain ${response[0]['headers']} ${CONTENT_TYPE}
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${schema}
Should Contain ${response[0]['headers']['Content-Type']} application/json
Validate Json ${schema} ${response[0]['body']}
Log Json Schema Validation OK
Check HTTP Response Body Matches the Subscription
Log Check Response matches subscription
${body}= Get File jsons/subscriptions.json
${subscription}= evaluate json.loads('''${body}''') json
Should Be Equal ${response[0]['body']['callbackUri']} ${subscription.callbackUri}
Check Postcondition VNF Performance Indicator Subscription Is Set
Log Check Postcondition subscription exist
Log Trying to get the subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response[0]['body']['id']}
${output}= Output response
Set Suite Variable @{response} ${output}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Matches Attribute-Based Filter
Log Check Response includes VNF Indicators according to filter
#todo
*** Variables ***
${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586
${erroneousSubscriptionId} 442e3ee5-0499-4849-9b31-eb91ce1638f1 # Not existing ID on the subscriptions
@{response}= httpresponse
@{origResponse}= httpresponse
\ No newline at end of file
......@@ -4,3 +4,4 @@ ${indicatorId} 34e70855-a9d3-4fef-aece-76a3cd266ec8
${erroneousIndicatorId} erroneousIndicatorId
${POS_FILTER} callbackUri=http://127.0.0.1/subscribe
${NEG_FILTER} callback=http://127.0.0.1/subscribe
@{response}= httpresponse
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment