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
31d8765d
Commit
31d8765d
authored
Feb 19, 2021
by
Giacomo Bernini
Browse files
fixed issue
#156
on v2.6.1
parent
fd44ec14
Changes
10
Hide whitespace changes
Inline
Side-by-side
SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot
View file @
31d8765d
...
...
@@ -5,6 +5,9 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library
OperatingSystem
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
Process
Suite Setup
Initialize System
Suite Teardown
Terminate All Processes
kill=true
*** Test Cases ***
...
...
@@ -17,11 +20,13 @@ NS Instance Creation
...
Reference: Clause 6.3.1 - ETSI GS NFV-SOL 005 [3] v2.6.1
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: The NS
lifecycle management operation occurren
ce is in NOT_ISTANTIATED state
...
Post-Conditions: The NS
resour
ce is in NOT_ISTANTIATED state
POST New nsInstance
Check HTTP Response Status Code Is
201
Check HTTP Response Header Contains
Location
Check HTTP Response Body Json Schema Is
NsIdentifierCreationNotification
Check HTTP Response Body Json Schema Is
NsInstance
Check Notification Http POST Request Body Json Schema Is
NsIdentifierCreationNotification
Check Notification Http POST Request Body notificationType attribute Is
NsIdentifierCreationNotification
Check resource not_instantiated
\ No newline at end of file
SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot
View file @
31d8765d
...
...
@@ -5,6 +5,9 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library
OperatingSystem
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
Process
Suite Setup
Initialize System
Suite Teardown
Terminate All Processes
kill=true
*** Test Cases ***
NS Instance Deletion
...
...
@@ -16,8 +19,8 @@ NS Instance Deletion
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: NS Instance resource is deleted
Check resource not_instantiated
DELETE IndividualNSInstance
Check HTTP Response Status Code Is
204
Check HTTP Response Body Json Schema Is
NsIdentifierDeletionNotification
Check Notification Http POST Request Body Json Schema Is
NsIdentifierDeletionNotification
Check Notification Http POST Request Body notificationType attribute Is
NsIdentifierDeletionNotification
Check Instance Deleted
\ No newline at end of file
SOL005/NSLifecycleManagement-API/HealNSTaskWorkflow.robot
View file @
31d8765d
...
...
@@ -5,6 +5,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library
OperatingSystem
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
Process
Suite Setup
Initialize System
Suite Teardown
Terminate All Processes
kill=true
...
...
@@ -13,14 +14,14 @@ Heal Flow of NS lifecycle management operations
[
Documentation
]
Test ID: 5.3.2.20.1
...
Test title: Heal Flow of NS lifecycle management operations
...
Test objective: The objective is to test the workflow for Healing a NS instance
...
Pre-conditions:
t
he resource is in INSTANTIATED state
...
Pre-conditions:
T
he resource is in INSTANTIATED state
...
Reference: Clause 6.4.7 - ETSI GS NFV-SOL 005 [3] v2.6.1
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: NS Instance still in INSTANTIATED state
Check resource instantiated
...
Post-Conditions: The NS Instance still in INSTANTIATED state
POST Heal NSInstance
Check HTTP Response Status Code Is
202
Check HTTP Response Header Contains
Location
Check Operation Occurrence Id
Check Operation Notification Status is
START
Check Operation Notification Status is
RESULT
...
...
SOL005/NSLifecycleManagement-API/InstanciateNSTaskWorkflow.robot
View file @
31d8765d
...
...
@@ -5,6 +5,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library
OperatingSystem
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
Process
Suite Setup
Initialize System
Suite Teardown
Terminate All Processes
kill=true
...
...
@@ -13,15 +14,14 @@ Instantiate Flow of NS lifecycle management operations
[
Documentation
]
Test ID: 5.3.2.21.1
...
Test title: Instantiate Flow of NS lifecycle management operations
...
Test objective: The objective is to test the workflow for Instantiate a NS instance
...
Pre-conditions:
t
he resource is in NOT_INSTANTIATED state
...
Pre-conditions:
T
he resource is in NOT_INSTANTIATED state
...
Reference: Clause 6.4.4 - ETSI GS NFV-SOL 005 [3] v2.6.1
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: the resource is in INSTANTIATED state
Check resource existence
Check resource not_instantiated
...
Post-Conditions: The resource is in INSTANTIATED state
POST Instantiate nsInstance
Check HTTP Response Status Code Is
202
Check HTTP Response Header Contains
Location
Check Operation Occurrence Id
Check Operation Notification Status is
START
Check Operation Notification Status is
RESULT
...
...
SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot
View file @
31d8765d
...
...
@@ -84,7 +84,7 @@ Check Operation Notification
${json}
=
Get File
schemas/
${element}
.schema.json
Configure Notification Forward
${element}
${callback_endpoint}
${callback_endpoint_fwd}
Configure Notification Status Handler
${callback_endpoint_fwd}
${status}
Wait Until Keyword Succeeds
2 min
10 sec
Verify Mock Expectation
${notification_request}
Wait Until Keyword Succeeds
${notification_timeout}
${poll_interval}
Verify Mock Expectation
${notification_request}
Clear Requests
${callback_endpoint}
Clear Requests
${callback_endpoint_fwd}
...
...
@@ -109,25 +109,41 @@ Check resource operationState is
[
Arguments
]
${state}
String
${response['body']['operationState']}
${state}
Check resource
instantiated
Check resource
INSTANTIATED
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${nsInstanceId}
GET
${response['headers']['Location']}
${opocc}
=
Output
response
Should Be Equal as Strings
${opocc['status']}
200
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${opocc['body']['nsInstanceId']}
String
response body nsState
INSTANTIATED
Check resource not_instantiated
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${nsInstanceId}
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${response['body']['id']}
String
response body nsState
NOT_INSTANTIATED
Check NS resource not_instantiated
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
GET
${response['headers']['Location']}
${opocc}
=
Output
response
Should Be Equal as Strings
${opocc['status']}
200
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${opocc['body']['nsInstanceId']}
String
response body nsState
NOT_INSTANTIATED
Check operation resource state is FAILED_TEMP
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${nsInstanceId}
GET
${response['headers']['Location']}
${opocc}
=
Output
response
Should Be Equal as Strings
${opocc['status']}
200
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${opocc['body']['nsInstanceId']}
String
response body instantiationState
FAILED_TEMP
Check operation resource state is not FAILED_TEMP
...
...
@@ -135,14 +151,20 @@ Check operation resource state is not FAILED_TEMP
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${nsInstanceId}
GET
${response['headers']['Location']}
${opocc}
=
Output
response
Should Be Equal as Strings
${opocc['status']}
200
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${opocc['body']['nsInstanceId']}
String
response body instantiationState
not
FAILED_TEMP
Check resource is finally failed
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${nsInstanceId}
GET
${response['headers']['Location']}
${opocc}
=
Output
response
Should Be Equal as Strings
${opocc['status']}
200
Get
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances/
${opocc['body']['nsInstanceId']}
String
response body instantiationState
FINALLY_FAILED
Launch another LCM operation
...
...
@@ -220,6 +242,16 @@ POST New nsInstance
${outputResponse}
=
Output
response
Set Global Variable
${response}
${outputResponse}
POST New nsInstance resource workflow
Log
Create NS instance by POST to
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances
Set Headers
{"Accept":"
${ACCEPT}
"}
Set Headers
{"Content-Type": "
${CONTENT_TYPE}
"}
Run Keyword If
${AUTH_USAGE}
=
= 1
Set Headers
{"
${AUTHORIZATION_HEADER}
":"
${AUTHORIZATION_TOKEN}
"}
${body}
=
Get File
jsons/CreateNsRequest.json
Post
${apiRoot}
/
${apiName}
/
${apiVersion}
/ns_instances
${body}
${outputResponse}
=
Output
response
Set Global Variable
${response}
${outputResponse}
GET NsInstances
Log
Query NS The GET method queries information about multiple NS instances.
Set Headers
{"Accept":"
${ACCEPT}
"}
...
...
@@ -1133,3 +1165,25 @@ PUT notification
Check LINK in Header
${linkURL}
=
Get Value From Json
${response['headers']}
$..Link
Should Not Be Empty
${linkURL}
Check Notification Http POST Request Body Json Schema Is
[
Arguments
]
${element}
${schema}
=
Get File
schemas/
${element}
.schema.json
Configure Notification Forward
${schema}
${callback_endpoint}
${callback_endpoint_fwd}
Check Notification Http POST Request Body notificationType attribute Is
[
Arguments
]
${type}
Configure Notification NS Creation Handler
${callback_endpoint_fwd}
${type}
Wait Until Keyword Succeeds
${notification_timeout}
${poll_interval}
Verify Mock Expectation
${notification_request}
Clear Requests
${callback_endpoint}
Clear Requests
${callback_endpoint_fwd}
Configure Notification NS Creation Handler
[
Arguments
]
${endpoint}
${type}
${json}
=
evaluate
{}
set to dictionary
${json}
notificationType
${type}
${BODY}
=
evaluate
json.dumps(
${json}
)
json
Log
Creating mock request and response to handle status notification
&{notification_request}
=
Create Mock Request Matcher
POST
${endpoint}
body_type="JSON"
body=
${BODY}
&{notification_response}
=
Create Mock Response
headers="Content-Type: application/json"
status_code=204
Create Mock Expectation
${notification_request}
${notification_response}
SOL005/NSLifecycleManagement-API/NotificationEndpoint.robot
View file @
31d8765d
...
...
@@ -46,8 +46,8 @@ NS Identifier Creation Notification
...
Applicability: none
...
Post-Conditions: none
Trigger the creation of a NS instance resource (external action)
Check NS Identifier Creation Notification Http POST Request Body Json Schema Is
NsIdentifier
Dele
tionNotification
Check NS Identifier Creation Notification Http POST Request Body notificationType attribute Is
NsIdentifier
Dele
tionNotification
Check NS Identifier Creation Notification Http POST Request Body Json Schema Is
NsIdentifier
Crea
tionNotification
Check NS Identifier Creation Notification Http POST Request Body notificationType attribute Is
NsIdentifier
Crea
tionNotification
NS Identifier Deletion Notification
[
Documentation
]
Test ID: 5.3.2.17.4
...
...
@@ -59,8 +59,8 @@ NS Identifier Deletion Notification
...
Applicability: none
...
Post-Conditions: none
Trigger the deletion of a NS instance resource (external action)
Check NS Identifier Deletion Notification Http POST Request Body Json Schema Is
NsIdentifier
Crea
tionNotification
Check NS Identifier Deletion Notification Http POST Request Body notificationType attribute Is
NsIdentifier
Crea
tionNotification
Check NS Identifier Deletion Notification Http POST Request Body Json Schema Is
NsIdentifier
Dele
tionNotification
Check NS Identifier Deletion Notification Http POST Request Body notificationType attribute Is
NsIdentifier
Dele
tionNotification
*** Keywords ***
Trigger a NS LCM operation (external action)
...
...
SOL005/NSLifecycleManagement-API/ScaleNSTaskWorkflow.robot
View file @
31d8765d
...
...
@@ -13,15 +13,14 @@ Scale Flow of NS lifecycle management operations
[
Documentation
]
Test ID: 5.3.2.22.1
...
Test title: Instantiate Flow of NS lifecycle management operations
...
Test objective: The objective is to test the workflow for Instantiate a NS instance
...
Pre-conditions:
t
he resource is in
NOT_
INSTANTIATED state
...
Pre-conditions:
T
he resource is in INSTANTIATED state
...
Reference: Clause 6.4.5 - ETSI GS NFV-SOL 005 [3] v2.6.1
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: the resource is in INSTANTIATED state
Check resource existence
Check resource instantiated
...
Post-Conditions: The resource is in INSTANTIATED state
POST scale nsInstance
Check HTTP Response Status Code Is
202
Check HTTP Response Header Contains
Location
Check Operation Occurrence Id
Check Operation Notification Status is
START
Check Operation Notification Status is
RESULT
...
...
SOL005/NSLifecycleManagement-API/TerminateNSTaskWorkflow.robot
View file @
31d8765d
...
...
@@ -5,6 +5,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library
OperatingSystem
Library
JSONLibrary
Library
JSONSchemaLibrary
schemas/
Library
Process
Suite Setup
Initialize System
Suite Teardown
Terminate All Processes
kill=true
...
...
@@ -17,15 +18,14 @@ Terminate Flow of NS lifecycle management operations
...
Reference: Clause 6.4.8 - ETSI GS NFV-SOL 005 [3] v2.6.1
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: the resource is in NOT_INSTANTIATED state
Check resource existence
Check resource instantiated
...
Post-Conditions: The NS resource is in NOT_INSTANTIATED state
POST Terminate NSInstance
Check HTTP Response Status Code Is
202
Check HTTP Response Header Contains
Location
Check Operation Occurrence Id
Check Operation Notification Status is
START
Check Operation Notification Status is
RESULT
Check resource not_instantiated
Check
NS
resource not_instantiated
...
...
SOL005/NSLifecycleManagement-API/UpdateNSTaskWorkflow.robot
View file @
31d8765d
...
...
@@ -13,15 +13,14 @@ Update Flow of NS lifecycle management operations
[
Documentation
]
Test ID: 5.3.2.24.1
...
Test title: Update Flow of NS lifecycle management operations
...
Test objective: The objective is to test the workflow for Update a NS instance
...
Pre-conditions:
t
he resource is in INSTANTIATED state
...
Pre-conditions:
T
he resource is in INSTANTIATED state
...
Reference: Clause 6.4.6 - ETSI GS NFV-SOL 005 [3] v2.6.1
...
Config ID: Config_prod_NFVO
...
Applicability: none
...
Post-Conditions: the resource is in INSTANTIATED state
Check resource existence
Check resource instantiated
...
Post-Conditions: The resource is in INSTANTIATED state
POST Update NSInstance
Check HTTP Response Status Code Is
202
Check HTTP Response Header Contains
Location
Check Operation Occurrence Id
Check Operation Notification Status is
START
Check Operation Notification Status is
RESULT
...
...
SOL005/NSLifecycleManagement-API/environment/variables.txt
View file @
31d8765d
...
...
@@ -62,4 +62,7 @@ ${Etag_modified}= a modified etag
${NEG_FILTER} attribute_not_exist=some_value
${NEG_SELECTOR} fields=wrong_field
${json} {}
\ No newline at end of file
${json} {}
${notification_timeout} 2min
${poll_interval} 10sec
\ 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