Commit 7fbe0ec2 authored by AHMADABB's avatar AHMADABB
Browse files

Added Modifications to alarm List + Added Individual Alarm Tests +

update OperationKeywords File.
parent 8d67588f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@ POST Alarms - Method not implemented
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


Get information about multiple alarms 
Get information about multiple alarms 
    [Documentation]    Test ID: 8.4.2.2
    [Documentation]    Test ID: 8.4.2.2-1
    ...    Test title: Get information about multiple alarms
    ...    Test title: Get information about multiple alarms
    ...    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: 
+116 −0
Original line number Original line Diff line number Diff line
*** Settings ***
# Suite setup     Expect spec    SOL003-VNFLifecycleManagement-API.yaml
Resource   environment/variables.txt
Resource   NSFMOperationKeywords.robot  
Library    REST     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    OperatingSystem
Library    DependencyLibrary

*** Test Cases ***
POST Individual Alarm - Method not implemented
     [Documentation]    Test ID: 8.4.3.1
    ...    Test title:POST Individual Alarm - Method not implemented
    ...    Test objective: The objective is to post alarms
    ...    Pre-conditions: 
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions:  
    Do POST Individual Alarm
    Check HTTP Response Status Code Is    405

GET information about Individual Alarm 
    [Documentation]    Test ID: 8.4.3.2-1
    ...    Test title: GET information about Individual Alarm 
    ...    Test objective: The objective is to read an individual alarm.
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID: 
    ...    Applicability: 
    ...    Post-Conditions:   
    Do GET Individual Alarm
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header ContentType is   ${CONTENT_TYPE}
    Check HTTP Response Body Json Schema Is    alarm.schema.json
    
GET information about Invalid Individual Alarm 
    [Documentation]    Test ID: 8.4.3.2-2
    ...    Test title: GET information about Invalid Individual Alarm 
    ...    Test objective: The objective is to read an Invalid individual alarm.
    ...    Pre-conditions: The related alarm does not exists
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID: 
    ...    Applicability: 
    ...    Post-Conditions:   
    Do GET Invalid Individual Alarm
    Check HTTP Response Status Code Is    404
    

PUT Individual Alarm - Method not implemented
    [Documentation]    Test ID: 8.4.3.3
    ...    Test title:PUT Individual Alarm - Method not implemented
    ...    Test objective: The objective is to post alarms
    ...    Pre-conditions: 
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions:  
    Do PUT Individual Alarm
    Check HTTP Response Status Code Is    405

PATCH Alarm
    [Documentation]    Test ID: 8.4.3.4-1
    ...    Test title: Modify an individual alarm resource
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions: 
    Do PATCH Individual Alarm
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header ContentType is    ${CONTENT_TYPE}    
    Check HTTP Response Body Json Schema Is    alarmModifications.schema.json
    
PATCH Alarm - Conflict
    [Documentation]    Test ID: 8.4.3.4-2
    ...    Test title: Modify an individual alarm resource - Conflict
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 8.4.3 - SOL002 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    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
    Do PATCH Individual Alarm
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails.schema.json
   

PATCH Alarm - Precondition failed
    [Documentation]    Test ID: 8.4.3.4-3
    ...    Test title: Modify an individual alarm resource - Precondition failed
    ...    Test objective: The objective is to Modify an individual alarm resource
    ...    Pre-conditions: The related alarm exists
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    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
    Do PATCH Individual Alarm Conflict
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is    ProblemDetails.schema.json

DELETE Individual Alarm - Method not implemented
    [Documentation]    Test ID: 8.4.3.5
    ...    Test title:DELETE Individual Alarm - Method not implemented
    ...    Test objective: The objective is to post alarms
    ...    Pre-conditions: 
    ...    Reference: section 8.4.3 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions:  
    Do DELETE Individual Alarm
    Check HTTP Response Status Code Is    405
+91 −10
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@ Check HTTP Response Status Code Is
    
    
Check HTTP Response Header Contains
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
    Should Contain    ${response.headers}    ${CONTENT_TYPE}
    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
@@ -30,48 +30,129 @@ Check HTTP Response Header ContentType is
    Log    Content Type validated 
    Log    Content Type validated 
    
    
Do POST Alarms
Do POST Alarms
    log    Trying to perform a PUT. 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}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse}=    Output    Response 
    ${outputResponse}=    Output    response 
    Set Global Variable    @{response}    ${outputResponse}
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do PATCH Alarms
Do PATCH Alarms
    log    Trying to perform a PATCH. This method should not be implemented
    log    Trying to perform a PATCH. 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} = Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse} =    Output    response 
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do PUT Alarms
Do PUT Alarms
    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}"}
    ${response} = Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse}=    Output    response 
    Set Global Variable    @{response}    ${outputResponse}

    
    
Do DELETE Alarms
Do DELETE Alarms
    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}"}
    ${response} = Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do GET Alarms
Do GET Alarms
    Log    Query NFVO The GET method queries information about multiple alarms.
    Log    Query NFVO The GET method queries information about multiple alarms.
    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}"}
    Log    Execute Query
    Log    Execute Query
    ${response} = Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    
    
Do GET Alarms With Filters
Do GET Alarms With Filters
	Log    Query NFVO The GET method queries information about multiple alarms with filters.
	Log    Query NFVO The GET method queries information about multiple alarms with filters.
	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}"}
	Log    Execute Query
	Log    Execute Query
	${response} = Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${nsInstanceId}
	Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${nsInstanceId}
	${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
	
Do GET Alarms With Invalid Filters
Do GET Alarms With Invalid Filters
	Log    Query NFVO The GET method queries information about multiple alarms with filters.
	Log    Query NFVO The GET method queries information about multiple alarms with filters.
	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}"}
	Log    Execute Query
	Log    Execute Query
	${response} = Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${Id} 
	Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${nsInstanceId}
 No newline at end of file
	${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse} 
	
Do POST Individual Alarm
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Post    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${outputResponse}=    Output    response 
    Set Global Variable    @{response}    ${outputResponse}
    
Do DELETE Individual Alarm
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    
Do PUT Individual Alarm
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}

Do GET Individual Alarm
    Log    Query NFVO The GET method queries information about an alarm.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query 
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    
Do GET Invalid Individual Alarm
    Log    Query NFVO The GET method queries information about an invalid alarm. Should return does not exist
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query 
    Get    ${apiRoot}/${apiName}/${apiVersion}/alarms/${invalidAlarmId}
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
   
Do PATCH 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}
   
   
Do PATCH Individual Alarm Conflict
    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": "${Etag}"} 
    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}
   
    
 No newline at end of file
+1 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@ ${CONTENT_TYPE} application/json
${NFVO_DUPLICATION}     0
${NFVO_DUPLICATION}     0


${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${alarmId}    6fc3539c-e602-4afa-8e13-962fb5a7d81d
${invalidAlarmId}    invalidAlramID
${Etag}=    an etag
${Etag}=    an etag
${Etag_modified}=    a modified etag
${Etag_modified}=    a modified etag
${CONTENT_TYPE_PATCH}    application/merge-patch+json
${CONTENT_TYPE_PATCH}    application/merge-patch+json
+3 −0
Original line number Original line Diff line number Diff line
{
  "ackState": "ACKNOWLEDGED"
}
 No newline at end of file
Loading