Commit b83b29c1 authored by Elian Kraja's avatar Elian Kraja
Browse files

updates on SOL003 and SOL005 high level code

parent e104a05e
......@@ -23,5 +23,6 @@ ${callback_port} 9091
${callback_uri} http://172.22.1.7:${callback_port}
${callback_endpoint} /vnfind/subscriptions
${callback_endpoint_error} /subs_404
${total_polling_time} 2 min
${polling_interval} 10 sec
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
\ No newline at end of file
*** Variables ***
${callback_port} 9091
${callbackUri} http://172.22.1.7:${callback_port}
${callback_endpoint} /vnfind/subscriptions
${callback_endpoint_error} /subs_404
${total_polling_time} 2 min
${polling_interval} 10 sec
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
\ No newline at end of file
{ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", "type": "object", "required": [ "status", "detail" ], "properties": { "type": { "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", "type": "string", "format": "URI" }, "title": { "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n", "type": "string" }, "status": { "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n", "type": "integer" }, "detail": { "description": "A human-readable explanation specific to this occurrence of the problem.\n", "type": "string" }, "instance": { "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", "type": "string", "format": "URI" } }}
\ No newline at end of file
......@@ -137,7 +137,6 @@ Check HTTP Response Body Matches the Subscription
Should Be Equal ${response['body']['callbackUri']} ${subscription['callbackUri']}
Check Postcondition VNF Package Subscription Is Set
[Arguments] ${location}=""
Log Check Postcondition subscription exist
......
......@@ -27,6 +27,6 @@ ${callback_port} 9091
${callback_uri} http://172.22.1.7:${callback_port}
${callback_endpoint} /vnfpkgm/subscriptions
${callback_endpoint_error} /subs_404
${sleep_interval} 20s
${total_polling_time} 2 min
${polling_interval} 10 sec
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
\ No newline at end of file
*** Variables ***
${callback_port} 9091
${callback_uri} http://172.22.1.7:${callback_port}
${callback_endpoint} /vnfpkgm/subscriptions
${callback_endpoint_error} /subs_404
${total_polling_time} 2 min
${polling_interval} 10 sec
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
\ No newline at end of file
{ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", "type": "object", "required": [ "status", "detail" ], "properties": { "type": { "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", "type": "string", "format": "URI" }, "title": { "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n", "type": "string" }, "status": { "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n", "type": "integer" }, "detail": { "description": "A human-readable explanation specific to this occurrence of the problem.\n", "type": "string" }, "instance": { "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", "type": "string", "format": "URI" } }}
\ No newline at end of file
......@@ -8,15 +8,7 @@ Library Collections
Library String
*** Keywords ***
Check Notification Endpoint
&{req}= Create Mock Request Matcher GET ${callback_endpoint}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Clear Requests ${callback_endpoint}
*** Test Cases ***
Post Performance Information Available Notification
${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
......@@ -24,7 +16,7 @@ Post Performance Information Available Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
......@@ -38,7 +30,7 @@ Post Performance Information Available Notification Negative 404
&{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
......@@ -51,7 +43,7 @@ Post Threshold Crossed Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
......@@ -65,7 +57,7 @@ Post Threshold Crossed Notification Negative 404
&{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
......@@ -77,7 +69,7 @@ PUT Performance Notification
&{req}= Create Mock Request Matcher PUT ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
......@@ -89,7 +81,7 @@ PATCH Performance Notification
&{req}= Create Mock Request Matcher PATCH ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
......@@ -101,15 +93,15 @@ DELETE Performance Notification
&{req}= Create Mock Request Matcher DELETE ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
*** Keywords ***
Create Sessions
Pass Execution If ${VNFM_CHECKS_NOTIF_ENDPOINT} == 0 VNFM is not checking notification endpoint.
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}
\ No newline at end of file
Create Mock Session ${callback_uri}:${callback_port}
\ No newline at end of file
......@@ -295,6 +295,7 @@ Check HTTP Response Body Matches the Subscription
Check Postcondition VNF Performance Subscription Is Set
Log Check Postcondition subscription exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']}
${output}= Output response
Set Suite Variable ${response} ${output}
......@@ -302,6 +303,7 @@ Check Postcondition VNF Performance Subscription Is Set
Check Postcondition Subscription Resource URI Returned in Location Header Is Valid
Log Going to check postcondition
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${response.headers['Location']}
Integer response status 200
Log Received a 200 OK as expected
......
......@@ -25,4 +25,7 @@ ${callback_endpoint} /vnfpm/subscriptions
${callback_endpoint_error} /subs_404
${sleep_interval} 20s
${total_polling_time} 2 min
${polling_interval} 10 sec
${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
\ No newline at end of file
{
"id": "id",
"notificationType" : "PerformanceInformationAvailableNotification",
"subscriptionId ": "subscriptionId",
"timeStamp": "2012-04-21T18:25:43-05:00",
"objectInstanceId": "vnfID",
"_links": {
"subscription": "link to subscription",
"pmJob" : "link to PMJob",
"performanceReport": "link to PerformanceReport"
}
{
"id": "id",
"notificationType" : "PerformanceInformationAvailableNotification",
"subscriptionId ": "subscriptionId",
"timeStamp": "2012-04-21T18:25:43-05:00",
"objectInstanceId": "vnfID",
"_links": {
"subscription": "link to subscription",
"pmJob" : "link to PMJob",
"performanceReport": "link to PerformanceReport"
}
}
\ 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"
}
}
}
}
}
}
{
"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 type represents a notification that is sent when a threshold has been crossed. The notification shall be triggered by the VNFM when a threshold has been crossed.\n",
"type": "object",
"required": [
"id",
"notificationType",
"subscriptionId",
"timeStamp",
"thresholdId",
"crossingDirection",
"objectInstanceId",
"performanceMetric",
"performanceValue",
"_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 \"ThresholdCrossedNotification\" for this notification type.\n",
"type": "string",
"enum": [
"ThresholdCrossedNotification"
]
},
"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"
},
"thresholdId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"crossingDirection": {
"type": "string",
"enum": [
"UP",
"DOWN"
]
},
"objectInstanceId": {
"description": "An identifier with the intention of being globally unique.\n",
"type": "string"
},
"performanceMetric": {
"description": "Performance metric associated with the threshold.\n",
"type": "string"
},
"performanceValue": {
"description": "Value of the metric that resulted in threshold crossing. The type of the \"performanceValue\" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures / Objects)) is assumed to be defined in the external measurement specification (see ETSI GS NFV-IFA 027).\n",
"type": "object"
},
"_links": {
"description": "Links to resources related to this notification.\n",
"type": "object",
"required": [
"subscription",
"threshold"
],
"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"
}
}
},
"threshold": {
"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"
}
}
}
}
}
}
{
"description": "This type represents a notification that is sent when a threshold has been crossed. The notification shall be triggered by the VNFM when a threshold has been crossed.\n",
"type": "object",
"required": [
"id",
"notificationType",
"subscriptionId",
"timeStamp",
"thresholdId",
"crossingDirection",
"objectInstanceId",
"performanceMetric",
"performanceValue",
"_links"
],
"properties": {
"id": {