Commit 4ee5aa49 authored by Eisha Ayaz's avatar Eisha Ayaz Committed by Giacomo Bernini
Browse files

[keywords-new][SOL002][VNF-LCM][v5.2.1][6.3.5.x.x Test-IDs] Fix Location...

[keywords-new][SOL002][VNF-LCM][v5.2.1][6.3.5.x.x Test-IDs] Fix Location Header identifier across LCM APIs
parent b28935b8
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -40,10 +40,32 @@ Check Operation Occurrence Id
    ${vnfLcmOpOccId}=    Get Value From Json    ${response['headers']}    $..Location
    Should Not Be Empty    ${vnfLcmOpOccId}

Check Operation Occurrence Resource Available
    Log    Fetching resource pointed by Location header
    GET    ${response['headers']['Location']}
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    ${result}=    Output    response body
    Validate Json    schemas/vnfLcmOpOcc.schema.json    ${result}
    Log    Operation Occurrence resource validated

Check HTTP Location Header Contains URI of Created Resource
    ${URI}=    Get Value From Json    ${response['headers']}    $..Location
    Should Not Be Empty    ${URI}

Check Postcondition VNF Snapshot Resource Returned in Location Header Is Available
    Log   Going to check post condition
    Get    ${response['headers']['Location']}
    Integer   response status 200
    Log   Received a 200 OK as expected
    ${contentType}=   Output   response headers Content-Type
    Should Contain   ${contentType}   application/json
    ${result}=   Output   response body
    Validate Json   schemas/VnfSnapshotInfo.schema.json   ${result}
    Log   Validated subscription schema  


Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    Run Keyword If    '${input}' == 'ProblemDetails'    Should Contain    ${response['headers']['Content-Type']}    application/problem+json
@@ -52,6 +74,16 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK

Check Postcondition Subscription Resource Returned in Location Header Is Available
    Log   Going to check post condition
    Get    ${response['headers']['Location']}
    Integer   response status 200
    Log   Received a 200 OK as expected
    ${contentType}=   Output   response headers Content-Type
    Should Contain   ${contentType}   application/json
    ${result}=   Output   response body
    Validate Json   schemas/subscription.schema.json   ${result}
    Log   Validated subscription schema  


Check resource Instantiated
@@ -92,6 +124,16 @@ Check HTTP Response Header Contains
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
         
Check Postcondition Resource Returned in Location Header Is Available
    Log    Going to check postcondition
    GET    ${response['headers']['Location']}
    Integer    response status    200
    Log    Received a 200 OK as expected
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    ${result}=    Output    response body
    Validate Json    schemas/vnfInstance.schema.json    ${result}
    Log    Validated vnfInstance schema
Check HTTP Response Header Contains ETag and Last-Modified
    Pass Execution If    ${HEADER_TEST_SUPPORTED} == 0    Headers testing not supported. Skipping the Test.
    Log    ${response['headers']}