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

implemented deltas for SOL003 VNF PM v2.8.1

parent 8c4e7597
......@@ -4,6 +4,10 @@ Library JSONSchemaLibrary schemas/
Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false
Library MockServerLibrary
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
GET individual VNF Performance Job
......@@ -108,8 +112,27 @@ PATCH Individual VNF Performance Job - Precondition failed
Send Patch request for individual VNF Performance Job
Check HTTP Response Status Code Is 412
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Performance Job is Unmodified (Implicit)
Check Postcondition VNF Performance Job is Unmodified (Implicit)
PATCH Individual VNF Performance Job with Unprocessable Entity
[Documentation] Test ID: 7.3.4.2.9
... Test title: PATCH Individual VNF Performance Job with Unprocessable Entity
... Test objective: The objective is to test that PATCH method to modify individual performace management job fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
... Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions:
Send Patch request for individual VNF Performance Job with Unprocessable Entity
Check HTTP Response Status Code Is 422
Check HTTP Response Body Json Schema Is ProblemDetails
*** Keywords ***
Create Sessions
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}
GET individual VNF Performance Job
Log Trying to get a Pm Job present in the NFVO Catalogue
Set Headers {"Accept": "${ACCEPT_JSON}"}
......@@ -165,9 +188,27 @@ Send Patch request for individual VNF Performance Job
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/PMJobModifications.json
${template}= Get File jsons/PMJobModifications.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
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}
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Send Patch request for individual VNF Performance Job with Unprocessable Entity
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/PMJobModifications.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
Log Do not create any mock for notification endpoint
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId} ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
......
......@@ -4,6 +4,10 @@ Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_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
......@@ -91,7 +95,7 @@ PATCH Individual Threshold
... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions:
... Post-Conditions: none
Send Patch request for individual VNF Performance Threshold
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is ThresholdModifications
......@@ -109,7 +113,26 @@ PATCH Individual Threshold - Precondition failed
Check HTTP Response Status Code Is 412
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Performance Threshold is Unmodified (Implicit)
PATCH Individual Threshold with Unprocessable Entity
[Documentation] Test ID: 7.3.4.5.9
... Test title: PATCH Individual Threshold with Unprocessable Entity
... Test objective: The objective is to test that PATCH method to modify an Individual threshold resource fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM.
... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
Send Patch request for individual VNF Performance Threshold with Unprocessable Entity
Check HTTP Response Status Code Is 422
Check HTTP Response Body Json Schema Is ProblemDetails
*** Keywords ***
Create Sessions
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}
GET Individual VNF Performance Threshold
Log Trying to get a Threhsold present in the VNFM
Set Headers {"Accept": "${ACCEPT_JSON}"}
......@@ -163,7 +186,27 @@ Send Patch request for individual VNF Performance Threshold
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/ThresholdModifications.json
${template}= Get File jsons/ThresholdModifications.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
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}/thresholds/${thresholdId}
${output}= Output response
Set Suite Variable ${response} ${output}
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Send Patch request for individual VNF Performance Threshold with Unprocessable Entity
Log Trying to PUT threshold
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/ThresholdModifications.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
Log Do not create any mock for notification endpoint
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
${output}= Output response
Set Suite Variable ${response} ${output}
......
......@@ -6,6 +6,9 @@ Library OperatingSystem
Library String
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false
Library MockServerLibrary
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
GET all VNF Performance Monitoring Jobs
......@@ -207,8 +210,26 @@ GET all VNF Performance Monitoring Jobs with fields and exclude_default attribut
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is PmJobs
Check HTTP Response Body PmJobs Matches the requested fields selector
Create new VNF Performance Monitoring Job with Unprocessable Entity
[Documentation] Test ID: 7.3.4.1.16
... Test title: Create a new VNF Performance Monitoring Job with Unprocessable Entity
... Test objective: The objective is to test that the creation of a new VNF performance monitoring job fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A VNF instance is instantiated.
... Reference: Clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
Send Post Request Create new VNF Performance Monitoring Job with Unprocessable Entity
Check HTTP Response Status Code Is 422
Check HTTP Response Body Json Schema Is ProblemDetails
*** Keywords ***
Create Sessions
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}
GET all VNF Performance Monitoring Jobs
Log Trying to get all PM Jobs present in the VNFM
Set Headers {"Accept": "${ACCEPT_JSON}"}
......@@ -290,11 +311,30 @@ Send Post Request Create new VNF 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} objectInstanceIds=${objectInstanceIds}
${body}= Format String ${template} objectInstanceIds=${objectInstanceIds} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
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}
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Send Post Request Create new VNF Performance Monitoring Job with Unprocessable Entity
Log Creating a new PM Job
Set Headers {"Accept": "${ACCEPT_JSON}"}
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=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
Log Do not create mock for notification endpoint
POST ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Send PUT Request for all VNF Performance Monitoring Jobs
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
......
......@@ -5,6 +5,10 @@ Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_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
......@@ -136,7 +140,26 @@ GET Performance Thresholds - Bad Request Response too Big
GET all Performance Thresholds
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
Create new Performance Threshold with Unprocessable Entity
[Documentation] Test ID: 7.3.4.4.11
... Test title: Create new Performance Threshold with Unprocessable Entity
... Test objective: The objective is to test that the creation of a new VNF performance threshold fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
... Pre-conditions: A VNF instance is instantiated.
... Reference: Clause 6.4.5.3.1 - ETSI GS NFV-SOL 003 [1] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: none
Send Post Request Create new Performance Threshold with Unprocessable Entity
Check HTTP Response Status Code Is 422
Check HTTP Response Body Json Schema Is ProblemDetails
*** Keywords ***
Create Sessions
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}
GET all Performance Thresholds
Log Trying to get all thresholds present in the VNFM
Set Headers {"Accept": "${ACCEPT_JSON}"}
......@@ -175,7 +198,26 @@ Send Post Request Create new Performance Threshold
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${template}= Get File jsons/CreateThresholdRequest.json
${request}= Format String ${template} objectInstanceIds=${objectInstanceIds}
${request}= Format String ${template} objectInstanceIds=${objectInstanceIds} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
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}/thresholds ${request}
${output}= Output response
Set Suite Variable ${response} ${output}
Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint
Send Post Request Create new Performance Threshold with Unprocessable Entity
Log Creating a new THreshold
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${template}= Get File jsons/CreateThresholdRequest.json
${request}= Format String ${template} objectInstanceIds=${objectInstanceIds} callback_uri=${callback_uri} callback_port=${callback_port} callback_uri=${callback_endpoint}
Log DO not create any mock for notification endpoint
POST ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds ${request}
${output}= Output response
Set Suite Variable ${response} ${output}
......
......@@ -20,9 +20,9 @@ ${apiRoot} /
${apiMajorVersion} v1
${apiName} vnfpm
${callback_uri} http://localhost
${callback_port} 9091
${callback_uri} http://172.22.1.7:${callback_port}
${callback_endpoint} /vnfpm/subscriptions
${callback_endpoint} /endpoint
${callback_endpoint_error} /subs_404
${sleep_interval} 20s
......
......@@ -5,5 +5,6 @@
"performanceMetricGroup": [],
"collectionPeriod": 10,
"reportingPeriod": 30
}}
}},
"callbackUri": "{callback_uri}:{callback_port}{callback_endpoint}"
}}
\ No newline at end of file
......@@ -8,5 +8,6 @@
"hysteresis": 50
}}
}}
}},
"callbackUri": "{callback_uri}:{callback_port}{callback_endpoint}"
}}
\ No newline at end of file
......@@ -4,6 +4,7 @@
"subscriptionId ": "subscriptionId",
"timeStamp": "2012-04-21T18:25:43-05:00",
"objectInstanceId": "vnfID",
"pmJobId": "pmJobIdentifier",
"_links": {
"subscription": "link to subscription",
"pmJob" : "link to PMJob",
......
{
"callbackUri":"127.0.0.3"
"callbackUri": "{callback_uri}:{callback_port}{callback_endpoint}"
}
\ No newline at end of file
{
"callbackUri":"127.0.0.1"
"callbackUri": "{callback_uri}:{callback_port}{callback_endpoint}"
}
\ No newline at end of file
{
"description": "This notification informs the receiver that performance information is available. The timing of sending this notification is determined by the capability of the producing entity to evaluate the threshold crossing condition. The notification shall be triggered by the VNFM when new performance information collected by a PM job is available.\n",
"type": "object",
"required": [
"id",
"notificationType",
"subscriptionId",
"timeStamp",
"objectInstanceId",
"_links"
],
"properties": {
"id": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"notificationType": {
"description": "Discriminator for the different notification types. Shall be set to \"PerformanceInformationAvailableNotification\" for this notification type.\n",
"type": "string",
"enum": [
"PerformanceInformationAvailableNotification"
]
},
"subscriptionId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"timeStamp": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
},
"objectInstanceId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"_links": {
"description": "Links to resources related to this notification.\n",
"type": "object",
"required": [
"subscription",
"pmJob",
"performanceReport"
],
"properties": {
"subscription": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
},
"objectInstance": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
},
"pmJob": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
},
"performanceReport": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
}
}
}
}
}
\ No newline at end of file
"description": "This notification informs the receiver that performance information is available. The notification shall be triggered by the VNFM when new performance information collected by a PM job is available. The periodicity of triggering this notification is influenced by the \"reportingPeriod\" attribute in the \"PmJobCriteria\" data structure.\n",
"type": "object",
"required": ["id", "notificationType", "timeStamp", "pmJobId", "objectType", "objectInstanceId", "_links"],
"properties": {
"id": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"notificationType": {
"description": "Discriminator for the different notification types. Shall be set to \"PerformanceInformationAvailableNotification\" for this notification type.\n",
"type": "string",
"enum": ["PerformanceInformationAvailableNotification"]
},
"timeStamp": {
"description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
"type": "string",
"format": "date-time"
},
"pmJobId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"objectType": {
"description": "Type of the measured object. The applicable measured object type for a measurement is defined in clause 7.2 of ETSI GS NFV-IFA 027.\n",
"type": "string"
},
"objectInstanceId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"subObjectInstanceIds": {
"description": "Identifiers of the sub-object instances of the measured object instance for which the measurements have been taken. Shall be present if the related PM job has been set up to measure only a subset of all sub-object instances of the measured object instance and a sub-object is defined in clause 6.2 of ETSI GS NFV-IFA 027 for the related measured object type.\nShall be absent otherwise.\n",
"type": "array",
"items": {
"description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
"type": "string"
}
},
"_links": {
"description": "Links to resources related to this notification.\n",
"type": "object",
"required": ["pmJob", "performanceReport"],
"properties": {
"objectInstance": {
"description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n",
"type": "object",
"required": ["href"],
"properties": {
"href": {
"description": "String formatted according to IETF RFC 3986.\n",
"type": "string"
}
}
},
"pmJob": {
"description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n",
"type": "object",
"required": ["href"],
"properties": {
"href": {
"description": "String formatted according to IETF RFC 3986.\n",
"type": "string"
}
}
},
"performanceReport": {
"description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n",
"type": "object",
"required": ["href"],
"properties": {
"href": {
"description": "String formatted according to IETF RFC 3986.\n",
"type": "string"
}
}
}
}
}
}
}
\ No newline at end of file
Markdown is supported
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