Commit ef03dcc0 authored by Hammad Zafar's avatar Hammad Zafar Committed by Giacomo Bernini
Browse files

Notification Consumer resource added in PolicyManagement-API

parent f72b9fa2
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
*** Settings ***
Resource   environment/variables.txt
Resource   PolicyManagementKeywords.robot  
Suite Setup    Check resource existence and get CallbackUri

*** Test Cases ***
Policy Change Notification
    [Documentation]    Test ID: 10.3.1.9.1
    ...    Test title: Policy Change Notification
    ...    Test objective: The objective is to test that Policy Change Notification is delivered with success to the notification consumer.
    ...    Pre-conditions: A subscription for policy change notification is available in the NFV-MANO.
    ...    Reference: Clause 5.5.9.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    POST Policy Change Notification
    Check HTTP Response Status Code Is    204
    
Policy Conflict Notification
    [Documentation]    Test ID: 10.3.1.9.2
    ...    Test title: Policy Conflict Notification
    ...    Test objective: The objective is to test that Policy Conflict Notification is delivered with success to the notification consumer.
    ...    Pre-conditions: A subscription for policy conflict notification is available in the NFV-MANO.
    ...    Reference: Clause 5.5.9.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    POST Policy Conflict Notification
    Check HTTP Response Status Code Is    204
 No newline at end of file
+30 −0
Original line number Diff line number Diff line
@@ -297,3 +297,33 @@ Check Postcondition Individual Subscription is Deleted
    GET individual Subscription
    Check HTTP Response Status Code Is    404 

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}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    200
    Validate Json    response body    PolicySubscription.schema.json
    Set Global Variable    ${callbackResp}    response body callbackUri

POST Policy Change Notification
    log    Trying to perform a POST to deliver 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/PolicyChangeNotification.json  
    ${body}=    Format String    ${template}    subscriptionId=${subscriptionId}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Policy Conflict Notification
    log    Trying to perform a POST to deliver 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/PolicyConflictNotification.json  
    ${body}=    Format String    ${template}    subscriptionId=${subscriptionId}    policyId1=${policyId1}    policyId2=${policyId2}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
+3 −2
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ ${response} {}

${NFVMANO_DUPLICATION}    1

${vnfInstanceDescription}    description vnf
${vnfInstanceDescription_Update}    Updated description vnf 
${SINGLE_FILE_VNFD}    1    # If VNFD is PLAIN TEXT
${ACCEPT_PLAIN}    text/plain
${ACCEPT_ZIP}     application/zip
@@ -50,6 +48,9 @@ ${polling_interval} 10 sec
${notification_request}    []
${notification_response}    []

${policyId1}
${policyId2}

${callbackResp}		127.0.0.1

${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
+10 −0
Original line number Diff line number Diff line
{{
  "id": "",
  "notificationType": "PolicyChangeNotification",
  "subscriptionId": "{subscriptionId}",
  "timeStamp": "",
  "changeType": "",
  "_links": {{
  	"subscription": ""
  }}
}}
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
{{
  "id": "",
  "notificationType": "PolicyConflictNotification",
  "subscriptionId": "{subscriptionId}",
  "timeStamp": "",
  "policyIds": ["{policyId1}","{policyId2}"],
  "selectedVersions": ["v1","v1"], 
  "conflictDescription": "",
  "_links": {{
  	"subscription": "",
  	"objectInstances": []
  }}
}}
 No newline at end of file