Commit d633b029 authored by AHMADABB's avatar AHMADABB
Browse files

Reference corrections + Individual Alarms Sol3 Fault management

parent 253a1893
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ Get information about multiple alarms with filters
    ...    Test title: Get information about multiple alarms with filters 
    ...    Test title: Get information about multiple alarms with filters 
    ...    Test objective: The objective is to retrieve information about the alarm list and perform a JSON schema and content validation of the returned alarms data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Test objective: The objective is to retrieve information about the alarm list and perform a JSON schema and content validation of the returned alarms data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Pre-conditions: none 
    ...    Pre-conditions: none 
    ...    Reference: section 7.4.2 - SOL003 v2.4.1
    ...    Reference: section 7.4.2.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: none
    ...    Post-Conditions: none
@@ -52,7 +52,7 @@ Get information about multiple alarms Bad Request Invalid attribute-based filter
    ...    Test title:  The objective is to try to retrieve information about the alarm list and perform a JSON schema and content validation of the returned problem details data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Test title:  The objective is to try to retrieve information about the alarm list and perform a JSON schema and content validation of the returned problem details data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Pre-conditions: 
    ...    Pre-conditions: 
    ...    Reference: section 7.4.2 - SOL003 v2.4.1
    ...    Reference: section 7.4.2.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: 
    ...    Post-Conditions: 
    ...    Post-Conditions: 
+35 −11
Original line number Original line Diff line number Diff line
@@ -8,10 +8,21 @@ Library OperatingSystem


Library    Process
Library    Process


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

*** Keywords ***
*** Keywords ***
Check Postcondition VNF fault management alarms Exists
Check Postcondition VNF fault management alarms Exists
    Log    Checking that subscriptions exists
    Log    Checking that alarms exists
    GET Fault Management Alarms
    GET Fault Management Alarms
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarms

Check Postcondition VNF fault management individual alarm Exists
    Log    Checking that individual alarm exists
    GET Fault Management Individual Alarm
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    alarm  
      
      
Check Individual Subscription existance
Check Individual Subscription existance
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Accept":"${ACCEPT}"}
@@ -101,7 +112,7 @@ GET Fault Management Alarms With Invalid Filters
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse} 
	Set Global Variable    @{response}    ${outputResponse} 
	
	
Do POST Individual Alarm
Send POST request for fault management Individual Alarm
    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}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -109,7 +120,7 @@ Do POST Individual Alarm
    ${outputResponse}=    Output    response 
    ${outputResponse}=    Output    response 
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do DELETE Individual Alarm
DELETE Fault Management Individual Alarm
    log    Trying to perform a DELETE. This method should not be implemented
    log    Trying to perform a DELETE. 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}"}
@@ -117,7 +128,7 @@ Do DELETE Individual Alarm
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do PUT Individual Alarm
PUT Fault Management Individual Alarm
    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}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -125,17 +136,19 @@ Do PUT Individual Alarm
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}


Do GET Individual Alarm
GET Fault Management Individual Alarm
    Log    Query NFVO The GET method queries information about an alarm.
    Log    Query VNF The GET method queries information about an alarm.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    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 
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${etag}    Output    response headers ETag
    Set Suite Variable    &{original_etag}    ${etag}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do GET Invalid Individual Alarm
GET Fault Management Individual Alarm with invalid id
    Log    Query NFVO The GET method queries information about an invalid alarm. Should return does not exist
    Log    Query NFVO The GET method queries information about an invalid alarm. Should return does not exist
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
@@ -145,17 +158,28 @@ Do GET Invalid Individual Alarm
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}
   
   
Do PATCH Individual Alarm
PATCH Fault Management Individual Alarm
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    
PATCH Fault Management Individual Alarm - precondition failed
    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}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}
   
   
Do PATCH Individual Alarm Conflict
PATCH Fault Management Individual Alarm Conflict
    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}"} 
+73 −102
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
Resource    environment/variables.txt 
Resource    environment/variables.txt 
Resource    FaultManagement-APIKeyword.robot
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
Library    OperatingSystem
Library    OperatingSystem
Library    JSONLibrary
Library    JSONLibrary
@@ -8,127 +9,97 @@ 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
     [Documentation]    Test ID: 7.3.5.2.1
    Set Headers  {"Accept":"${ACCEPT}"}  
    ...    Test title: POST Alarm - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that Post method is not allowed to create Fault management individual alarm on VNF 
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ...    Pre-conditions: none
    Log    Validate Status code
    ...    Reference: section 7.4.3.3.1 - SOL003 v2.4.1
    Output    response
    ...    Config ID: Config_prod_VNFM
    Integer    response status    405
    ...    Applicability: none
    ...    Post-Conditions: none  
    Send POST request for fault management Individual Alarm
    Check HTTP Response Status Code Is    405   


Get information about an alarm
Get information about an fault management individual alarm
    [Documentation]    Test ID: 7.4.3.1
    [Documentation]    Test ID: 7.3.5.2.2
    ...    Test title: Get information about an alarm
    ...    Test title: Get information about an fault management individual alarm
    ...    Test objective: The objective is to read an individual alarm.
    ...    Test objective: The objective is to retrieve information about an individual alarm and perform a JSON schema and content validation of the returned alarm data structure
    ...    Pre-conditions: The related alarm exists
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 7.4.3 - SOL003 v2.4.1
    ...    Reference: section 7.4.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions:   
    ...    Post-Conditions:  none 
    Log    Query VNF The GET method queries information about an alarm.
    GET Fault Management Individual Alarm
    Set Headers  {"Accept":"${ACCEPT}"}  
    Check HTTP Response Status Code Is    200
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Check HTTP Response Body Json Schema Is    alarm
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${etag}    Output    response headers ETag
    Set Suite Variable    &{original_etag}    ${etag}
    Log    Validate Status code
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    Validate Json    alarm.schema.json    ${result}
    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
    [Documentation]    Test ID: 7.3.5.2.3
    Set Headers  {"Accept":"${ACCEPT}"}  
    ...    Test title: PUT Alarm - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ...    Test objective: he objective is to test that PUT method is not allowed to for Fault management individual alarm on VNF 
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ...    Pre-conditions: The related alarm exists
    Log    Validate Status code
    ...    Reference: section 7.4.3.3.3 - SOL003 v2.4.1
    Integer    response status    405
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:  none 
    PUT Fault Management Individual Alarm
    Check HTTP Response Status Code Is    405


PATCH Alarm
PATCH Fault Management Individual Alarm
    [Documentation]    Test ID: 7.4.3.2
    [Documentation]    Test ID: 7.4.5.2.4
    ...    Test title: Modify an individual alarm resource
    ...    Test title: PATCH Fault Management Individual Alarm
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Test objective: The objective is to Modify an individual alarm resource and perform a JSON schema and content validation of the returned alarm data structure
    ...    Pre-conditions: The related alarm exists
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 7.4.3 - SOL003 v2.4.1
    ...    Reference: section 7.4.3.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: 
    ...    Post-Conditions: none
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Check Postcondition VNF fault management individual alarm Exists
    Set Headers  {"Accept":"${ACCEPT}"} 
    PATCH Fault Management Individual Alarm
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Check HTTP Response Status Code Is    200
    Set Headers    {"If-Match": "${original_etag[0]}"}
    Check HTTP Response Body Json Schema Is  alarmModification
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    ${Etag_modified}=    Output    response headers ETag
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    Validate Json    AlarmModification.schema.json    ${result}
    Log    Validation OK


PATCH Alarm - Precondition failed
Modify an individual alarm resource - Precondition failed
    [Documentation]    Test ID: 7.4.3.2-1
    [Documentation]    Test ID: 7.4.5.2.5
    ...    Test title: Modify an individual alarm resource - Precondition failed
    ...    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 test that we cannot Modify an individual alarm resource if the alarm is already in the state that is requested to be set
    ...    Pre-conditions: The related alarm exists
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 7.4.3 - SOL003 v2.4.1
    ...    Reference: section 7.4.3.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: The alarm resource is not modified
    ...    Post-Conditions: none
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that Etag has been modified
    Check Postcondition VNF fault management individual alarm Exists  
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    PATCH Fault Management Individual Alarm - precondition failed
    Set Headers  {"Accept":"${ACCEPT}"} 
    Check HTTP Response Status Code Is    409
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Check HTTP Response Body Json Schema Is  ProblemDetails
    Set Headers    {"If-Match": "${original_etag[0]}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Integer    response status    412
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK



Modify an individual alarm resource - Conflict
PATCH Alarm - Conflict
    [Documentation]    Test ID: 7.4.5.2.6
    [Documentation]    Test ID: 7.4.3.2-1
    ...    Test title: Modify an individual alarm resource - Conflict
    ...    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 test that we cannot Modify an individual alarm resource if the resource was modified by another entity
    ...    Pre-conditions: The related alarm exists
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 7.4.3 - SOL003 v2.4.1
    ...    Reference: section 7.4.3.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: The alarm resource is not modified
    ...    Post-Conditions: none
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Depends On Test    PATCH Fault Management Individual Alarm
    Set Headers  {"Accept":"${ACCEPT}"} 
    Check Postcondition VNF fault management individual alarm Exists
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    PATCH Fault Management Individual Alarm Conflict
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Check HTTP Response Status Code Is    412
    ${body}=    Get File    jsons/alarmModifications.json
    Check HTTP Response Body Json Schema Is     ProblemDetails
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}    ${body}
    Log    Validate Status code
    Integer    response status    409
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK



DELETE Alarm - Method not implemented
DELETE Alarm - Method not implemented
    log    Trying to perform a DELETE. This method should not be implemented
     [Documentation]    Test ID: 7.3.5.2.7
    Set Headers  {"Accept":"${ACCEPT}"}  
    ...    Test title: DELETE Alarm - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that DELETE method is not allowed to for Fault management individual alarm on VNF 
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ...    Pre-conditions: nona
    Log    Validate Status code
    ...    Reference: section 7.4.3.3.5 - SOL003 v2.4.1
    Integer    response status    405   
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:  The individual alarm still exists 
    DELETE Fault Management Individual Alarm
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF fault management individual alarm Exists
 No newline at end of file