Commit bdf6fcc0 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added interconnected test case for subscription creation and query test id 11.3.7

parent a9625a2b
Loading
Loading
Loading
Loading
+106 −3
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ GET status information about multiple VNF LCM Operation OCC
    ...    Test title: GET status information about multiple VNF LCM Operation OCC
    ...    Test objective: The objective is to test that GET method retrieve Query status information about multiple VNF lifecycle management operation occurrences.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.12.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 5.4.12.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none   
@@ -184,7 +184,7 @@ Get Individual VNF LCM Operation occurrence
    ...    Test title: Get Individual VNF LCM Operation occurrences
    ...    Test objective: The objective is to test that this method retrieve information about a VNF lifecycle management operation occurrence 
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.13.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 5.4.13.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -193,6 +193,58 @@ Get Individual VNF LCM Operation occurrence
    Check HTTP Response Body Json Schema Is    VnfLcmOpOcc 
    Check HTTP Response Body of Individual VNF LCM Operation occurrences content against VNF Descriptor

POST Create a new subscription
    [Documentation]    Test ID: 7.3.1.17.1
    ...    Test title: POST Create a new subscription
    ...    Test objective: The POST method creates a new subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.18.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: in response header Location shall not be null
    Post Create subscription
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    Subscription

GET Subscriptions
    [Documentation]    Test ID: 7.3.1.17.4
    ...    Test title: GET Subscriptions
    ...    Test objective: The objective is Get the list of active subscriptions
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.18.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get subscriptions [keyword]
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Subscriptions

GET Individual Subscription
    [Documentation]    Test ID: 7.3.1.18.2
    ...    Test title: GET Individual Subscription
    ...    Test objective: The objective is to test the Get individual subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.19.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get Individual Subscription [keyword]
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Subscription

DELETE an individual subscription
    [Documentation]    Test ID: 7.3.1.18.5
    ...    Test title: DELETE an individual subscription
    ...    Test objective: The objective is to test that the individual subscription is succesfully deleted
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.19.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: Subscription deleted from VNFM
    Delete Individual subscription
	Check HTTP Response Status Code Is    204
    Check Postcondition Subscription Resource is Deleted

GET Individual VNF Package [keyword]
    Log    Trying to get a VNF Package present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -633,3 +685,54 @@ Match the VNF LCM Operation Occurence Response Attributes with Descriptors
    List Should Contain Value    ${VDU_IDs}    ${response['body']['resourceChanges']['affectedVnfcs'][0]['vduId']}
    List Should Contain value    ${Storage_IDs}    ${response['body']['resourceChanges']['affectedVirtualStorages'][0]['virtualStorageDescId']}
    List Should Contain Value    ${VirtualLink_IDs}    ${response['body']['resourceChanges']['affectedVirtualLinks'][0]['virtualStorageDescId']}

Post Create subscription
    Log    Create subscription instance by POST to ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/subscriptions
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/lccnSubscriptionRequest.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}:${callback_port}    callback_endpoint=${callback_endpoint}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/subscriptions    ${body}    allow_redirects=false
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
    Set Global Variable    ${globalSubscriptionId}    ${outputResponse['body']['id']}
	Log    Verify notification endpoint is tested
	Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}

Get subscriptions [keyword]
    Log    Get the list of active subscriptions
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Log    Execute Query and validate response
    Get    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/subscriptions	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	

Get Individual subscription [keyword]
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/subscriptions/${globalSubscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Delete Individual subscription
    log    Try to delete an individual subscription
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/subscriptions/${globalSubscriptionId}  	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Check Postcondition Subscription Resource Is Deleted
    Get Individual subscription [keyword] 
    Integer    response status    404
    Log    Subscription Resource deleted
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
*** Settings ***
Resource          environment/variables.txt    # Generic Parameters
Resource          IC_TC_keywords.robot
Library           JSONLibrary

*** Test Cases ***

Create a new subscription and query information about multiple and individual subscription resources​
    [Documentation]    Test ID: 11.3.7
    ...    Test title: Create a new subscription and query information about multiple and individual subscription resources​
    ...    Test objective: The objective is to test the interconnected case of subscription resource creation and query multiple and individual resources
    ...    Pre-conditions: none
    ...    Reference: ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_NFVO, Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Package
    POST Create a new subscription
    GET Subscriptions
    GET Individual Subscription

+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ ${notInstantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${notExistingVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${vnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${subscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${globalSubscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${vnfInstanceId_NoSnapshotTask}    no-snapshot-task-supported
${vnfSnapshotInfoId}
${vnfSnapshotInfoId_InUse}    snapshotId-of-a-resource-AlreadyInUse-bySomeOther-operation
+10 −0
Original line number Diff line number Diff line
{{
  "filter": {{
    "vnfInstanceSubscriptionFilter": {{
      "vnfdIds": [
        "6fc3539c-e602-4afa-8e13-962fb5a7d81f"
      ]
    }}
  }},
  "callbackUri": "{callback_uri}{callback_endpoint}"
}}