Commit 96b2fe77 authored by Najam UI Hassan's avatar Najam UI Hassan
Browse files

New Resource NotificationConsumer added

parent 63d2ff08
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@ Library JSONSchemaLibrary schemas/


*** Test Cases ***
*** Test Cases ***
POST API Version - Method not implemented
POST API Version - Method not implemented
    [Documentation]    Test ID: 5.3.4.9.1
    [Documentation]    Test ID: 5.3.4.10.1
    ...    Test title: POST API version - Method not implemented
    ...    Test title: POST API version - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Pre-conditions: none
+68 −0
Original line number Original line Diff line number Diff line
*** Settings ***
Library    JSONSchemaLibrary    schemas/
Resource    environment/variables.txt
Library    JSONLibrary
Library    OperatingSystem
Library    String
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Suite Setup    Check resource existence and get CallbackUri

*** Test Cases ***
NS Performance Information Availability Notification
    [Documentation]    Test ID: 5.3.4.10.1
    ...    Test title: NS Performance Information Availability Notification
    ...    Test objective: The objective is to test that NS Performance Information Availability Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A NS performance job is created, and information availability notifications is available in the NFVO.
    ...    Reference: Clause 7.4.9.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post NS Performance Information Availability Notification
    Check HTTP Response Status Code Is    204
    
NS Threshold Crossed Notification
    [Documentation]    Test ID: 5.3.4.10.2
    ...    Test title: NS Threshold Crossed Notification
    ...    Test objective: The objective is to test that NS Threshold Crossed Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A NS performance job is created, and threshold crossed notifications is available in the NFVO.
    ...    Reference: Clause 7.4.9.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post NS Threshold Crossed Notification
    Check HTTP Response Status Code Is    204
    
*** Keywords ***
Check resource existence and get CallbackUri
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}
    Integer    response status    200
    Validate Json    response body    PmJob.schema.json
    Set Global Variable    ${callbackResp}    response body callbackUri

Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 
    
Post NS Performance Information Availability Notification
    log    Trying to perform a POST to get notification
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body} =    Get File    jsons/PerformanceInformationAvailableNotification.json  
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Post NS Threshold Crossed Notification
    log    Trying to perform a POST to get notification
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body} =    Get File    jsons/ThresholdCrossedNotification.json  
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
 No newline at end of file
+2 −0
Original line number Original line Diff line number Diff line
@@ -64,3 +64,5 @@ ${newReportId} newReportId
${FILTER_OK_Threshold}      objectInstanceId=1f50d68b-82e8-4deb-bd40-c934d4d1ac0a
${FILTER_OK_Threshold}      objectInstanceId=1f50d68b-82e8-4deb-bd40-c934d4d1ac0a
${FILTER_KO}      criterias=erroneousFilter
${FILTER_KO}      criterias=erroneousFilter
${SEPERATOR}      =
${SEPERATOR}      =

${callbackResp}    127.0.0.1
 No newline at end of file
+1 −3
Original line number Original line Diff line number Diff line
{
{
	"id": "id",
	"id": "id",
	"notificationType" : "PerformanceInformationAvailableNotification",
	"notificationType" : "PerformanceInformationAvailableNotification",
	"subscriptionId ": "subscriptionId",
	"timeStamp": "2012-04-21T18:25:43-05:00",
	"timeStamp": "2012-04-21T18:25:43-05:00",
	"objectInstanceId": "vnfID",
	"objectInstanceId": "vnfID",
	"_links": {
	"_links": {
			"subscription": "link to subscription",
			"objectInstance": "link to instance",
			"pmJob" : "link to PMJob",
			"pmJob" : "link to PMJob",
			"performanceReport": "link to PerformanceReport"
			"performanceReport": "link to PerformanceReport"
	}
	}
	
}
}
 No newline at end of file
+1 −2
Original line number Original line Diff line number Diff line
{
{
	"id": "id",
	"id": "id",
	"notificationType": "ThresholdCrossedNotification",
	"notificationType": "ThresholdCrossedNotification",
	"subscriptionId ": "subscriptionId",
	"timeStamp": "2012-04-21T18:25:43-05:00",
	"timeStamp": "2012-04-21T18:25:43-05:00",
	"thresholdId": "thresholdId",
	"thresholdId": "thresholdId",
	"crossingDirection": "UP",
	"crossingDirection": "UP",
@@ -9,7 +8,7 @@
	"performanceMetric": "performanceMetric",
	"performanceMetric": "performanceMetric",
	"performanceValue": 7,
	"performanceValue": 7,
	"_links": {
	"_links": {
		"subscription": "link to subscription",
		"objectInstance": "objectInstance",
		"threshold": "link to threshold"
		"threshold": "link to threshold"
	}
	}