Commit e03ac559 authored by Elian Kraja's avatar Elian Kraja
Browse files

Bug fixing: issues #14-#19, #21-#23, #28, #29

parent 9fc274a4
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ Set new VNF Configuration
    ...    Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration
    ...    Post-Conditions: The configuration is successfully set in the VNF and it matches the issued 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.schema.json
    Check HTTP Response Body Json Schema Is   vnfConfigModifications.schema.json
    Check Postcondition VNF Is Configured
    Check Postcondition VNF Is Configured


@@ -48,7 +48,7 @@ Get information about a VNF configuration with HTTP Etag
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    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.schema.json
    Check HTTP Response Body Json Schema Is   vnfConfiguration.schema.json


Set new VNF Configuration - HTTP Etag precondition unsuccessful
Set new VNF Configuration - HTTP Etag precondition unsuccessful
@@ -121,6 +121,7 @@ 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']}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    @{response}    ${output}


@@ -158,11 +159,11 @@ Check Postcondition VNF Is Configured
    Should Be Equal  ${response[0]['body']}    ${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    Send VNF configuration    # If the previous test scceeded, it means that Etag has been modified
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"If-Match": "${Etag}"}
    Set Headers    {"If-Match": "${etag[0]}"}
    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}
+24 −13
Original line number Original line Diff line number Diff line
@@ -8,6 +8,10 @@ Library JSONSchemaLibrary schemas/
Library    DependencyLibrary
Library    DependencyLibrary




*** Variables **
${original_etag}    1234


*** Test Cases ***
*** Test Cases ***
POST Alarm - Method not implemented
POST Alarm - Method not implemented
    log    Trying to perform a POST. This method should not be implemented
    log    Trying to perform a POST. This method should not be implemented
@@ -17,6 +21,7 @@ POST Alarm - Method not implemented
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    405
    Integer    response status    405



Get information about a configuration
Get information about a configuration
    [Documentation]    Test ID: 7.4.3.1
    [Documentation]    Test ID: 7.4.3.1
    ...    Test title: Get information about an alarm
    ...    Test title: Get information about an alarm
@@ -32,15 +37,17 @@ Get information about a configuration
    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
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${Etag}=    Output    response headers Etag
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    200
    Integer    response status    200
    ${etag}    Output    response header ETag
    Set Suite Variable    &{original_etag}    ${etag}
    ${contentType}=    Output    response headers Content-Type
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    ${result}=    Output    response body
    Validate Json    alarm.schema.json    ${result}
    Validate Json    alarm.schema.json    ${result}
    Log    Validation OK
    Log    Validation OK



PUT Alarm - Method not implemented
PUT Alarm - Method not implemented
    log    Trying to perform a PUT. This method should not be implemented
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -49,6 +56,7 @@ PUT Alarm - Method not implemented
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    405
    Integer    response status    405



PATCH Alarm
PATCH Alarm
    [Documentation]    Test ID: 7.4.3.2
    [Documentation]    Test ID: 7.4.3.2
    ...    Test title: Modify an individual alarm resource
    ...    Test title: Modify an individual alarm resource
@@ -61,11 +69,11 @@ PATCH Alarm
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Set Headers  {"If-Match": "${original_etag[0]}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/alarmModifications.json
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Log    Validate Status code
    ${Etag_modified}=    Output    response headers Etag
    Integer    response status    200
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    Should Contain    ${contentType}    ${CONTENT_TYPE}
@@ -73,47 +81,50 @@ PATCH Alarm
    Validate Json    alarmModifications.schema.json    ${result}
    Validate Json    alarmModifications.schema.json    ${result}
    Log    Validation OK
    Log    Validation OK
    
    
PATCH Alarm - Conflict



PATCH Alarm - Precondition failed
    [Documentation]    Test ID: 7.4.3.2-1
    [Documentation]    Test ID: 7.4.3.2-1
    ...    Test title: Modify an individual alarm resource - Conflict
    ...    Test title: Modify an individual alarm resource - Precondition failed
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Pre-conditions: The related alarm exists
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 7.4.3 - SOL002 v2.4.1
    ...    Reference: section 7.4.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions: The alarm resource is not modified
    ...    Post-Conditions: The alarm resource is not modified
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that the alarm is in ackownledged state
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that Etag has been modified
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Set Headers    {"If-Match": "${original_etag[0]}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/alarmModifications.json
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    409
    Integer    response status    412
    ${problemDetails}=    Output    response body
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    Log    Validation OK


PATCH Alarm - Precondition failed
PATCH Alarm - Conflict
    [Documentation]    Test ID: 7.4.3.2-1
    [Documentation]    Test ID: 7.4.3.2-1
    ...    Test title: Modify an individual alarm resource - Precondition failed
    ...    Test title: Modify an individual alarm resource - Conflict
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Pre-conditions: The related alarm exists
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 7.4.3 - SOL002 v2.4.1
    ...    Reference: section 7.4.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions: The alarm resource is not modified
    ...    Post-Conditions: The alarm resource is not modified
    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 the alarm is in ackownledged state
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    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/alarmModifications.json
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    412
    Integer    response status    409
    ${problemDetails}=    Output    response body
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    Log    Validation OK
+2 −2
Original line number Original line Diff line number Diff line
@@ -16,8 +16,8 @@ ${CONTENT_TYPE} application/json
${VNFM_DUPLICATION}    0
${VNFM_DUPLICATION}    0


${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${Etag}=    an etag
${etags}    a modified etag
${Etag_modified}=    a modified etag
${wrong_etag}    wrong-tag    
${CONTENT_TYPE_PATCH}    application/merge-patch+json
${CONTENT_TYPE_PATCH}    application/merge-patch+json


${PerceivedSeverity}    CRITICAL
${PerceivedSeverity}    CRITICAL
+0 −17
Original line number Original line Diff line number Diff line
@@ -38,23 +38,6 @@ Post Cancel operation task Conflict (Not-FAILED_TEMP)
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    Log    Validation OK


Post Cancel operation task Conflict (parallel LCM operation)
    # TODO: Need to set the pre-condition of the test
    [Documentation]    Conflict
    ...    The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. 
    ...    Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, 
    ...    or another error handling action is starting, such as retry or rollback. 
    ...    The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error.
    [Setup]    Launch another error handling action
    log    Final Fail an operation
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel
    Log    Validate Status code
    Integer    response status    409
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    #[Teardown]    #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished


Post Cancel operation task Not Found
Post Cancel operation task Not Found
    # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
    # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
+1 −21
Original line number Original line Diff line number Diff line
@@ -21,26 +21,6 @@ Change external VNF connectivity
    Should Contain    ${headers}    Location
    Should Contain    ${headers}    Location
    Log    Validation OK
    Log    Validation OK


Change external VNF connectivity Conflict (parallel LCM operation)
    # TODO: Need to set the pre-condition of the test
    [Documentation]    Conflict
    ...    The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. 
    ...    Typically, this is due to the fact that another LCM operation is ongoing.
    ...    The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error.
    [Setup]    Launch another LCM operation
    log    Trying to change the deployment flavour of a VNF instance.
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/changeExtVnfConnectivityRequest .json
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn    ${body}
    Log    Validate Status code
    Integer    response status    409
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    #[Teardown]    #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished
       


GET Change external VNF connectivity - Method not implemented
GET Change external VNF connectivity - Method not implemented
    log    Trying to perform a GET. This method should not be implemented
    log    Trying to perform a GET. This method should not be implemented
Loading