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

Merge branch '4.3.1-dev-SOL003-VNFOpGranting' into '4.3.1-dev'

SOL003 VNF Lifecycle Operation Granting - Implementation of deltas between v4.3.1 and v3.6.1

See merge request nfv/api-tests!271
parents 25b0f2ae 0c86fab2
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ POST API Version - Method not implemented
    ...    Test title: POST API version - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none    
@@ -25,7 +25,7 @@ GET API Version
    ...    Test title: GET API Version
    ...    Test objective: The objective is to test that GET method successfully return ApiVersionInformation
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -38,7 +38,7 @@ PUT API Version - Method not implemented
    ...    Test title: PUT API Version - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -50,7 +50,7 @@ PATCH API Version - Method not implemented
    ...    Test title: PATCH API Version - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -62,7 +62,7 @@ DELETE API Version - Method not implemented
    ...    Test title: DELETE API Version - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -74,7 +74,7 @@ POST API Version with apiMajorVerion - Method not implemented
    ...    Test title: POST API version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none    
@@ -86,7 +86,7 @@ GET API Version with apiMajorVerion
    ...    Test title: GET API Version with apiMajorVerion
    ...    Test objective: The objective is to test that GET method successfully return ApiVersionInformation
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -99,7 +99,7 @@ PUT API Version with apiMajorVerion - Method not implemented
    ...    Test title: PUT API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -111,7 +111,7 @@ PATCH API Version with apiMajorVerion - Method not implemented
    ...    Test title: PATCH API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -123,7 +123,7 @@ DELETE API Version with apiMajorVerion - Method not implemented
    ...    Test title: DELETE API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v3.5.1
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v4.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
+51 −9
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ Requests a grant for a particular VNF lifecycle operation - Synchronous mode
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Synchronous mode
    ...    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] v3.6.1
    ...    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.
@@ -36,7 +36,7 @@ Requests a grant for a particular VNF lifecycle operation - Asynchronous mode
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Asynchronous mode
    ...    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] v3.6.1
    ...    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 not decide immediately what to respond to a grant request
    ...    Post-Conditions: The grant information is available to the VNFM.
@@ -51,7 +51,7 @@ Requests a grant for a particular VNF lifecycle operation - Forbidden
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Forbidden 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation and the grant is rejected
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -64,7 +64,7 @@ GET Grants - Method not implemented
    ...    Test title: GET Grants - Method not implemented
    ...    Test objective: The objective is to test that GET method is not allowed for Life cycle operation granting 
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions:   none
@@ -76,7 +76,7 @@ PUT Grants - Method not implemented
    ...    Test title: PUT Grants - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed for Life cycle operation granting 
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -88,7 +88,7 @@ PATCH Grants - Method not implemented
    ...    Test title: PATCH Grants - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -100,13 +100,55 @@ DELETE Grants - Method not implemented
    ...    Test title: DELETE Grants - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.5 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.2.3.5 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions:  resources are not deleted
    Delete Grants
    Check HTTP Response Status Code Is    405

Requests a grant for a particular VNF lifecycle operation - Synchronous mode using instantiationLevelId for Target size
    [Documentation]    Test ID: 7.3.2.1.8
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Synchronous mode using instantiationLevelId 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 instantiationLevelId
    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 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
+7 −7
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ POST Individual Grant - Method not implemented
    ...    Test title: POST Individual Grant - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -30,7 +30,7 @@ GET an individual grant - Successful
    ...    Test title: GET an individual grant - Successful
    ...    Test objective: The objective is to retrieve a grant for a particular VNF Lifecycle Operation.
    ...    Pre-conditions: The  grant information is available to the NFVO
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -45,7 +45,7 @@ GET an individual grant - Process ongoing
    ...    Test title: GET an individual grant - Process ongoing
    ...    Test objective: The objective is to retrieve a grant for a particular VNF lifecycle operation when process is ongoing and no grant is available yet.
    ...    Pre-conditions: The process of creating the grant is ongoing, no grant is available yet.
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -59,7 +59,7 @@ GET an individual grant - grant rejected
    ...    Test title: GET an individual grant - grant rejected
    ...    Test objective: The objective is to retrieve a grant for a particular VNF Lifecycle Operation but error returned because grant has been rejected.
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -72,7 +72,7 @@ PUT an individual grant - Method not implemented
    ...    Test title: PUT an individual grant - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -84,7 +84,7 @@ PATCH an individual grant - Method not implemented
    ...    Test title: PATCH an individual grant - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -96,7 +96,7 @@ DELETE an individual grant - Method not implemented
    ...    Test title: DELETE an individual grant - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v3.6.1
    ...    Reference: Clause 9.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
+39 −0
Original line number Diff line number Diff line
@@ -27,6 +27,45 @@ Send Request Grant Request in Synchronous mode
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}

Send Request Grant Request in Synchronous mode with attribute instantiationLevelId
    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/grantRequestWithAttributeInstantiationLevelId.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${Descriptor_ID}    flavourId=${Flavour_ID}    instantiationLevelId=${instantiationLevelId}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/grants    ${body}
    ${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
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ ${VNFM_SCHEMA} https
${subscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${vnfInstanceId}    myVnfInstanceId
${vnfLcmOpOccId}    myLcmOccId
${instantiationLevelId}

${descriptorType}    SOL001
${check_descriptors}	1
@@ -36,6 +37,8 @@ ${VDU_IDs}
${externalCP_IDs}
${Compute_IDs}

${scaleAspectId}

${Descriptor_ID}
${Provider}
${Product_Name}
Loading