From b557b65cbea72425ffb254ccc68f42f66a8497be Mon Sep 17 00:00:00 2001 From: Abbas Ahmad Date: Thu, 7 Mar 2019 16:26:07 +0100 Subject: [PATCH] SOL005 Added individual Subscription --- .../IndividualSubscription.robot | 74 +++++++++++++++++++ .../NSFMOperationKeywords.robot | 51 ++++++++++++- .../NSFaultManagement-API/Subscriptions.robot | 6 +- 3 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 SOL005/NSFaultManagement-API/IndividualSubscription.robot diff --git a/SOL005/NSFaultManagement-API/IndividualSubscription.robot b/SOL005/NSFaultManagement-API/IndividualSubscription.robot new file mode 100644 index 00000000..9878321d --- /dev/null +++ b/SOL005/NSFaultManagement-API/IndividualSubscription.robot @@ -0,0 +1,74 @@ +*** Settings *** +Resource environment/variables.txt +Resource NSFMOperationKeywords.robot +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +Documentation This resource represents an individual subscription for NFVO alarms. +... The client can use this resource to read and to terminate a subscription to notifications related to NFVO fault management. +Suite Setup Check Individual Subscription existance + +*** Test Cases *** +Post Individual Subscription - Method not implemented + [Documentation] Test ID: 8.4.5.1 + ... Test title:POST Individual subscription - Method not implemented + ... Test objective: The objective is to POST an individual subscription + ... Pre-conditions: + ... Reference: section 8.4.5 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do POST Individual Subscription + Check HTTP Response Status Code Is 405 + +Get Information about an individual subscription + [Documentation] Test ID: 8.4.5.2 + ... Test title: Retrieve the alarm subscription + ... Test objective: The objective is to read an individual subscription for NFVO alarms subscribed by the client + ... Pre-conditions: The subscription with the given id exists + ... Reference: section 8.4.5 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do GET Individual Subscription + Check HTTP Response Status Code Is 200 + Check HTTP Response Header ContentType is ${CONTENT_TYPE} + Check HTTP Response Body Json Schema Is FmSubscription.schema.json + +PUT an individual subscription - Method not implemented + [Documentation] Test ID: 8.4.5.3 + ... Test title:PUT Individual subscription - Method not implemented + ... Test objective: The objective is to PUT an individual subscription + ... Pre-conditions: + ... Reference: section 8.4.5 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do PUT Individual Subscription + Check HTTP Response Status Code Is 405 + +PATCH an individual subscription - Method not implemented + [Documentation] Test ID: 8.4.5.4 + ... Test title:PATCH Individual subscription - Method not implemented + ... Test objective: The objective is to PATCH an individual subscription + ... Pre-conditions: + ... Reference: section 8.4.5 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do PATCH Individual Subscription + Check HTTP Response Status Code Is 405 + +DELETE an individual subscription + [Documentation] Test ID: 8.4.5.5 + ... Test title:DELETE an individual subscription + ... Test objective: The objective is to DELETE an individual subscription + ... Pre-conditions: Subsbcription already exists + ... Reference: section 8.4.5 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do DELETE Individual Subscription + Check HTTP Response Status Code Is 204 + \ No newline at end of file diff --git a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot index 540ade70..220da8a6 100644 --- a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot +++ b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot @@ -7,6 +7,12 @@ Library OperatingSystem *** Keywords *** +Check Individual Subscription existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Check HTTP Response Status Code Is [Arguments] ${expected_status} Log Validate Status code @@ -177,7 +183,8 @@ Do GET Subscriptions with filter 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}${outputResponse}= Output response + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} + ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} @@ -212,5 +219,45 @@ Do DELETE Subscriptions Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} + +Do POST Individual Subscription + 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}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + + +Do GET Individual Subscription + log Trying to get information about an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + + +Do PUT Individual Subscription + 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}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do PATCH Individual Subscription + 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/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} - +Do DELETE Individual Subscription + log Trying to perform a DELETE. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} diff --git a/SOL005/NSFaultManagement-API/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot index eba0e814..bfb48bf8 100644 --- a/SOL005/NSFaultManagement-API/Subscriptions.robot +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -98,7 +98,7 @@ GET subscriptions - Bad Request Invalid attribute-based filtering parameters Check HTTP Response Body Json Schema Is ProblemDetails.schema.json PUT subscriptions - Method not implemented - [Documentation] Test ID: 8.4.4.3 + [Documentation] Test ID: 8.4.4.3 ... Test title:PUT subscriptions - Method not implemented ... Test objective: The objective is to PUT subscriptions ... Pre-conditions: @@ -110,7 +110,7 @@ PUT subscriptions - Method not implemented Check HTTP Response Status Code Is 405 PATCH subscriptions - Method not implemented - [Documentation] Test ID: 8.4.4.4 + [Documentation] Test ID: 8.4.4.4 ... Test title:PUT subscriptions - Method not implemented ... Test objective: The objective is to PATCH subscriptions ... Pre-conditions: @@ -122,7 +122,7 @@ PATCH subscriptions - Method not implemented Check HTTP Response Status Code Is 405 DELETE subscriptions - Method not implemented - [Documentation] Test ID: 8.4.4.5 + [Documentation] Test ID: 8.4.4.5 ... Test title:DELETE subscriptions - Method not implemented ... Test objective: The objective is to DELETE subscriptions ... Pre-conditions: -- GitLab