Commit 88bff108 authored by Elian Kraja's avatar Elian Kraja
Browse files

Adding notification file for Performance Management

parent 26db3c3a
Loading
Loading
Loading
Loading
+58 −0
Original line number Original line Diff line number Diff line
*** Setting ***
Suite Setup    Create Sessions
Suite Teardown    Terminate All Processes    kill=true
Library    MockServerLibrary
Library    Process
Library    OperatingSystem
Library    BuiltIn
Library    RequestsLibrary
Library    Collections
Library    String

*** Variable ***
${callback_uri}    http://localhost
${callback_port}    9091
${callback_endpoint}    /endpoint
${sleep_interval}    20s

*** Test Cases ***
Check Notification Endpoint
    &{req}=  Create Mock Request Matcher Schema	GET  ${callback_endpoint}    
    &{rsp}=  Create Mock Response Schema	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Verify Mock Expectation  ${req}
    Clear Requests  ${callback_endpoint}
    
Post Performance Information Available Notification
    ${json}=	Get File	jsons/PerformanceInformationAvailableNotification.json
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Log  Creating mock request and response to handle Performance Information Available Notification
    &{req}=  Create Mock Request Matcher Schema	POST  ${callback_endpoint}  body=${BODY}
    &{rsp}=  Create Mock Response Schema	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}

Post Threshold Crossed Notification
    ${json}=	Get File	jsons/ThresholdCrossedNotification.json
    ${BODY}=	evaluate	json.loads('''${json}''')	json
    Log  Creating mock request and response to handle Threshold Crossed Notification
    &{req}=  Create Mock Request Matcher Schema	POST  ${callback_endpoint}  body=${BODY}
    &{rsp}=  Create Mock Response Schema	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${req}  ${rsp}
    Sleep  ${sleep_interval}
    Log  Verifying results
    Verify Mock Expectation  ${req}
    Log  Cleaning the endpoint
    Clear Requests  ${callback_endpoint}

*** Keywords ***
Create Sessions
    Start Process  java  -jar  mockserver-netty-5.3.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
	Create Session  server  ${callback_uri}:${callback_port}
    Create Mock Session  ${callback_uri}:${callback_port}
 No newline at end of file
+19 −0
Original line number Original line Diff line number Diff line
*** Variables ***
${VNFM_HOST}      localhost    # Hostname of the VNFM
${VNFM_PORT}      8080    # Listening port of the VNFM
${NFVO_HOST}      localhost    # Hostname of the NFVO
${NFVO_PORT}      8081    # Listening port of the NFVO
${VNFM_SCHEMA}    https
${NFVO_SCHEMA}    https
${AUTHORIZATION}    Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${CONTENT_TYPE_JSON}    application/json
${ACCEPT_JSON}    application/json
${apiRoot}        /
${AUTH_USAGE}     1
${NEG_AUTHORIZATION}    Bearer negativetoken
${apiVersion}     v1
${apiName}        vnfpm
${FIELD_USAGE}    1
${VNFM_AUTHENTICATION}    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
${VNFM_AUTH_USAGE}    1
${VNFM_DUPLICATION}    1
+13 −0
Original line number Original line Diff line number Diff line
{
	"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
+16 −0
Original line number Original line Diff line number Diff line
{
	"id": "id",
	"notificationType" : "ThresholdCrossedNotification",
	"subscriptionId ": "subscriptionId",
	"timeStamp": "2012-04-21T18:25:43-05:00",
	"thresholdId": "thresholdId",
	"crossingDirection": "UP",
	"objectInstanceId": "vnfID",
	"performanceMetric": "performanceMetric",
	"performanceValue": 7
	"_links": {
			"subscription": "link to subscription",
			"threshold": "link to threshold"
	}
	
}
 No newline at end of file
+1 −0
Original line number Original line Diff line number Diff line
{  "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
Loading