Commit 219ebb1a authored by Eisha Ayaz's avatar Eisha Ayaz
Browse files

[test-new][SOL003][VNF-OP-GRANT][v5.3.1][7.3.2.x.x Test-IDs][NFVSOL(26)000093]...

[test-new][SOL003][VNF-OP-GRANT][v5.3.1][7.3.2.x.x Test-IDs][NFVSOL(26)000093] New tests for 401/404 gaps identified by tacker
parent 2e0d5ff8
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -188,6 +188,18 @@ Requests a grant for a particular VNF lifecycle operation - Synchronous mode wit
    Send Request Grant Request in Synchronous mode with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails
Requests a grant for a particular VNF lifecycle operation - Unauthorized
    [Documentation]    Test ID: 7.3.2.1.13
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Unauthorized
    ...    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 with unauthorized access
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Request Grant Request in Synchronous mode - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
*** Keywords ***
Wait for individual grant successful notification
+25 −1
Original line number Diff line number Diff line
@@ -102,3 +102,27 @@ DELETE an individual grant - Method not implemented
    ...    Post-Conditions: none
    Delete individual Grant
    Check HTTP Response Status Code Is    405
GET an individual grant - Unauthorized
    [Documentation]    Test ID: 7.3.2.2.8
    ...    Test title: GET an individual grant - Unauthorized
    ...    Test objective: The objective is to retrieve a grant for a particular VNF Lifecycle Operation without proper authorization.
    ...    Pre-conditions: The  grant information is available to the NFVO
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get individual grant - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
GET an individual grant - Not found
    [Documentation]    Test ID: 7.3.2.2.9
    ...    Test title: GET an individual grant - Not found
    ...    Test objective: The objective is to retrieve a grant for a particular VNF Lifecycle Operation that does not exist.
    ...    Pre-conditions: The grant information is not available to the NFVO
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get individual grant - Not found
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
+24 −2
Original line number Diff line number Diff line
@@ -27,7 +27,17 @@ Send Request Grant Request in Synchronous mode
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/grants    ${body}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}

Send Request Grant Request in Synchronous mode - Unauthorized
    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}"}
    Set Headers    {"Version": "${API_VERSION}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the Descriptor File
    ${template}=    Get File    jsons/grantRequest.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 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
@@ -214,7 +224,19 @@ Get individual grant
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}
    
Get individual grant - Unauthorized
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Version": "${API_VERSION}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}
Get individual grant - Not Found
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Version": "${API_VERSION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${notFoundGrantId}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}    
Check resource existence
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ ${CONTENT_TYPE} application/json
${ACCEPT}         application/json
${AUTH_USAGE}     1
${grantId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d

${notFoundGrantId}      notFoundGrantId
${apiRoot}        /
${apiName}        grant
${apiMajorVersion}     v1