Skip to content
Snippets Groups Projects
Commit f8f4621e authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

updated SOL005 NS PM job creeation and update with mandatory test notification endpoint

parent 0c5662ae
No related branches found
No related tags found
2 merge requests!230Merging "3.5.1 dev" into "Release 3",!202SOL005 NS Performance Management - Implementation of deltas between v3.5.1 and v3.3.1
......@@ -4,6 +4,11 @@ Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Resource NSPerformanceManagementKeywords.robot
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
Library MockServerLibrary
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
GET individual NS Performance Job
......
......@@ -6,6 +6,11 @@ Resource NSPerformanceManagementKeywords.robot
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
Library OperatingSystem
Library MockServerLibrary
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
GET Individual Threshold
......
......@@ -92,10 +92,19 @@ Send Post Request Create new NS Performance Monitoring Job
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/CreatePmJobRequest.json
${body}= Format String ${template} pmJobId=${pmJobId}
${body}= Format String ${template} pmJobId=${pmJobId} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint} callbackPort=${callback_port} performanceMetric=${performanceMetric} collectionPeriod=${collectionPeriod} reportingPeriod=${reportingPeriod}
Log Creating mock request and response to handle GET operation on notification endpoint
&{notification_request}= Create Mock Request Matcher GET ${callback_endpoint}
&{notification_response}= Create Mock Response status_code=204
Log Issue the request
Create Mock Expectation ${notification_request} ${notification_response}
POST ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Log Verify producer tested the notification endpoint
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Send POST request for NS Performance Monitoring Job with unprocessable entity
Log trying to create a new NS PM Job
......@@ -103,10 +112,18 @@ Send POST request for NS Performance Monitoring Job with unprocessable entity
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/CreatePmJobRequest.json
${body}= Format String ${template} objectInstanceIds=${objectInstanceIds} callback_uri=${unreachable_callback_uri}:${callback_port}
${body}= Format String ${template} pmJobId=${pmJobId} callbackUri=${callback_uri} callbackEndpoint=${unreachable_callback_uri} callbackPort=${callback_port} performanceMetric=${performanceMetric} collectionPeriod=${collectionPeriod} reportingPeriod=${reportingPeriod}
Log Creating mock request and response to handle GET operation on notification endpoint
&{notification_request}= Create Mock Request Matcher GET ${callback_endpoint}
&{notification_response}= Create Mock Response status_code=204
Log Issue the request
Create Mock Expectation ${notification_request} ${notification_response}
POST ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Log Verify producer tested the notification endpoint
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Send PUT Request for all NS Performance Monitoring Jobs
Log Trying to perform a PUT. This method should not be implemented
......@@ -251,9 +268,18 @@ Send Patch request for individual NS Performance Job
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/PmJobModifications.json
${body}= Format String ${body} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint} callbackPort=${callback_port}
Log Creating mock request and response to handle GET operation on notification endpoint
&{notification_request}= Create Mock Request Matcher GET ${callback_endpoint}
&{notification_response}= Create Mock Response status_code=204
Log Issue the request
Create Mock Expectation ${notification_request} ${notification_response}
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId} ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Log Verify producer tested the notification endpoint
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Send Patch request for individual NS Performance Job - Etag mismatch
Log Trying to perform a PATCH
......
......@@ -6,6 +6,10 @@ Library JSONLibrary
Library OperatingSystem
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
Library MockServerLibrary
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
GET all NS Performance Monitoring Jobs
......
......@@ -6,6 +6,11 @@ Resource NSPerformanceManagementKeywords.robot
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
Library OperatingSystem
Library MockServerLibrary
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
GET All Performance Thresholds
......
......@@ -6,5 +6,5 @@
"collectionPeriod": {collectionPeriod},
"reportingPeriod": {reportingPeriod}
}},
"callbackUri": "{callback_uri}"
"callbackUri": "{callbackUri}:{callbackPort}{callbackEndpoint}"
}}
\ No newline at end of file
......@@ -8,5 +8,5 @@
"hysteresis": {hysteresis}
}}
}},
"callbackUri": "{callback_uri}"
"callbackUri": "{callbackUri}:{callbackPort}{callbackEndpoint}"
}}
\ No newline at end of file
{
"callbackUri": ""
"callbackUri": "{callbackUri}:{callbackPort}{callbackEndpoint}"
}
\ No newline at end of file
{
"callbackUri":""
"callbackUri": "{callbackUri}:{callbackPort}{callbackEndpoint}"
}
\ 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