Skip to content
Snippets Groups Projects
Commit 27e1d4f0 authored by AHMADABB's avatar AHMADABB
Browse files

NS Fault Management Subscriptions Robot test added

parent a12add45
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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}
*** 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
{
"filter": {
"nsInstanceSubscriptionFilter": {
"notificationTypes": [
"AlarmNotification"
]
}
},
"callbackUri": "http://127.0.0.1/subscribe"
}
\ 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