Commit 1774783d authored by Elian Kraja's avatar Elian Kraja
Browse files

Fixing issues: #1, #2, #3 and #4

parent a2c59eaf
Loading
Loading
Loading
Loading
+32 −18
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ Set new VNF Configuration
    Send VNF configuration
    Send VNF configuration
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Contains    Etag
    Check HTTP Response Header Contains    Etag
    Check HTTP Response Body Json Schema Is   vnfConfigModifications
    Check HTTP Response Body Json Schema Is   vnfConfigModifications.schema.json
    Check Postcondition VNF Is Configured
    Check Postcondition VNF Is Configured


Get information about a VNF configuration
Get information about a VNF configuration
@@ -34,7 +34,7 @@ Get information about a VNF configuration
    ...    Post-Conditions: The VNF configuration is not modified by the operation
    ...    Post-Conditions: The VNF configuration is not modified by the operation
    Get VNF configuration
    Get VNF configuration
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   vnfConfiguration
    Check HTTP Response Body Json Schema Is   vnfConfiguration.schema.json
    Check Postcondition VNF Configuration Untouched (Implicit)
    Check Postcondition VNF Configuration Untouched (Implicit)


Get information about a VNF configuration - with HTTP Etag
Get information about a VNF configuration - with HTTP Etag
@@ -50,7 +50,7 @@ Get information about a VNF configuration - with HTTP Etag
    Get VNF configuration
    Get VNF configuration
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Contains    Etag
    Check HTTP Response Header Contains    Etag
    Check HTTP Response Body Json Schema Is   vnfConfiguration
    Check HTTP Response Body Json Schema Is   vnfConfiguration.schema.json
    Check Postcondition VNF Configuration Untouched (Implicit)
    Check Postcondition VNF Configuration Untouched (Implicit)


Set new VNF Configuration - HTTP Etag precondition failed
Set new VNF Configuration - HTTP Etag precondition failed
@@ -114,7 +114,9 @@ Get VNF configuration
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Log    Execute Query and validate response
    ${response}=    Get    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Get    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    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    
@@ -122,24 +124,28 @@ Send VNF configuration
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"} 
    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
    ${response}=    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}


Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    [Arguments]    ${expected_status}    
    Should Be Equal    ${response.status_code}    ${expected_status}
    ${status}=    Convert To Integer    ${expected_status}    
    Should Be Equal    ${response[0]['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}
    Should Contain    ${response.headers}    ${CONTENT_TYPE}
    Log    ${response[0]['headers']}
    Should Contain    ${response[0]['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}
    ${contentType}=    Get Value From Json    ${response.headers}    $..Content-Type
    ${file_schema}=    Get File    ${schema}    
    Should Be Equal    ${contentType}    ${CONTENT_TYPE}
    ${json_schema}=     evaluate    json.loads('''${schema}''')    json
    ${json}=    evaluate    json.loads('''${response.body}''')    json
    Should Contain    ${response[0]['headers']['Content-Type']}    ${CONTENT_TYPE}
    Validate Json    ${schema}    ${json}
    Validate Json    ${schema}    ${response[0]['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK
      
      
Check Postcondition VNF Configuration Untouched (Implicit)
Check Postcondition VNF Configuration Untouched (Implicit)
@@ -149,9 +155,9 @@ Check Postcondition VNF Configuration Untouched (Implicit)
Check Postcondition VNF Is Configured
Check Postcondition VNF Is Configured
    Log    Check Postcondition for VNF Configuration
    Log    Check Postcondition for VNF Configuration
    Get VNF configuration
    Get VNF configuration
    ${output}=    evaluate    json.loads('''${response.body}''')    json
    ${input_file}=    Get File    jsons/vnfConfigModifications.json
    ${input}=    Get File    jsons/vnfConfigModifications.json
    ${input}=    evaluate    json.loads('''${input_file}''')    json
    Should Be Equal  ${output}    ${input} 
    Should Be Equal  ${response[0]['body']}    ${input} 


Send Duplicated VNF configuration
Send Duplicated VNF configuration
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that Etag has been modified
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that Etag has been modified
@@ -161,22 +167,30 @@ Send Duplicated VNF configuration
    Set Headers    {"If-Match": "${Etag}"}
    Set Headers    {"If-Match": "${Etag}"}
    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
    ${response}=    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    ${output}=    Output    response
    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
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${response}=    Post    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Post    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    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
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${response}=    Put    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Put    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${output}=    Output    response
    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
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${response}=    Delete    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Delete    ${apiRoot}/${apiName}/${apiVersion}/configuration
 No newline at end of file
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
 No newline at end of file
+2 −23
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
@@ -20,25 +20,4 @@ ${alarm_filter} managedObjectId
${managedObjectId}    007c111c-38a1-42c0-a666-7475ecb1567c
${managedObjectId}    007c111c-38a1-42c0-a666-7475ecb1567c
${invalid_alarm_filter}    badFilter
${invalid_alarm_filter}    badFilter
${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${vnfInstanceDescription}    description vnf
${vnfInstanceDescription_Update}    Updated description vnf
${SINGLE_FILE_VNFD}    1    # If VNFD is PLAIN TEXT
${ACCEPT_PLAIN}    text/plain
${ACCEPT_ZIP}     application/zip
${vnfPkgId_processing}    007c111c-38a1-42c0-a666-7475ecb1567c
${ARTIFACT_TYPE}    application/octet-stream
${ARTIFACT_ID}    artifactId
${WRONG_ACCEPT}    application/json
${vnfLcmOpOccId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${CancelMode}    GRACEFUL
${LccnSubscriptionRequest}    {}
${NVFM_DUPLICATION}    0
${sub_filter}    filter
${sub_filter_invalid}    filter_invalid
${subscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${notification_ep}    /notification
${notification_port}    9091
${AlarmNotification}    {}
${AlarmClearedNotification}    {}
${AlarmListRebuiltNotification}    {}
${PerceivedSeverity}    CRITICAL
+1 −1
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ DELETE Subscription - Negative (Not Found)
    Log    The subscriptionId is not present in database
    Log    The subscriptionId is not present in database
    ${contentType}=    Output    response headers Content-Type
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    Should Contain    ${contentType}    application/json
    ${problemDetails}=    Output
    ${problemDetails}=    Output    response body
    Log    Trying to validate ProblemDetails
    Log    Trying to validate ProblemDetails
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    Log    Validation OK
+1 −1
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ POST Subscription
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    json/subscriptions.json
    ${body}=    Get File    jsons/subscriptions.json
    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    ${body}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}
    Integer    response status    201
    Integer    response status    201