Commit 04d7f175 authored by Najam UI Hassan's avatar Najam UI Hassan
Browse files

New Resource NotificationConsumer added

parent 0e0d6857
Loading
Loading
Loading
Loading
+47 −0
Original line number Original line Diff line number Diff line
*** Settings ***
Library    String
Resource    environment/variables.txt
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Suite Setup    Check resource existence and get CallbackUri

*** Test Cases ***
Vr Quota Availibility Notification
    [Documentation]    Test ID: 7.3.7.4.1
    ...    Test title: Vr Quota Availibility Notification
    ...    Test objective: The objective is to test that Vr Quota Availibility Notification is delivered with success to the notification consumer
    ...    Pre-conditions: The VNF has subscribed to the Vr Quota Availibility resource
    ...    Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v2.7.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions:  none
    Post Vr Quota Avail Notification
    Check HTTP Response Status Code Is    204
    
*** Keywords ***
Check resource existence and get CallbackUri
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    Integer    response status    200
    Validate Json    response body    VrQuotaAvailSubscription.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 Vr Quota Avail Notification
    log    Trying to perform a POST to get notification
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${template} =    Get File    jsons/VrQuotaAvailNotification.json
    ${body}=        Format String   ${template}    subscriptionId=${subscriptionId}   
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
 No newline at end of file
+3 −1
Original line number Original line Diff line number Diff line
@@ -28,3 +28,5 @@ ${VrQuotaAvailNotification} {}
${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar


${response}    {}
${response}    {}

${callbackResp}    127.0.0.1
 No newline at end of file
+9 −0
Original line number Original line Diff line number Diff line
 
{{
	"id":"",
	"notificationType":"VrQuotaAvailNotification",
	"subscriptionId":"{subscriptionId}",
	"timeStamp":"",
	"resourceGroupId":"",
	"_links":""
}}
 No newline at end of file