Commit 8d67588f authored by AHMADABB's avatar AHMADABB
Browse files

EGM First Commit on SOL5 Robot Tests.

parent 3481c26a
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
/.project
+101 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    environment/variables.txt
Resource   NSFMOperationKeywords.robot  
Library    REST     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    OperatingSystem

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

Get information about multiple alarms 
    [Documentation]    Test ID: 8.4.2.2
    ...    Test title: Get information about multiple alarms
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Pre-conditions: 
    ...    Reference: section 8.4.2 - SOL005 v2.4.1
    ...    Config ID: 
    ...    Applicability: 
    ...    Post-Conditions:
    Do GET Alarms
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header ContentType is    ${CONTENT_TYPE}
    Check HTTP Response Body Json Schema Is    alarms.schema.json


Get information about multiple alarms with filters 
     [Documentation]    Test ID: 8.4.2.2-2
    ...    Test title: Get information about multiple alarms with filters
    ...    Test objective: The objective is to retrieve information about the alarm list with filters
    ...    Pre-conditions: 
    ...    Reference: section 8.4.2 - SOL005 v2.4.1
    ...    Config ID: 
    ...    Applicability: 
    ...    Post-Conditions:  
    Do GET Alarms With Filters
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header ContentType is    ${CONTENT_TYPE}
    Check HTTP Response Body Json Schema Is    alarms.schema.json
    

Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
    [Documentation]    Test ID: 8.4.2.2-3
    ...    Test title: Get information about multiple alarms - with Invalid attribute-based filtering parameters
    ...    Test objective: The objective is to retrieve information about the alarm list
    ...    Pre-conditions: 
    ...    Reference: section 8.4.2 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions: 
    Do GET Alarms With Invalid Filters
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails.schema.json
    
PUT Alarms - Method not implemented
    [Documentation]    Test ID: 8.4.2.3
    ...    Test title: PUT Alarms - Method not implemented
    ...    Test objective: The objective is to put alarms
    ...    Pre-conditions: 
    ...    Reference: section 8.4.2 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions:  
    Do PUT Alarms
    Check HTTP Response Status Code Is    405
    
    
PATCH Alarms - Method not implemented
    [Documentation]    Test ID: 8.4.2.4
    ...    Test title: PATCH Alarms - Method not implemented
    ...    Test objective: The objective is to post alarms
    ...    Pre-conditions: 
    ...    Reference: section 8.4.2 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions:  
    Do PATCH Alarms
    Check HTTP Response Status Code Is    405

DELETE Alarms - Method not implemented
    [Documentation]    Test ID: 8.4.2.5
    ...    Test title: DELETE Alarms - Method not implemented
    ...    Test objective: The objective is to DELETE alarms
    ...    Pre-conditions: 
    ...    Reference: section 8.4.2 - SOL005 v2.4.1
    ...    Config ID:
    ...    Applicability: 
    ...    Post-Conditions:  
    Do DELETE Alarms
    Check HTTP Response Status Code Is    405
+77 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    environment/variables.txt
Library    REST     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    OperatingSystem


*** Keywords ***
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}
    Log    Validate Status code    
    Should Be Equal    ${response[0]['status']}    ${expected_status}
    Log    Status code validated 
    
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    Should Contain    ${response.headers}    ${CONTENT_TYPE}
    Log    Header is present    
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${schema}
    Validate Json    ${schema}    ${response[0]['body']}
    Log    Json Schema Validation OK
    
Check HTTP Response Header ContentType is 
    [Arguments]    ${expected_contentType}
    Log    Validate content type
    Should Be Equal    ${response[0]['headers']['Content-Type']}    ${expected_contentType}
    Log    Content Type validated 
    
Do POST Alarms
    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
    ${outputResponse}=    Output    Response 
    Set Global Variable    @{response}    ${outputResponse}
    
Do PATCH Alarms
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${response} = Patch    ${apiRoot}/${apiName}/${apiVersion}/alarms
    
Do PUT Alarms
    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}"}
    ${response} = Put    ${apiRoot}/${apiName}/${apiVersion}/alarms
    
Do DELETE Alarms
    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}"}
    ${response} = Delete    ${apiRoot}/${apiName}/${apiVersion}/alarms
    
Do GET Alarms
    Log    Query NFVO The GET method queries information about multiple alarms.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query
    ${response} = Get    ${apiRoot}/${apiName}/${apiVersion}/alarms
    
 Do GET Alarms With Filters
	Log    Query NFVO The GET method queries information about multiple alarms with filters.
	Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
	Log    Execute Query
	${response} = Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${nsInstanceId}
	
Do GET Alarms With Invalid Filters
	Log    Query NFVO The GET method queries information about multiple alarms with filters.
	Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
	Log    Execute Query
	${response} = Get    ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${Id} 
 No newline at end of file
+40 −0
Original line number Diff line number Diff line
*** Variables ***
${NFVO_HOST}      localhost    # Hostname of the VNFM
${NFVO_PORT}      8080    # Listening port of the VNFM
${NFVO_SCHEMA}    https
${AUTHORIZATION}    Bearer    QWxhZGRpbjpvcGVuIHNlc2FtZQ==
${ACCEPT}         application/json
${AUTH_USAGE}     1
${alarm_filter}       nsInstanceId
${nsInstanceId}    007c111c-38a1-42c0-a666-7475ecb1567c
${invalid_alarm_filter}    badFilter 
${apiRoot}        /
${apiName}        nsfm
${apiVersion}     v1
${CONTENT_TYPE}    application/json

${NFVO_DUPLICATION}     0

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

${PerceivedSeverity}    CRITICAL

${sub_filter}    filter
${sub_filter_invalid}    filter_invalid

${subscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f

${callback_uri}    http://localhost
${callback_port}    9091
${callback_endpoint}    /endpoint
${callback_endpoint_error}    /endpoint_404
${sleep_interval}    20s

${AlarmNotification}    {}
${AlarmClearedNotification}    {}
${AlarmListRebuiltNotification}    {}

${response}    {}
+11 −0
Original line number Diff line number Diff line
{
  "description": "The enumeration EventType represents those types of events that trigger an alarm. - COMMUNICATIONS_ALARM: An alarm of this type is associated with the\n  procedure and/or process required conveying information from one point\n  to another (ITU-T Recommendation X.733).\n- PROCESSING_ERROR_ALARM: An alarm of this type is associated with a\n  software or processing fault (ITU-T Recommendation X.733).\n- ENVIRONMENTAL_ALARM: An alarm of this type is associated with a\n  condition related to an enclosure in which the equipment resides\n  (ITU-T Recommendation X.733).\n- QOS_ALARM: An alarm of this type is associated with degradation in the\n  quality of a service (ITU-T Recommendation X.733).\n- EQUIPMENT_ALARM: An alarm of this type is associated with an equipment\n  fault (ITU-T Recommendation X.733).\n",
  "type": "string",
  "enum": [
    "COMMUNICATIONS_ALARM",
    "PROCESSING_ERROR_ALARM",
    "ENVIRONMENTAL_ALARM",
    "QOS_ALARM",
    "EQUIPMENT_ALARM"
  ]
}
 No newline at end of file
Loading