Commit 4082ae7a authored by Najam UI Hassan's avatar Najam UI Hassan
Browse files

New Resource NotificationConsumer added

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

*** Test Cases ***
VNF Package Onboarding Notification
    [Documentation]    Test ID: 5.3.5.13.1
    ...    Test title: VNF Package Onboarding Notification
    ...    Test objective: The objective is to test that VNF Package Onboarding Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A VNF package subscription for onboarding notifications is available in the NFVO.
    ...    Reference: Clause 9.4.10.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post VNF Package Onboarding Notification
    Check HTTP Response Status Code Is    204
    
VNF Package Change Notification
    [Documentation]    Test ID: 5.3.5.13.2
    ...    Test title: VNF Package Change Notification
    ...    Test objective: The objective is to test that VNF Package Change Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A VNF package subscription for change notifications is available in the NFVO.
    ...    Reference: Clause 9.4.10.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post VNF Package Change 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}/subscriptions/${subscriptionId}
    Integer    response status    200
    Validate Json    response body    PkgmSubscription.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 VNF Package Onboarding 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}"}
    ${template} =    Get File    jsons/VnfPackageOnboardingNotification.json
    ${body}=        Format String   ${template}    subscriptionId=${subscriptionId}    vnfPkgId=${vnfPkgId}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Post VNF Package Change 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}"}
    ${template} =    Get File    jsons/VnfPackageChangeNotification.json
    ${body}=        Format String   ${template}    subscriptionId=${subscriptionId}    vnfPkgId=${vnfPkgId}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
 No newline at end of file
+2 −1
Original line number Original line Diff line number Diff line
@@ -84,3 +84,4 @@ ${vnfPkgUri} http://localhost/content.zip


${NFVO_non-MANO_OK}    1    # If 1 means that non-MANO artifacts are supported by the NFVO
${NFVO_non-MANO_OK}    1    # If 1 means that non-MANO artifacts are supported by the NFVO
${non_mano_artifact_sets} 
${non_mano_artifact_sets} 
${callbackResp}    127.0.0.1
 No newline at end of file
+10 −0
Original line number Original line Diff line number Diff line
{{
	"id":"",
	"notificationType":"VnfPackageChangeNotification",
	"subscriptionId":"{subscriptionId}",
	"timeStamp":"",
	"vnfPkgId":"{vnfPkgId}",
	"vnfdId":"",
	"changeType":"PKG_DELETE",
	"_links":""
}}
+10 −0
Original line number Original line Diff line number Diff line
{{
	"id":"",
	"notificationType":"VnfPackageOnboardingNotification",
	"subscriptionId":"{subscriptionId}",
	"timeStamp":"",
	"vnfPkgId":"{vnfPkgId}",
	"vnfdId":"",
	"vnfmInfo":"",
	"_links":""
}}