diff --git a/SOL005/NSFaultManagement-API/IndividualAlarm.robot b/SOL005/NSFaultManagement-API/IndividualAlarm.robot index b7db7a345f8ab33a1abbc8ab855c939f03f3f98c..479d648c9446f5afbb1b82a10d2e6aa03b0ba300 100644 --- a/SOL005/NSFaultManagement-API/IndividualAlarm.robot +++ b/SOL005/NSFaultManagement-API/IndividualAlarm.robot @@ -51,7 +51,7 @@ GET information about Invalid Individual Alarm PUT Individual Alarm - Method not implemented [Documentation] Test ID: 8.4.3.3 ... Test title:PUT Individual Alarm - Method not implemented - ... Test objective: The objective is to post alarms + ... Test objective: The objective is to put an individual alarm ... Pre-conditions: ... Reference: section 8.4.3 - SOL005 v2.4.1 ... Config ID: @@ -106,7 +106,7 @@ PATCH Alarm - Precondition failed DELETE Individual Alarm - Method not implemented [Documentation] Test ID: 8.4.3.5 ... Test title:DELETE Individual Alarm - Method not implemented - ... Test objective: The objective is to post alarms + ... Test objective: The objective is to Delete an individual alarms ... Pre-conditions: ... Reference: section 8.4.3 - SOL005 v2.4.1 ... Config ID: diff --git a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot index 9acf153667496285181af65f0bf726cecb8c9fc3..540ade70c06750479d4c26d1f19f3ff6eee60349 100644 --- a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot +++ b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot @@ -14,8 +14,8 @@ Check HTTP Response Status Code Is Log Status code validated Check HTTP Response Header Contains - [Arguments] ${CONTENT_TYPE} - Should Contain ${response[0]['headers']} ${CONTENT_TYPE} + [Arguments] ${HEADER_TOCHECK} + Should Contain ${response[0]['headers']} ${HEADER_TOCHECK} Log Header is present Check HTTP Response Body Json Schema Is @@ -154,5 +154,63 @@ Do PATCH Individual Alarm Conflict Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} - - \ No newline at end of file + +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/fmSubscriptionRequest.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}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +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 + Set Global Variable @{response} ${outputResponse} + + +Do GET Subscriptions with Invalid filter + 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 Subscriptions + log Trying to perform a PUT Subscriptions. 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 + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do PATCH Subscriptions + log Trying to perform a PATCH Subscriptions. 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 + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + +Do DELETE Subscriptions + log Trying to perform a DELETE Subscriptions. 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 + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + + diff --git a/SOL005/NSFaultManagement-API/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..eba0e8141b98ebcaf54665f075eb4876a11ac8be --- /dev/null +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -0,0 +1,134 @@ +*** Settings *** +Resource environment/variables.txt +Resource NSFMOperationKeywords.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: 8.4.4.1 + ... Test title: Create a new alarm subscription + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: no subscription with the same filter and callbackUri exists + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + 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 FmSubscription.schema.json + + +Create a new Subscription - DUPLICATION + [Documentation] Test ID: 8.4.4.1-2 + ... Test title: Create a new alarm subscription - DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: the NFVO allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists + ... Post-Conditions: + Depends On Test Create a new subscription + Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test + 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 FmSubscription.schema.json + +Create a new Subscription - NO-DUPLICATION + [Documentation] Test ID: 8.4.4.1-3 + ... Test title: Create a new alarm 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 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: the NFVO decides to not create a duplicate subscription resource + ... Post-Conditions: + Depends On Test Create a new subscription + Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO permits duplication. Skipping the test + Do POST Subscription + Check HTTP Response Status Code Is 303 + Check HTTP Response Header Contains Location + Check HTTP Response Header ContentType is ${CONTENT_TYPE} + Check HTTP Response Body Json Schema Is FmSubscription.schema.json + +GET Subscriptions + [Documentation] Test ID: 8.4.4.2 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions + ... Pre-conditions: + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do GET Subscriptions + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is FmSubscriptions.schema.json + +GET Subscription - Filter + [Documentation] Test ID: 8.4.4.2-1 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with filter + ... Pre-conditions: + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do GET Subscriptions with filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is FmSubscriptions.schema.json + +GET subscriptions - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 8.4.4.2-2 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters + ... Pre-conditions: + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do GET Subscriptions with Invalid filter + 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 + [Documentation] Test ID: 8.4.4.3 + ... Test title:PUT subscriptions - Method not implemented + ... Test objective: The objective is to PUT subscriptions + ... Pre-conditions: + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do Put Subscriptions + Check HTTP Response Status Code Is 405 + +PATCH subscriptions - Method not implemented + [Documentation] Test ID: 8.4.4.4 + ... Test title:PUT subscriptions - Method not implemented + ... Test objective: The objective is to PATCH subscriptions + ... Pre-conditions: + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do PATCH Subscriptions + Check HTTP Response Status Code Is 405 + +DELETE subscriptions - Method not implemented + [Documentation] Test ID: 8.4.4.5 + ... Test title:DELETE subscriptions - Method not implemented + ... Test objective: The objective is to DELETE subscriptions + ... Pre-conditions: + ... Reference: section 8.4.4 - SOL005 v2.4.1 + ... Config ID: + ... Applicability: + ... Post-Conditions: + Do DELETE Subscriptions + Check HTTP Response Status Code Is 405 \ No newline at end of file diff --git a/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json b/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..c4528b2a543239460e40a621dcedd383c4426499 --- /dev/null +++ b/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json @@ -0,0 +1,10 @@ +{ + "filter": { + "nsInstanceSubscriptionFilter": { + "notificationTypes": [ + "AlarmNotification" + ] + } + }, + "callbackUri": "http://127.0.0.1/subscribe" +} \ No newline at end of file