Commit f5d1ac22 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch 'SOL003-VNFPerformanceManagement' into '4.5.1-dev'

SOL003 VNF Performance Management - Implementation of deltas between v4.5.1 and v4.4.1

See merge request !343
parents 98bcedb5 3553db3c
Loading
Loading
Loading
Loading
+64 −12
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_veri
Library           String
Library           MockServerLibrary
Library           Process

Library           jwt
Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true

@@ -17,7 +17,7 @@ GET individual VNF Performance Job
    ...    Test title: Get individual VNF Performance Job
    ...    Test objective: The objective is to test the retrieval of an individual VNF performance monitoring job and perform a JSON schema and content validation of the collected job data structure
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -32,7 +32,7 @@ GET individual VNF Performance Job with invalid resource identifier
    ...    Test title: Get individual VNF Performance Job with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual VNF performance monitoring job fails when using an invalid resource identifier, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -45,7 +45,7 @@ DELETE Individual VNF Performance Job
    ...    Test title: Delete Individual VNF Performance Job
    ...    Test objective: The objective is to test the deletion of an individual VNF performance monitoring job
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Job is no more available in the VNFM    
@@ -58,7 +58,7 @@ DELETE Individual VNF Performance Job with invalid resource identifier
    ...    Test title: Delete individual VNF Performance Job with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual VNF performance monitoring job fails when using an invalid resource identifier
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -71,7 +71,7 @@ POST Individual VNF Performance Job - Method not implemented
    ...    Test title: POST Individual VNF Performance Job - method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new VNF Performance Monitoring Job
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 6.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -83,7 +83,7 @@ PUT Individual VNF Performance Job - Method not implemented
    ...    Test title: PUT Individual VNF Performance Job - method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing VNF Performance Monitoring Job
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -95,7 +95,7 @@ PATCH Individual VNF Performance Job
    ...    Test title: PATCH Individual VNF Performance Job
    ...    Test objective: The objective is to test that PATCH method allows to modify individual performace management job
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: 
@@ -109,7 +109,7 @@ PATCH Individual VNF Performance Job - Precondition failed
    ...    Test title: PATCH Individual VNF Performance Job - Precondition failed
    ...    Test objective: The objective is to attempt to Modify an individual alarm resource, where the precondition was not met.
    ...    Pre-conditions:  A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:  The VNF Performance Job is not modified by the operation
@@ -123,7 +123,7 @@ PATCH Individual VNF Performance Job - Unprocessable Content
    ...    Test title: PATCH Individual VNF Performance Job - Unprocessable Content
    ...    Test objective: The objective is to test that PATCH method cannot modify an exsisting individual PM job resource when a request contains syntactically correct data but the data cannot be processed.
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -131,6 +131,33 @@ PATCH Individual VNF Performance Job - Unprocessable Content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
GET individual VNF Performance Job with permitted authorization scope
    [Documentation]    Test ID: 7.3.4.2.10
    ...    Test title: Get individual VNF Performance Job with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual VNF performance monitoring job and perform a JSON schema and content validation of the collected job data structure
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual VNF Performance Job with permitted authorization scope
    Check HTTP Response Header Contains ETag and Last-Modified
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJob
    Check HTTP Response Body Pm Job Identifier matches the requested Pm Job

GET individual VNF Performance Job with not permitted authorization scope
    [Documentation]    Test ID: 7.3.4.2.11
    ...    Test title: Get individual VNF Performance Job with not permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual VNF performance monitoring job and perform a JSON schema and content validation of the collected job data structure
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
    ...    Reference: Clause 6.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual VNF Performance Job with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is   ProblemDetails

*** Keywords ***
Create Sessions
@@ -227,6 +254,26 @@ Send Patch request for individual VNF Performance Job with unprocessable content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET individual VNF Performance Job with permitted authorization scope
    Log    Trying to get a Pm Job present in the NFVO Catalogue with permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scopeValue=${PM_JOBS_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET individual VNF Performance Job with not permitted authorization scope
    Log    Trying to get a Pm Job present in the NFVO Catalogue with not permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scopeValue=${PM_JOBS_NOT_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition VNF Performance Job is not Created
    Log    Trying to get a new Pm Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -280,3 +327,8 @@ Check HTTP Response Header Contains ETag and Last-Modified
    Should Contain    ${response['headers']}    Etag
    Should Contain    ${response['headers']}    Last-Modified
    Log    Etag and Last-Modified Headers are present

JWT Encode
    [Arguments]    ${payload}    ${key}    ${algorithm}
    ${encoded}=    Evaluate    jwt.encode(${payload}, ${key}, ${algorithm})
    [Return]    ${encoded}
 No newline at end of file
+57 −7
Original line number Diff line number Diff line
@@ -4,14 +4,14 @@ Resource environment/variables.txt # Generic Parameters
Library           JSONLibrary
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           String

Library           jwt
*** Test Cases ***
Get Individual Performance Report
    [Documentation]    Test ID: 7.3.4.3.1
    ...    Test title: Get Individual Performance Report
    ...    Test objective: The objective is to test the retrieval of an individual VNF performance report associated to a monitoring job and perform a JSON schema validation of the collected report data structure
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.4.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -24,7 +24,7 @@ Get Individual Performance Report with invalid resource endpoint
    ...    Test title: Get Individual Performance Report with invalid resource endpoint
    ...    Test objective:  The objective is to test that the retrieval of an individual VNF performance report associated to a monitoring job fails when using an invalid resource endpoint 
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.4.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -37,7 +37,7 @@ POST Individual Performance Report - Method not implemented
    ...    Test title: POST Individual Performance Report - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new VNF performance report within a monitoring job
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Reference: Clause 6.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -49,7 +49,7 @@ PUT Individual Performance Report - Method not implemented
    ...    Test title: PUT Individual Performance Report - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing VNF performance report within a monitoring job
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.4.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -61,7 +61,7 @@ PATCH Individual Performance Report - Method not implemented
    ...    Test title: PATCH Individual Performance Report - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing VNF performance report within a monitoring job
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.4.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -73,13 +73,39 @@ DELETE Individual Performance Report - Method not implemented
    ...    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 VNF performance report within a monitoring job
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.4.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Delete request for Individual Performance Report
    Check HTTP Response Status Code Is    405

Get Individual Performance Report with permitted authorization scope
    [Documentation]    Test ID: 7.3.4.3.7
    ...    Test title: Get Individual Performance Report with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual VNF performance report associated to a monitoring job and perform a JSON schema validation of the collected report data structure with permitted authorization scope
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Performance Report with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PerformanceReport

Get Individual Performance Report with not permitted authorization scope
    [Documentation]    Test ID: 7.3.4.3.8
    ...    Test title: Get Individual Performance Report with not permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual VNF performance report associated to a monitoring job and perform a JSON schema validation of the collected report data structure with not permitted authorization scope
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance reports are set for a monitoring job in the VNFM.
    ...    Reference: Clause 6.4.4.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Performance Report with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is   ProblemDetails

*** Keywords ***
Get Individual Performance Report
    Log    Trying to get a performance report present in the VNFM
@@ -131,6 +157,26 @@ Send Delete request for Individual Performance Report
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Performance Report with permitted authorization scope
    Log    Trying to get a performance report present in the VNFM with permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scopeValue=${PM_JOBS_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Performance Report with not permitted authorization scope
    Log    Trying to get a performance report present in the VNFM with not permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scopeValue=${PM_JOBS_NOT_PERMITTED_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=${OAUTH_KEY}    algorithm=${OAUTH_ENCRYPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}
    ${status}=    Convert To Integer    ${expected_status}    
@@ -150,3 +196,7 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK

JWT Encode
    [Arguments]    ${payload}    ${key}    ${algorithm}
    ${encoded}=    Evaluate    jwt.encode(${payload}, ${key}, ${algorithm})
    [Return]    ${encoded}
 No newline at end of file
+65 −13

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Performance Information Available Notification
    ...    Test title: Performance Information Available Notification
    ...    Test objective: The objective is to test that the POST request triggers Performance Information Available Notification.
    ...    Pre-conditions: A VNF performance job is created, and a subscription for performance information available notification is available in the VNFM.
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -25,7 +25,7 @@ Threshold Crossed Notification
    ...    Test title: Threshold Crossed Notification
    ...    Test objective: The objective is to test that the POST request triggers Threshold Crossed Notification
    ...    Pre-conditions: A VNF performance job is created, and a subscription for threshold crossed notification is available in the VNFM.
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ VNF Performance Information Availability Notification
    ...    Test title: VNF Performance Information Availability Notification
    ...    Test objective: The objective is to test the dispatch of VNF Performance Information Availability Notification when new VNF performance information is available in the NFVO, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system.
    ...    Pre-conditions: A VNF performance job is created, and a subscription for information availability notifications is available in the VNFM.
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -29,7 +29,7 @@ VNF Threshold Crossed Notification
    ...    Test title: VNF Threshold Crossed Notification
    ...    Test objective: The objective is to test the dispatch of VNF Threshold Crossed Notification when a previously set VNF performance metric threshold is crossed, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system.
    ...    Pre-conditions: A VNF performance job is created, and a threshold subscription is available in the VNFM.
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Reference: Clause 6.4.9.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
Loading