Commit a03ecbe9 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch 'master' into 'master'

Master

See merge request !13
parents de19ec43 3caff1e2
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
*** Test Cases ***
NS Instance Creation
Do POST New nsInstance
Check HTTP Response Status Code Is 201
Check HTTP Response Header Contains Location
Check HTTP Response Body Json Schema Is NsIdentifierCreationNotification.schema.json
Check resource not_instantiated
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite Setup Check resource existance
*** Test Cases ***
NS Instance Deletion
Check resource not_instantiated
Do DELETE IndividualNSInstance
Check HTTP Response Status Code Is 204
Check HTTP Response Body Json Schema Is NsIdentifierDeletionNotification.schema.json
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite Setup Check resource existance
Suite Setup Initialize System
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Heal Flow of NS lifecycle management operations
Check resource instantiated
Do POST Heal NSInstance
Check HTTP Response Status Code Is 202
Check Operation Occurrence Id
Check Operation Notification Status is START
Check Operation Notification Status is RESULT
Check resource instantiated
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite Setup Check resource existance
Suite Setup Initialize System
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Instantiate Flow of NS lifecycle management operations
Check resource not_instantiated
Do POST Instatiate nsInstance
Check HTTP Response Status Code Is 202
Check Operation Occurrence Id
Check Operation Notification Status is START
Check Operation Notification Status is RESULT
Check resource instantiated
\ No newline at end of file
......@@ -8,6 +8,16 @@ Library OperatingSystem
Library MockServerLibrary
*** Keywords ***
Initialize System
Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${callback_uri}:${callback_port}
Check Operation Occurrence Id
${occid}= Get Value From Json ${response[0]['headers']['Location']}
Set Global Variable @{nsLcmOpOccId} ${occid}
Should Not Be Empty ${nsLcmOpOccId}
Create Sessions
Start Process java -jar ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
......@@ -20,7 +30,6 @@ Check subscription existance
Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 200
Check Fail not supported
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
......@@ -50,6 +59,40 @@ Check resource FAILED_TEMP
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
String response body operationState FAILED_TEMP
Check Operation Notification Status is
[Arguments] ${status}
Check Operation Notification NsLcmOperationOccurrenceNotification ${status}
Check Operation Notification
[Arguments] ${element} ${status}=""
${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}
Clear Requests ${callback_endpoint}
Clear Requests ${callback_endpoint_fwd}
Configure Notification Forward
[Arguments] ${element} ${endpoint} ${endpoint_fwd}
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock HTTP forward to handle ${element}
&{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{notification_fwd}= Create Mock Http Forward ${endpoint_fwd}
Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd}
Configure Notification Status Handler
[Arguments] ${endpoint} ${status}=""
Run Keyword If ${status}!="" set to dictionary ${json["notificationStatus"]} dp=${status}
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle ${element}
&{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}
Check resource operationState is
[Arguments] ${state}
String ${response[0]['body']['operationState']} ${state}
Check resource instantiated
Set Headers {"Accept":"${ACCEPT}"}
......@@ -253,8 +296,7 @@ Do GET Instantiate NSInstance
${body}= Get File jsons/InstantiateNsRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate ${body}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Set Global Variable @{response} ${outputResponse}
Do DELETE Scale NSInstance
log Trying to delete an Scale NS instance. This method should not be implemented
......@@ -300,7 +342,6 @@ Do POST scale nsInstance
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do DELETE Update NSInstance
log Trying to delete an Update NS instance. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......@@ -788,7 +829,6 @@ Do GET Subscriptions with filter
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do POST Individual Subscription
log Trying to perform a POST. This method should not be implemented
......
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite Setup Check resource existance
Suite Setup Initialize System
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Scale Flow of NS lifecycle management operations
Check resource instantiated
Do POST scale nsInstance
Check HTTP Response Status Code Is 202
Check Operation Occurrence Id
Check Operation Notification Status is START
Check Operation Notification Status is RESULT
Check resource instantiated
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite Setup Check resource existance
Suite Setup Initialize System
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Terminate Flow of NS lifecycle management operations
Check resource instantiated
Do POST Terminate NSInstance
Check HTTP Response Status Code Is 202
Check Operation Occurrence Id
Check Operation Notification Status is START
Check Operation Notification Status is RESULT
Check resource not_instantiated
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite Setup Check resource existance
Suite Setup Initialize System
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Update Flow of NS lifecycle management operations
Check resource instantiated
Do POST Update NSInstance
Check HTTP Response Status Code Is 202
Check Operation Occurrence Id
Check Operation Notification Status is START
Check Operation Notification Status is RESULT
Check resource instantiated
\ No newline at end of file
......@@ -39,6 +39,7 @@ ${VnfIdentifierDeletionNotification} {}
${callback_uri} http://localhost
${callback_port} 9091
${callback_endpoint} /endpoint
${callback_endpoint_fwd} /notification/check
${callback_endpoint_error} /endpoint_404
${sleep_interval} 20s
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment