Commit 214eee4b authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

updated tests on 412 for SOL003

parent 76e2aa0f
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -10,9 +10,6 @@ Library MockServerLibrary

Library    Process

*** Variables ***
${original_etag}    1234

*** Keywords ***
Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}  -serverPort  ${callback_port}  alias=mockInstance
@@ -209,8 +206,6 @@ GET Fault Management Individual Alarm
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}
    ${etag}    Output    response headers ETag
    Set Suite Variable    &{original_etag}    ${etag}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
    
@@ -234,11 +229,11 @@ PATCH Fault Management Individual Alarm
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
    
PATCH Fault Management Individual Alarm - precondition failed
PATCH Fault Management Individual Alarm - Etag mismatch
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Set Headers    {"If-Match": "${original_etag[0]}"}
    Set Headers    {"If-Match": "${invalid_etag}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}    ${body}
+6 −9
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ PATCH Fault Management Individual Alarm
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Check Precondition VNF fault management individual alarm Exists
    PATCH Fault Management Individual Alarm
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is  alarmModification
@@ -63,32 +62,30 @@ PATCH Fault Management Individual Alarm
Modify an individual alarm resource - Precondition failed
    [Documentation]    Test ID: 7.3.5.2.5
    ...    Test title: Modify an individual alarm resource - Precondition failed
    ...    Test objective: The objective is to test that an individual alarm resource cannot be modified if the alarm is already in the state that is requested to be set
    ...    Test objective: The objective is to test that an individual alarm resource cannot be modified if the resource was modified by another entity
    ...    Pre-conditions: The related alarm exists
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v3.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Check Precondition VNF fault management individual alarm Exists  
    PATCH Fault Management Individual Alarm - precondition failed
    Check HTTP Response Status Code Is    409
    PATCH Fault Management Individual Alarm - Etag mismatch
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is  ProblemDetails

Modify an individual alarm resource - Conflict
    [Documentation]    Test ID: 7.3.5.2.6
    ...    Test title: Modify an individual alarm resource - Conflict
    ...    Test objective: The objective is to test that an individual alarm resource cannot be modified if the resource was modified by another entity
    ...    Test objective: The objective is to test that an individual alarm resource cannot be modified if the alarm is already in the state that is requested to be set 
    ...    Pre-conditions: The related alarm exists
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v2.7.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Depends On Test    PATCH Fault Management Individual Alarm
    Check Precondition VNF fault management individual alarm Exists
    PATCH Fault Management Individual Alarm Conflict
    Check HTTP Response Status Code Is    412
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is     ProblemDetails


DELETE Alarm - Method not implemented
     [Documentation]    Test ID: 7.3.5.2.7
    ...    Test title: DELETE Alarm - Method not implemented
+4 −4
Original line number Diff line number Diff line
@@ -65,13 +65,13 @@ PATCH Individual VNFInstance
PATCH Individual VNFInstance Precondition failed
     [Documentation]    Test ID: 7.3.1.2.5
    ...    Test title: PATCH Individual VNFInstance Precondition failed
    ...    Test objective: The objective is to create a new VNF instance resource
    ...    Pre-conditions:  ETag mismatch
    ...    Test objective: The objective is to test that modification of a VNF instance resource fails when a precondition given in an HTTP request header is not fulfilled due to an ETag mismatch
    ...    Pre-conditions:  an existing VNF instance resource
    ...    Reference: Clause 5.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v3.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: VNFInstance not modified
    PATCH individual vnfInstance
    ...    Post-Conditions: none
    PATCH individual vnfInstance - Etag mismatch
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is    ProblemDetails

+14 −0
Original line number Diff line number Diff line
@@ -571,6 +571,20 @@ PATCH individual vnfInstance
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

PATCH individual vnfInstance - Etag mismatch
    log    Trying to modify an individual VNF instance
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Set Headers    {"If-Match": "${invalid_etag}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the Descriptor File
    ${template}=    Get File    jsons/patchBodyRequest.json
    ${body}=        Format String   ${template}     vnfdId=${Descriptor_ID}    vnfdVersion= ${Descriptor_Version}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId}    ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

	
DELETE individual vnfInstance
    log    Trying to delete an individual VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ ${apiMajorVersion} v2
${CancelMode}    GRACEFUL
${VNFM_DUPLICATION}    0

${invalid_etag}    invalid etag

${NFVO_HOST}      localhost    # Hostname of the NFVO
${NFVO_PORT}      8081    # Listening port of the NFVO
${NFVO_SCHEMA}    https
Loading