From 2c5d302a354cb6da9ebfe1ce6a7499783727ded3 Mon Sep 17 00:00:00 2001 From: Abbas Ahmad <abbas.ahmad@eglobalmark.com> Date: Tue, 14 May 2019 09:11:26 +0200 Subject: [PATCH] VRQANO robot test description advancements + high level keywords --- .../IndividualSubscription.robot | 18 +- .../NotificationEndpoint.robot | 1 + .../Subscriptions.robot | 196 ++++++++---------- .../VRQANOperationKeywords.robot | 87 +++++++- 4 files changed, 176 insertions(+), 126 deletions(-) diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot index 34da7e49..54d276ea 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot @@ -11,19 +11,19 @@ Suite Setup Check Individual Subscription existance *** Test Cases *** Post Individual Subscription - Method not implemented - [Documentation] Test ID: 7.3.7.1 + [Documentation] Test ID: 7.3.7.2.1 ... Test title: Post Individual Subscription - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create a new individual subscription instance on NFV ... Pre-conditions: A NFV instance is instantiated ... Reference: section 11.4.3.3.1 - SOL003 v2.4.1 - ... Config ID: Config_prod_VE + ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Do Post Individual Subscription Check HTTP Response Status Code Is 405 Get Information about an individual subscription - [Documentation] Test ID: 7.3.7.2 + [Documentation] Test ID: 7.3.7.2.2 ... Test title: Get Information about an individual subscription ... Test objective: The objective is to read an individual subscription subscribed by the client ... Pre-conditions: The subscription with the given id exists @@ -36,36 +36,36 @@ Get Information about an individual subscription Check HTTP Response Body Json Schema Is VrQuotaAvailSubscription.schema.json PUT an individual subscription - Method not implemented - [Documentation] Test ID: 7.3.7.3 + [Documentation] Test ID: 7.3.7.2.3 ... Test title: Put Individual Subscription - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to update a existing individual subscription instance on NFV ... Pre-conditions: A NFV instance is instantiated ... Reference: section 11.4.3.3.3 - SOL003 v2.4.1 - ... Config ID: Config_prod_VE + ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Do Put Individual Subscription Check HTTP Response Status Code Is 405 PATCH an individual subscription - Method not implemented - [Documentation] Test ID: 7.3.7.4 + [Documentation] Test ID: 7.3.7.2.4 ... Test title: Patch Individual Subscription - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to modify a existing individual subscription instance on NFV ... Pre-conditions: A NFV instance is instantiated ... Reference: section 11.4.3.3.4 - SOL003 v2.4.1 - ... Config ID: Config_prod_VE + ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Do Patch Individual Subscription Check HTTP Response Status Code Is 405 DELETE an individual subscription - [Documentation] Test ID: 7.3.7.5 + [Documentation] Test ID: 7.3.7.2.5 ... Test title: Delete an Individual Subscription ... Test objective: The objective is to test that Delete method is allowed to remove a existing individual subscription instance on NFV ... Pre-conditions: The subscription with the given id exists ... Reference: section 11.4.3.3.5 - SOL003 v2.4.1 - ... Config ID: Config_prod_VE + ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Do Delete an individual subscription diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot index 87d69971..470a6691 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot @@ -1,5 +1,6 @@ *** Settings *** Resource environment/variables.txt +Resource VRQANOperationKeywords.robot Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true Library MockServerLibrary diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot index 606de937..fedd477b 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot @@ -1,166 +1,132 @@ *** Settings *** Resource environment/variables.txt +Resource VRQANOperationKeywords.robot Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} Library OperatingSystem Library JSONLibrary Library JSONSchemaLibrary schemas/ + *** Test Cases *** Create a new subscription - [Documentation] Test ID: 11.4.2.1 + [Documentation] Test ID: 7.3.7.1.1 ... Test title: Create a new subscription related to the availability of the virtualised resources quotas ... Test objective: The objective is to create a new subscription. ... Pre-conditions: no subscription with the same filter and callbackUri exists - ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Reference: section 11.4.2.3.1 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - Validate Json VrQuotaAvailSubscription.schema.json ${result} - Log Validation OK + ... Applicability: none + ... Post-Conditions: none + Do Post subscription + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Header ContentType is ${CONTENT_TYPE} + Check HTTP Response Body Json Schema Is VrQuotaAvailSubscription.schema.json + Create a new Subscription - DUPLICATION - [Documentation] Test ID: 11.4.2.2 + [Documentation] Test ID: 7.3.7.1.2 ... Test title: Create a new resource quota subscription - DUPLICATION ... Test objective: The objective is to create a new subscription. ... Pre-conditions: subscription with the same filter and callbackUri exists - ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Reference: section 11.4.2.3.1 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists - ... Post-Conditions: - Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - Validate Json VrQuotaAvailSubscription.schema.json ${result} - Log Validation OK - + ... Post-Conditions: none + Do Post subscription - DUPLICATION + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Header ContentType is ${CONTENT_TYPE} + Check HTTP Response Body Json Schema Is VrQuotaAvailSubscription.schema.json + Create a new Subscription - NO-DUPLICATION - [Documentation] Test ID: 11.4.2.3 + [Documentation] Test ID: 7.3.7.1.3 ... Test title: Create a new resource quota subscription - NO DUPLICATION ... Test objective: The objective is to create a new subscription. ... Pre-conditions: subscription with the same filter and callbackUri exists - ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Reference: section 11.4.2.3.1 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: the VNFM decides to not create a duplicate subscription resource - ... Post-Conditions: - Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 1 VNFM permits duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 303 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK + ... Post-Conditions: none + Do Post subscription - NO-DUPLICATION + Check HTTP Response Status Code Is 303 + Check HTTP Response Header Contains Location GET Subscriptions - [Documentation] Test ID: 11.4.2.4 + [Documentation] Test ID: 7.3.7.1.4 ... Test title: Retrieve a list of resource quota subscriptions ... Test objective: The objective is to retrieve the list of active subscriptions - ... Pre-conditions: - ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Pre-conditions: none + ... Reference: section 11.4.2.3.2 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - Log Get the list of active subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 200 - ${result}= Output response body - Validate Json subscriptions.schema.json ${result} - Log Validation OK + ... Applicability: none + ... Post-Conditions: none + Do Get Subscriptions + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions.schema.json GET Subscription - Filter - [Documentation] Test ID: 11.4.2.5 + [Documentation] Test ID: 7.3.7.1.5 ... Test title: Retrieve a list of resource quota subscriptions ... Test objective: The objective is to retrieve the list of active subscriptions with filter - ... Pre-conditions: - ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Pre-conditions: none + ... Reference: section 11.4.2.3.2 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - Log Get the list of active subscriptions using a filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} - Integer response status 200 - Log Received a 200 OK as expected - ${result}= Output response body - Validate Json VrQuotaAvailSubscriptions.schema.json ${result} - Log Validation OK + ... Applicability: none + ... Post-Conditions: none + Do Get Subscriptions - Filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VrQuotaAvailSubscriptions.schema.json GET subscriptions - Bad Request Invalid attribute-based filtering parameters - [Documentation] Test ID: 11.4.2.5-1 + [Documentation] Test ID: 7.3.7.1.6 ... Test title: Retrieve a list of resource quota subscriptions ... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters - ... Pre-conditions: + ... Pre-conditions: none ... Reference: section 11.4.2 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - Log Get the list of active subscriptions using an invalid filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} - Integer response status 400 - Log Received a 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK + ... Applicability: none + ... Post-Conditions: none + DO Get subscriptions - Bad Request Invalid attribute-based filtering parameters + Check HTTP Response Status Code Is 400 + Check HTTP Response Header ContentType is ${CONTENT_TYPE} + Check HTTP Response Body Json Schema Is ProblemDetails.schema.json PUT subscriptions - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 + [Documentation] Test ID: 7.3.7.1.7 + ... Test title: Put Subscriptions - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to update existing subscriptions instance on NFV + ... Pre-conditions: A NFV instance is instantiated + ... Reference: section 11.4.3.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Do Put subscription + Check HTTP Response Status Code Is 405 PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 + [Documentation] Test ID: 7.3.7.1.8 + ... Test title: Patch Subscriptions - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to modify subscriptions instance on NFV + ... Pre-conditions: A NFV instance is instantiated + ... Reference: section 11.4.3.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Do Patch subscription + Check HTTP Response Status Code Is 405 DELETE subscriptions - 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}/subscriptions - Log Validate Status code - Integer response status 405 + [Documentation] Test ID: 7.3.7.1.9 + ... Test title: Patch Individual Subscription - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to delete subscriptions instance on NFV + ... Pre-conditions: A NFV instance is instantiated + ... Reference: section 11.4.3.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Do Delete subscription + Check HTTP Response Status Code Is 405 \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot index 2080e17e..164b7afc 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot @@ -75,6 +75,89 @@ Do Delete an individual subscription Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} + Set Global Variable @{response} ${outputResponse} + +Do Post subscription + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} - \ No newline at end of file +Do Post subscription - DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do Post subscription - NO-DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 1 VNFM permits duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File jsons/vrQuotaAvailSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do Get Subscriptions + Log Get the list of active subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do Get Subscriptions - Filter + Log Get the list of active subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +DO Get subscriptions - Bad Request Invalid attribute-based filtering parameters + Log Get the list of active subscriptions using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do Put subscription + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do Patch subscription + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do Delete subscription + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} \ No newline at end of file -- GitLab