Commit 7e949edc authored by Ayesha Ayub's avatar Ayesha Ayub Committed by Giacomo Bernini
Browse files

add json files in SOL003 VNF Lifecycle Operation Granting API

parent 40973ee8
Loading
Loading
Loading
Loading
+30 −2
Original line number Diff line number Diff line
@@ -121,6 +121,34 @@ Requests a grant for a particular VNF lifecycle operation - Synchronous mode usi
    Check Operation Occurrence Id existence 
    Check HTTP Response Body Json Schema Is    grant    

Requests a grant for a particular VNF lifecycle operation - Synchronous mode using targetScaleLevelInfo for Target size
    [Documentation]    Test ID: 7.3.2.1.9
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Synchronous mode using targetScaleLevelInfo for Target size 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation and perform a JSON schema validation on the returned grant data structure
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO can decide immediately what to respond to a grant request
    ...    Post-Conditions: The grant information is available to the VNFM.
    Send Request Grant Request in Synchronous mode with attribute targetScaleLevelInfo
    Check HTTP Response Status Code Is    201
    Check Operation Occurrence Id existence 
    Check HTTP Response Body Json Schema Is    grant    

Requests a grant for a particular VNF lifecycle operation - Synchronous mode using attribute addResources for Target size
    [Documentation]    Test ID: 7.3.2.1.10
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Synchronous mode using with attribute addResources for Target size 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation and perform a JSON schema validation on the returned grant data structure
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO can decide immediately what to respond to a grant request
    ...    Post-Conditions: The grant information is available to the VNFM.
    Send Request Grant Request in Synchronous mode with attribute addResources
    Check HTTP Response Status Code Is    201
    Check Operation Occurrence Id existence 
    Check HTTP Response Body Json Schema Is    grant

*** Keywords ***
Wait for individual grant successful notification
    Wait Until Keyword Succeeds    ${retry}   ${polling}    Get an individual grant - Successful
 No newline at end of file
+27 −1
Original line number Diff line number Diff line
@@ -40,6 +40,32 @@ Send Request Grant Request in Synchronous mode with attribute instantiationLevel
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}   

Send Request Grant Request in Synchronous mode with attribute targetScaleLevelInfo
    Log    Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants
    Pass Execution If    ${SYNC_MODE} == 0    The Granting process is asynchronous mode. Skipping the test
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the Descriptor File
    ${template}=    Get File    jsons/grantRequestWithAttributeTargetScaleLevelInfo.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${Descriptor_ID}    flavourId=${Flavour_ID}    aspectId=${scaleAspectId}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/grants    ${body}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}

Send Request Grant Request in Synchronous mode with attribute addResources
    Log    Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants
    Pass Execution If    ${SYNC_MODE} == 0    The Granting process is asynchronous mode. Skipping the test
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the Descriptor File
    ${template}=    Get File    jsons/grantRequestWithAttributeAddResources.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${Descriptor_ID}    flavourId=${Flavour_ID}   
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/grants    ${body}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}         
    
Send Request Grant Request in Asynchronous mode
    Log    Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants
    Pass Execution If    ${SYNC_MODE} == 1    The Granting process is synchronous mode. Skipping the test
+2 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ ${VDU_IDs}
${externalCP_IDs}
${Compute_IDs}

${scaleAspectId}

${Descriptor_ID}
${Provider}
${Product_Name}
+23 −0
Original line number Diff line number Diff line
{{
    "vnfInstanceId": "{vnfInstanceId}",
    "vnfLcmOpOccId": "{vnfLcmOpOccId}",
    "vnfdId": "{vnfdId}",
    "flavourId": "{flavourId}",
    "operation": "INSTANTIATE",
    "isAutomaticInvocation": true,
    "addResources": [
        {
            "id": "",
            "type": "",
            "resourceTemplateId": []
        }
    ],
    "_links": {{
      "vnfLcmOpOcc": {{
        "href": "string"
      }},
      "vnfInstance": {{
        "href": "string"
      }}
    }}
  }}
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
{{
    "vnfInstanceId": "{vnfInstanceId}",
    "vnfLcmOpOccId": "{vnfLcmOpOccId}",
    "vnfdId": "{vnfdId}",
    "flavourId": "{flavourId}",
    "operation": "INSTANTIATE",
    "isAutomaticInvocation": true,
    "targetScaleLevelInfo": [
        {
            "aspectId": "{scaleAspectId}",
            "scaleLevel": 2
        }
    ],
    "_links": {{
      "vnfLcmOpOcc": {{
        "href": "string"
      }},
      "vnfInstance": {{
        "href": "string"
      }}
    }}
  }}
 No newline at end of file