Commit 0b364a4f authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

fixed http response variable

parent e82d84ad
Loading
Loading
Loading
Loading
+13 −13
Original line number Original line Diff line number Diff line
@@ -112,7 +112,7 @@ Get VNF configuration
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Get    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send VNF configuration
Send VNF configuration
    log    Trying to perform a PATCH. This method modifies the configuration    
    log    Trying to perform a PATCH. This method modifies the configuration    
@@ -121,27 +121,27 @@ Send VNF configuration
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/vnfConfigModifications.json
    ${body}=    Get File    jsons/vnfConfigModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Set Suite Variable    &{etag}    ${response[0]['headers']['ETag']}
    Set Suite Variable    &{etag}    ${response['headers']['ETag']}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    [Arguments]    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    Should Be Equal    ${response[0]['status']}    ${status}
    Should Be Equal    ${response['status']}    ${status}
    Log    Status code validated
    Log    Status code validated


Check HTTP Response Header Contains
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
    Log    ${response[0]['headers']}
    Log    ${response['headers']}
    Should Contain    ${response[0]['headers']}    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    Log    Header is present
    
    
Check HTTP Response Body Json Schema Is
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    [Arguments]    ${input}
    Should Contain    ${response[0]['headers']['Content-Type']}    application/json
    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    ${input}    .schema.json
    ${schema} =    Catenate    ${input}    .schema.json
    Validate Json    ${schema}    ${response[0]['body']}
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK
      
      
Check Postcondition VNF Configuration Unmodified (Implicit)
Check Postcondition VNF Configuration Unmodified (Implicit)
@@ -157,7 +157,7 @@ Check Postcondition VNF Is Configured
    Get VNF configuration
    Get VNF configuration
    ${input_file}=    Get File    jsons/vnfConfigModifications.json
    ${input_file}=    Get File    jsons/vnfConfigModifications.json
    ${input}=    evaluate    json.loads('''${input_file}''')    json
    ${input}=    evaluate    json.loads('''${input_file}''')    json
    Should Be Equal  ${response[0]['body']}    ${input} 
    Should Be Equal  ${response['body']}    ${input} 


Send Duplicated VNF configuration
Send Duplicated VNF configuration
    Depends On Test    Send VNF configuration    # If the previous test scceeded, it means that Etag has been modified
    Depends On Test    Send VNF configuration    # If the previous test scceeded, it means that Etag has been modified
@@ -169,7 +169,7 @@ Send Duplicated VNF configuration
    ${body}=    Get File    jsons/vnfConfigModifications.json
    ${body}=    Get File    jsons/vnfConfigModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send POST Request for VNF Configuration
Send POST Request for VNF Configuration
    log    Trying to perform a POST. This method should not be implemented
    log    Trying to perform a POST. This method should not be implemented
@@ -177,7 +177,7 @@ Send POST Request for VNF Configuration
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Post    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send PUT Request for VNF Configuration
Send PUT Request for VNF Configuration
    log    Trying to perform a POST. This method should not be implemented
    log    Trying to perform a POST. This method should not be implemented
@@ -185,7 +185,7 @@ Send PUT Request for VNF Configuration
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Put    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send DELETE Request for VNF Configuration
Send DELETE Request for VNF Configuration
    log    Trying to perform a POST. This method should not be implemented
    log    Trying to perform a POST. This method should not be implemented
@@ -193,4 +193,4 @@ Send DELETE Request for VNF Configuration
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Delete    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
 No newline at end of file
 No newline at end of file
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@


${Etag}=    an etag
${Etag}=    an etag
${Etag_modified}=    12345
${Etag_modified}=    12345
@{response}=    httpresponse
${response}=    httpresponse


${EM-VNF_HOST}      localhost    # Hostname of the NFVO
${EM-VNF_HOST}      localhost    # Hostname of the NFVO
${EM-VNF_PORT}      8081    # Listening port of the NFVO
${EM-VNF_PORT}      8081    # Listening port of the NFVO
+16 −16
Original line number Original line Diff line number Diff line
@@ -104,7 +104,7 @@ Get Individual VNF Indicator Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


GET Individual VNF Indicator Subscription with invalid resource identifier
GET Individual VNF Indicator Subscription with invalid resource identifier
    Log    Trying to perform a request on a subscriptionID which doesn't exist
    Log    Trying to perform a request on a subscriptionID which doesn't exist
@@ -112,7 +112,7 @@ GET Individual VNF Indicator Subscription with invalid resource identifier
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send Delete Request for Individual VNF Indicator Subscription
Send Delete Request for Individual VNF Indicator Subscription
    Log    Trying to perform a DELETE on a subscriptionId
    Log    Trying to perform a DELETE on a subscriptionId
@@ -120,7 +120,7 @@ Send Delete Request for Individual VNF Indicator Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier
Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
@@ -128,14 +128,14 @@ Send Delete Request for Individual VNF Indicator Subscription with invalid resou
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send Post Request for Individual VNF Indicator Subscription
Send Post Request for Individual VNF Indicator Subscription
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}   
    Set Suite Variable    ${response}    ${output}   


Send Put Request for Individual VNF Indicator Subscription
Send Put Request for Individual VNF Indicator Subscription
    Log    Trying to perform a PUT. This method should not be implemented
    Log    Trying to perform a PUT. This method should not be implemented
@@ -143,38 +143,38 @@ Send Put Request for Individual VNF Indicator Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    ${origOutput}=    Output    response
    Set Suite Variable    @{origResponse}    ${origOutput}
    Set Suite Variable    ${origResponse}    ${origOutput}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}   
    Set Suite Variable    ${response}    ${output}   


Send Patch Request for Individual VNF Indicator Subscription
Send Patch Request for Individual VNF Indicator Subscription
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    ${origOutput}=    Output    response
    Set Suite Variable    @{origResponse}    ${origOutput}
    Set Suite Variable    ${origResponse}    ${origOutput}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    [Arguments]    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    Should Be Equal    ${response[0]['status']}    ${status}
    Should Be Equal    ${response['status']}    ${status}
    Log    Status code validated
    Log    Status code validated


Check HTTP Response Header Contains
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
    Log    ${response[0]['headers']}
    Log    ${response['headers']}
    Should Contain    ${response[0]['headers']}    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    Log    Header is present
    
    
Check HTTP Response Body Json Schema Is
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    [Arguments]    ${input}
    Should Contain    ${response[0]['headers']['Content-Type']}    application/json
    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    ${input}    .schema.json
    ${schema} =    Catenate    ${input}    .schema.json
    Validate Json    ${schema}    ${response[0]['body']}
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK


Check Postcondition Individual VNF Indicator Subscription is Deleted
Check Postcondition Individual VNF Indicator Subscription is Deleted
@@ -186,8 +186,8 @@ Check Postcondition VNF individual subscription Unmodified (Implicit)
    Log    Check Postcondition subscription is not modified
    Log    Check Postcondition subscription is not modified
    GET Individual VNF Indicator Subscription
    GET Individual VNF Indicator Subscription
    Log    Check Response matches original subscription
    Log    Check Response matches original subscription
    ${subscription}=    evaluate    json.loads('''${response[0]['body']}''')    json
    ${subscription}=    evaluate    json.loads('''${response['body']}''')    json
    Should Be Equal    ${origResponse[0]['body']['callbackUri']}    ${subscription.callbackUri}
    Should Be Equal    ${origResponse['body']['callbackUri']}    ${subscription.callbackUri}
    
    
Check Postcondition VNF individual subscription is not created
Check Postcondition VNF individual subscription is not created
    Log    Check Postcondition subscription is not created
    Log    Check Postcondition subscription is not created
+15 −15
Original line number Original line Diff line number Diff line
@@ -89,7 +89,7 @@ Get Individual Indicator for a VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Get Individual Indicator for a VNF instance with invalid indicator identifier
Get Individual Indicator for a VNF instance with invalid indicator identifier
    Log    Trying to perform a negative get, using wrong identifier
    Log    Trying to perform a negative get, using wrong identifier
@@ -97,7 +97,7 @@ Get Individual Indicator for a VNF instance with invalid indicator identifier
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send POST Request for individual indicator in VNF instance
Send POST Request for individual indicator in VNF instance
    Log    Trying to perform a POST (method should not be implemented)
    Log    Trying to perform a POST (method should not be implemented)
@@ -105,7 +105,7 @@ Send POST Request for individual indicator in VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${notAllowedIndicatorId}
    POST    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${notAllowedIndicatorId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send PUT Request for individual indicator in VNF instance
Send PUT Request for individual indicator in VNF instance
    Log    Trying to perform a PUT. This method should not be implemented
    Log    Trying to perform a PUT. This method should not be implemented
@@ -113,7 +113,7 @@ Send PUT Request for individual indicator in VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send PATCH Request for individual indicator in VNF instance
Send PATCH Request for individual indicator in VNF instance
    Log    Trying to perform a PATCH. This method should not be implemented
    Log    Trying to perform a PATCH. This method should not be implemented
@@ -121,7 +121,7 @@ Send PATCH Request for individual indicator in VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output} 
    Set Suite Variable    ${response}    ${output} 
     
     
Send DELETE Request for individual indicator in VNF instance
Send DELETE Request for individual indicator in VNF instance
    Log    Trying to perform a DELETE. This method should not be implemented
    Log    Trying to perform a DELETE. This method should not be implemented
@@ -129,37 +129,37 @@ Send DELETE Request for individual indicator in VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output} 
    Set Suite Variable    ${response}    ${output} 


Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    [Arguments]    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    Should Be Equal    ${response[0]['status']}    ${status}
    Should Be Equal    ${response['status']}    ${status}
    Log    Status code validated
    Log    Status code validated


Check HTTP Response Header Contains
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
    Log    ${response[0]['headers']}
    Log    ${response['headers']}
    Should Contain    ${response[0]['headers']}    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    Log    Header is present
    
    
Check HTTP Response Body Json Schema Is
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    [Arguments]    ${input}
    Should Contain    ${response[0]['headers']['Content-Type']}    application/json
    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    ${input}    .schema.json
    ${schema} =    Catenate    ${input}    .schema.json
    Validate Json    ${schema}    ${response[0]['body']}
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK


Check HTTP Response Body Includes Requested Indicator ID
Check HTTP Response Body Includes Requested Indicator ID
    Log    Check Response includes propoer VNF instance and Indicator identifiers
    Log    Check Response includes propoer VNF instance and Indicator identifiers
    Should Be Equal    ${response[0]['body']['id']}    ${indicatorId}
    Should Be Equal    ${response['body']['id']}    ${indicatorId}


Check HTTP Response Body Includes Requested VNF Instance ID
Check HTTP Response Body Includes Requested VNF Instance ID
    Log    Check Response includes propoer VNF instance and Indicator identifiers
    Log    Check Response includes propoer VNF instance and Indicator identifiers
    Should Be Equal    ${response[0]['body']['vnfInstanceId']}    ${vnfInstanceId}
    Should Be Equal    ${response['body']['vnfInstanceId']}    ${vnfInstanceId}


Check Postcondition Indicator for VNF instance Exist
Check Postcondition Indicator for VNF instance Exist
    Log    Check Response includes VNF Indicator
    Log    Check Response includes VNF Indicator
    Get Individual Indicator for a VNF instance
    Get Individual Indicator for a VNF instance
    Should Be Equal    ${response[0]['body']['vnfInstanceId']}    ${vnfInstanceId}
    Should Be Equal    ${response['body']['vnfInstanceId']}    ${vnfInstanceId}
    Should Be Equal    ${response[0]['body']['id']}    ${indicatorId}
    Should Be Equal    ${response['body']['id']}    ${indicatorId}
+15 −15
Original line number Original line Diff line number Diff line
@@ -143,7 +143,7 @@ Get all VNF indicators
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    ${body}=    evaluate    json.loads('''${response.body}''')    json
    ${body}=    evaluate    json.loads('''${response.body}''')    json
    Set Suite Variable    @{vnfIndicators}    ${body}
    Set Suite Variable    @{vnfIndicators}    ${body}
    
    
@@ -154,7 +154,7 @@ Get VNF indicators with filter
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS}
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Get VNF indicators with invalid filter
Get VNF indicators with invalid filter
    Log    The GET method queries multiple VNF indicators using invalid Attribute-based filtering parameters
    Log    The GET method queries multiple VNF indicators using invalid Attribute-based filtering parameters
@@ -163,7 +163,7 @@ Get VNF indicators with invalid filter
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS}
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Get all VNF indicators with invalid authorization token
Get all VNF indicators with invalid authorization token
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as EM/VNF is not supporting authentication
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as EM/VNF is not supporting authentication
@@ -173,7 +173,7 @@ Get all VNF indicators with invalid authorization token
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Get all VNF indicators without authorization token
Get all VNF indicators without authorization token
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as EM/VNF is not supporting authentication
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as EM/VNF is not supporting authentication
@@ -182,7 +182,7 @@ Get all VNF indicators without authorization token
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Get all VNF indicators with invalid resource endpoint
Get all VNF indicators with invalid resource endpoint
    Log    The GET method queries multiple VNF indicators omitting token
    Log    The GET method queries multiple VNF indicators omitting token
@@ -191,7 +191,7 @@ Get all VNF indicators with invalid resource endpoint
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Get    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send POST Request for all VNF indicators
Send POST Request for all VNF indicators
    log    Trying to perform a POST. This method should not be implemented
    log    Trying to perform a POST. This method should not be implemented
@@ -199,7 +199,7 @@ Send POST Request for all VNF indicators
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send PUT Request for all VNF indicators
Send PUT Request for all VNF indicators
    log    Trying to perform a PUT. This method should not be implemented
    log    Trying to perform a PUT. This method should not be implemented
@@ -207,7 +207,7 @@ Send PUT Request for all VNF indicators
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send PATCH Request for all VNF indicators
Send PATCH Request for all VNF indicators
    log    Trying to perform a PATCH. This method should not be implemented
    log    Trying to perform a PATCH. This method should not be implemented
@@ -215,7 +215,7 @@ Send PATCH Request for all VNF indicators
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Send DELETE Request for all VNF indicators
Send DELETE Request for all VNF indicators
    log    Trying to perform a DELETE. This method should not be implemented
    log    Trying to perform a DELETE. This method should not be implemented
@@ -223,27 +223,27 @@ Send DELETE Request for all VNF indicators
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    Post    ${apiRoot}/${apiName}/${apiVersion}/indicators
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}
    [Arguments]    ${expected_status}
    ${status}=    Convert To Integer    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    Should Be Equal    ${response[0]['status']}    ${status} 
    Should Be Equal    ${response['status']}    ${status} 
    Log    Status code validated
    Log    Status code validated
    
    
Check HTTP Response Status Code Is 40x  
Check HTTP Response Status Code Is 40x  
    Should Contain Any    ${response[0]['status']}    401    403
    Should Contain Any    ${response['status']}    401    403
    Log    Status code validated
    Log    Status code validated


Check HTTP Response Header Contains
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
    Should Contain    ${response[0]['headers']}    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    Log    Header is present
    
    
Check HTTP Response Body Json Schema Is
Check HTTP Response Body Json Schema Is
    [Arguments]    ${schema}
    [Arguments]    ${schema}
    Should Contain    ${response[0]['headers']['Content-Type']}    application/json
    Should Contain    ${response['headers']['Content-Type']}    application/json
    Validate Json    ${schema}    ${response[0]['body']}
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK


Check Postcondition VNF Indicators Exist
Check Postcondition VNF Indicators Exist
Loading