Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NFV - Network Functions Virtualisation
api-tests
Commits
1d5f607b
Commit
1d5f607b
authored
May 03, 2019
by
AHMADABB
Browse files
SOL003 updates on VRQAN-Api
parent
170eab4b
Changes
3
Hide whitespace changes
Inline
Side-by-side
SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot
View file @
1d5f607b
*** Settings ***
Resource
environment/variables.txt
Resource
environment/variables.txt
Resource
VRQANOperationKeywords.robot
Library
OperatingSystem
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
REST
${NFVO_SCHEMA}
://
${NFVO_HOST}
:
${NFVO_PORT}
Documentation
This resource represents an individual subscription. The client can use this resource to read and to terminate a
...
subscription to notifications related to the availability of the virtualised resources quotas.
Suite Setup
Check
resource
existance
Suite Setup
Check
Individual Subscription
existance
*** Test Cases ***
Post Individual Subscription - Method not implemented
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}
Log
Validate Status code
Integer
response status
405
[
Documentation
]
Test ID: 7.3.7.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
...
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:
11.4.3.1
...
Test title:
R
et
rieve the resource quota
subscription
s
...
Test objective: The objective is to read an individual subscription
for resource quota
subscribed by the client
[
Documentation
]
Test ID:
7.3.7.2
...
Test title:
G
et
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
...
Reference: section 11.4.3 - SOL003 v2.4.1
...
Reference: section 11.4.3
.3.2
- SOL003 v2.4.1
...
Config ID: Config_prod_VNFM
...
Applicability:
...
Post-Conditions:
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}
Log
Validate Status code
Integer
response status
200
${result}
=
Output
response body
Validate Json
VrQuotaAvailSubscription.schema.json
${result}
Log
Validation OK
...
Applicability: none
...
Post-Conditions: none
Do Get individual subscription
Check HTTP Response Status Code Is
200
Check HTTP Response Body Json Schema Is
VrQuotaAvailSubscription.schema.json
PUT an individual subscription - Method not implemented
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}
Log
Validate Status code
Integer
response status
405
[
Documentation
]
Test ID: 7.3.7.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
...
Applicability: none
...
Post-Conditions: none
Do Put Individual Subscription
Check HTTP Response Status Code Is
405
PATCH an individual subscription - Method not implemented
log
Trying to perform a PATCH. 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/
${subscriptionId}
Log
Validate Status code
Integer
response status
405
[
Documentation
]
Test ID: 7.3.7.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
...
Applicability: none
...
Post-Conditions: none
Do Patch Individual Subscription
Check HTTP Response Status Code Is
405
DELETE an individual subscription
log
Try to delete an individual subscription
Set Headers
{"Accept":"
${ACCEPT}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"Authorization":"
${AUTHORIZATION}
"}
Delete
${apiRoot}
/
${apiName}
/
${apiVersion}
/subscriptions/
${subscriptionId}
Log
Validate Status code
Integer
response status
204
*** Keywords ***
Check resource 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
\ No newline at end of file
[
Documentation
]
Test ID: 7.3.7.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
...
Applicability: none
...
Post-Conditions: none
Do Delete an individual subscription
Check HTTP Response Status Code Is
204
\ No newline at end of file
SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot
0 → 100644
View file @
1d5f607b
*** Settings ***
Resource
environment/variables.txt
Library
REST
${NFVO_SCHEMA}
://
${NFVO_HOST}
:
${NFVO_PORT}
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
OperatingSystem
#Suite Teardown Terminate All Processes kill=true
Library
Process
*** 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
Should Be Equal
${response[0]['status']}
${expected_status}
Log
Status code validated
Check HTTP Response Header Contains
[
Arguments
]
${HEADER_TOCHECK}
Should Contain
${response[0]['headers']}
${HEADER_TOCHECK}
Log
Header is present
Check HTTP Response Body Json Schema Is
[
Arguments
]
${schema}
Validate Json
${schema}
${response[0]['body']}
Log
Json Schema Validation OK
Check HTTP Response Header ContentType is
[
Arguments
]
${expected_contentType}
Log
Validate content type
Should Be Equal
${response[0]['headers']['Content-Type']}
${expected_contentType}
Log
Content Type validated
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 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 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 Delete an individual subscription
log
Try to delete an individual subscription
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}
\ No newline at end of file
SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt
View file @
1d5f607b
*** Variables ***
${NFVO_HOST} localhost # Hostname of the NFVO
${NFVO_PORT} 8081 # Listening port of the NFVO
${NFVO_SCHEMA} https
${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${CONTENT_TYPE} application/json
${AUTH_USAGE} 1
${ACCEPT} application/json
${NFVO_DUPLICATION} 0
${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${sub_filter} filter
${sub_filter_invalid} filter_invalid
${callback_endpoint} /notification
${callback_port} 9091
${callback_uri} http://localhost
${sleep_interval} 20s
${apiRoot} /
${apiName} vrqan
${apiVersion} v1
${VrQuotaAvailNotification} {}
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
*** Variables ***
${NFVO_HOST} localhost # Hostname of the NFVO
${NFVO_PORT} 8081 # Listening port of the NFVO
${NFVO_SCHEMA} https
${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${CONTENT_TYPE} application/json
${AUTH_USAGE} 1
${ACCEPT} application/json
${NFVO_DUPLICATION} 0
${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${sub_filter} filter
${sub_filter_invalid} filter_invalid
${callback_endpoint} /notification
${callback_port} 9091
${callback_uri} http://localhost
${sleep_interval} 20s
${apiRoot} /
${apiName} vrqan
${apiVersion} v1
${VrQuotaAvailNotification} {}
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
${response} {}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment