Commit 0f8500d6 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added doc for SOL005 NS performance mgmt

parent 21b067fa
Loading
Loading
Loading
Loading
+85 −62
Original line number Original line Diff line number Diff line
@@ -3,74 +3,97 @@ Library JSONSchemaLibrary schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Library           JSONLibrary
Library           JSONLibrary
Resource          environment/IndividualPmJob.txt
Resource          environment/IndividualPmJob.txt
Resource          NSPerformanceManagementKeywords.robot
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}


*** Test Cases ***
*** Test Cases ***
GET Individual PM Job
GET individual NS Performance Job
    Log    Trying to get a Pm Job present in the NFVO Catalogue
    [Documentation]    Test ID: 5.3.4.2.1
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: Get individual NS Performance Job
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test the retrieval of an individual NS Performance monitoring job and perform a JSON schema and content validation of the collected job data structure
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    Integer    response status    200
    ...    Reference: section 7.4.3.3.2 - SOL005 v2.4.1
    ${contentType}=    Output    response headers Content-Type
    ...    Config ID: Config_prod_NFVO
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Applicability: none
    Log    Trying to validate response
    ...    Post-Conditions: none
    ${result}=    Output    response body
    GET individual NS Performance Job
    Validate Json    PmJob.schema.json    ${result}
    Check HTTP Response Status Code Is    200
    Log    Validation OK
    Check HTTP Response Body Json Schema Is   PmJob
    Check HTTP Response Body Pm Job Identifier matches the requested Pm Job


GET Individual PM Job - Negative (Not Found)
GET individual NS Performance Job with invalid resource identifier
    Log    Trying to perform a negative get, using erroneous PM Job identifier
    [Documentation]    Test ID: 5.3.4.2.2
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: Get individual NS Performance Job with invalid resource identifier
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that the retrieval of an individual NS Performance monitoring job fails when using an invalid resource identifier, and perform the JSON schema validation of the failed operation HTTP response
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    Integer    response status    404
    ...    Reference: section 7.4.3.3.2 - SOL005 v2.4.1
    Log    Received 404 Not Found as expected
    ...    Config ID: Config_prod_NFVO
    ${contentType}=    Output    response headers Content-Type
    ...    Applicability: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Post-Conditions: none
    Log    Trying to validate ProblemDetails
    GET individual NS Performance Job with invalid resource identifier
    ${problemDetails}=    Output    response body
    Check HTTP Response Status Code Is    404
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Check HTTP Response Body Json Schema Is   ProblemDetails
    Log    Validation OK


DELETE Individual PM Job
DELETE Individual NS Performance Job with invalid resource identifier
    Log    Trying to delete an existing PM Job
    [Documentation]    Test ID: 5.3.4.2.3
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test title: Delete individual NS Performance Job with invalid resource identifier
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}
    ...    Test objective: The objective is to test that the deletion of an individual NS Performance monitoring job fails when using an invalid resource identifier
    Integer    response status    204
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    Log    Received 204 No Content as expected
    ...    Reference: section 7.4.3.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Delete request for individual NS Performance Job with invalid resource identifier
    Check HTTP Response Status Code Is    404


DELETE Individual PM Job - Negative (Not Found)
POST Individual NS Performance Job - Method not implemented
    Log    Trying to delete an existing PM Job
    [Documentation]    Test ID: 5.3.4.2.4
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test title: POST Individual NS Performance Job - method not implemented
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId}
    ...    Test objective: The objective is to test that POST method is not allowed to create a new NS Performance Monitoring Job
    Integer    response status    404
    ...    Pre-conditions: A NS instance is instantiated
    Log    Received 404 Not Found as expected
    ...    Reference: section 7.4.3.3.1 - SOL005 v2.4.1
    Log    Trying to validate ProblemDetails
    ...    Config ID: Config_prod_NFVO
    ${problemDetails}=    Output    response body
    ...    Applicability: none
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    ...    Post-Conditions: The NS Performance Job is not created on the NFVO
    Log    Validation OK
    Send Post request for individual NS Performance Job
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Performance Job is not Created


POST Individual PM Job - (Method not implemented)
PUT Individual NS Performance Job - Method not implemented
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.4.2.5
    Log    Trying to perform a POST (method should not be implemented)
    ...    Test title: PUT Individual NS Performance Job - method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing NS Performance Monitoring Job
    POST    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    Integer    response status    405
    ...    Reference: section 7.4.3.3.3 - SOL005 v2.4.1
    Log    Received 405 Method not implemented as expected
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS Performance Job is not modified by the operation
    Send Put request for individual NS Performance Job
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Performance Job is Unmodified (Implicit)


PUT Individual PM Job - (Method not implemented)
PATCH Individual NS Performance Job - Method not implemented
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.4.2.6
    Log    Trying to perform a PUT. This method should not be implemented
    ...    Test title: PATCH Individual NS Performance Job - method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing new NS Performance Monitoring Job
    PUT    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    Integer    response status    405
    ...    Reference: section 6.4.3.3.4 - SOL002 v2.4.1
    Log    Received 405 Method not implemented as expected
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS Performance Job is not modified by the operation
    Send Patch request for individual NS Performance Job
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Performance Job is Unmodified (Implicit)


PATCH Individual PM Job - (Method not implemented)
DELETE Individual NS Performance Job
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.4.2.7
    Log    Trying to perform a PATCH. This method should not be implemented
    ...    Test title: Delete Individual NS Performance Job
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test the deletion of an individual NS Performance monitoring job
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    Integer    response status    405
    ...    Reference: section 7.4.3.3.5 - SOL005 v2.4.1
    Log    Received 405 Method not implemented as expected
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS Performance Job is no more available in the NFVO    
    Send Delete request for individual NS Performance Job
    Check HTTP Response Status Code Is    204
    Check Postcondition NS Pm Job is Deleted
 No newline at end of file
+73 −50
Original line number Original line Diff line number Diff line
@@ -2,62 +2,85 @@
Library           JSONSchemaLibrary    schemas/
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/reports.txt
Resource          environment/reports.txt
Resource          NSPerformanceManagementKeywords.robot
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}


*** Test Cases ***
*** Test Cases ***
GET Report on Single PM Job
Get Individual Performance Report
    [Documentation]    The client can use this resource to read the performance report.
    [Documentation]    Test ID: 5.3.4.3.1
    ...    The URI of this report can be obtained from a PerformanceInformationAvailableNotification
    ...    Test title: Get Individual Performance Report
    ...    (see clause 7.5.2.5) or from the representation of the "Individual PM job" resource
    ...    Test objective: The objective is to test the retrieval of an individual NS performance report associated to a monitoring job and perform a JSON schema validation of the collected report data structure
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance reports are set for a monitoring job in the NFVO.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Reference: section 7.4.4.3.2 - SOL005 v2.4.1
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ...    Config ID: Config_prod_NFVO
    Integer    response status    200
    ...    Applicability: none
    ${contentType}=    Output    response headers Content-Type
    ...    Post-Conditions: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    Get Individual Performance Report
    Log    Trying to validate result with PerformanceReport schema
    Check HTTP Response Status Code Is    200
    ${result}=    Output    response body
    Check HTTP Response Body Json Schema Is   PerformanceReport
    Validate Json    PerformanceReport.schema.json    ${result}


GET Report on Single PM Job - Negative (Not Found)
Get Individual Performance Report with invalid resource endpoint
    [Documentation]    The client can use this resource to read the performance report.
    [Documentation]    Test ID: 5.3.4.3.2
    ...    The URI of this report can be obtained from a PerformanceInformationAvailableNotification
    ...    Test title: Get Individual Performance Report with invalid resource endpoint
    ...    (see clause 7.5.2.5) or from the representation of the "Individual PM job" resource
    ...    Test objective:  The objective is to test that the retrieval of an individual NS performance report associated to a monitoring job fails when using an invalid resource endpoint 
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance reports are set for a monitoring job in the NFVO.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Reference: section 7.4.4.3.2 - SOL005 v2.4.1
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${erroneousReportId}
    ...    Config ID: Config_prod_NFVO
    Integer    response status    404
    ...    Applicability: none
    Log    Received 404 Not Found as expected
    ...    Post-Conditions: none
    Log    Trying to validate ProblemDetails
    Get Individual Performance Report with invalid resource endpoint
    ${problemDetails}=    Output    response body
    Check HTTP Response Status Code Is    404
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK


POST Reports - (Method not implemented)
POST Individual Performance Report - Method not implemented
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.4.3.3
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test title: POST Individual Performance Report - Method not implemented
    POST    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ...    Test objective: The objective is to test that POST method is not allowed to create a new NS performance report within a monitoring job
    Integer    response status    405
    ...    Pre-conditions: A NS instance is instantiated.
    Log    Received 405 Method not implemented as expected
    ...    Reference: section 7.4.4.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS performance report is not created on the NFVO
    Send Post request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Individual Performance Report is not Created


PUT Reports - (Method not implemented)
PUT Individual Performance Report - Method not implemented
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.4.3.4
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test title: PUT Individual Performance Report - Method not implemented
    PUT    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing NS performance report within a monitoring job
    Integer    response status    405
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance reports are set for a monitoring job in the NFVO.
    Log    Received 405 Method not implemented as expected
    ...    Reference: section 7.4.4.3.3 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS performance report is not modified by the operation
    Send Put request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Individual Performance Report is Unmodified (Implicit)


PATCH Reports - (Method not implemented)
PATCH Individual Performance Report - Method not implemented
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.4.3.5
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test title: PATCH Individual Performance Report - Method not implemented
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing NS performance report within a monitoring job
    Integer    response status    405
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance reports are set for a monitoring job in the NFVO.
    Log    Received 405 Method not implemented as expected
    ...    Reference: section 7.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS performance report is not modified by the operation
    Send Patch request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Individual Performance Report is Unmodified (Implicit)

DELETE Individual Performance Report - Method not implemented
    [Documentation]    Test ID: 5.3.4.3.6
    ...    Test title: DELETE Individual Performance Report - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete an existing NS performance report within a monitoring job
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance reports are set for a monitoring job in the NFVO.
    ...    Reference: section 7.4.4.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS performance report is not deleted by the operation
    Send Delete request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition NS Individual Performance Report Exists
DELETE Reports - (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
+85 −66

File changed.

Preview size limit exceeded, changes collapsed.

+84 −53

File changed.

Preview size limit exceeded, changes collapsed.

+427 −12

File changed.

Preview size limit exceeded, changes collapsed.

Loading