SOL009 NFVMANO Performance Management - Implementation of deltas between v4.5.1 and v4.4.1

This merge request refers to the implementation of deltas between v4.5.1 and v4.4.1 of SOL009 NFVMANO Performance ManagementInterface.

Deadline for review: Wednesday 25th Sept 2024 @noon CEST

Merge request reports

Loading
+8 −0
Changes for SOL009/NFVMANOPerformanceManagement-API/environment/variables.txt: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,14 @@ ${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${NEG_AUTHORIZATION_TOKEN}    Bearer negativetoken
${BAD_AUTHORIZATION_TOKEN}    Bear sometoken

${OAUTH_ENCRIPTION_ALGORITHM}    HS256
${JOBS_PERMITTED_SCOPE}    nfvmanopm:v2:pm_job_info
${JOBS_NOT_PERMITTED_SCOPE}    nfvmanopm:v2:pm_job_info:readonly
${THREHSOLD_PERMITTED_SCOPE}    nfvmanopm:v2:thresold_info
${THRESHOLD_NOT_PERMITTED_SCOPE}    nfvmanopm:v2:threshold_info:readonly
${NOT_PERMITTED_SCOPE}    nfvmanopm:v2:invalid


${CONTENT_TYPE_JSON}    application/json
${CONTENT_TYPE_PATCH}   application/merge-patch+json
${ACCEPT_JSON}    application/json
+34 −9
Changes for SOL009/NFVMANOPerformanceManagement-API/IndividualPmJob.robot: 34 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ POST Individual NFV-MANO Performance Job - Method not implemented
    ...    Test title: POST Individual NFV-MANO Performance Job - method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new NFV-MANO Performance Monitoring Job
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.4.3.1 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.1 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -19,7 +19,7 @@ GET individual NFV-MANO Performance Job
    ...    Test title: Get individual NFV-MANO Performance Job
    ...    Test objective: The objective is to test the retrieval of an individual performance monitoring job and perform a JSON schema validation of the collected job data structure
    ...    Pre-conditions: A NFV-MANO instance is instantiated.
    ...    Reference: clause 6.5.4.3.2 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -33,7 +33,7 @@ GET individual NFV-MANO Performance Job with invalid resource identifier
    ...    Test title: Get individual NFV-MANO Performance Job with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual 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 NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.2 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -46,7 +46,7 @@ PUT Individual NFV-MANO Performance Job - Method not implemented
    ...    Test title: PUT Individual NFV-MANO Performance Job - method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing NFV-MANO Performance Monitoring Job
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -58,7 +58,7 @@ PATCH Individual NFV-MANO Performance Job
    ...    Test title: PATCH Individual NFV-MANO Performance Job
    ...    Test objective: The objective is to test that PATCH method modify an existing individual NFV-MANO Performance Monitoring Job
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: PM Job resource is modified.
@@ -71,7 +71,7 @@ DELETE Individual NFV-MANO Performance Job
    ...    Test title: Delete Individual NFV-MANO Performance Job
    ...    Test objective: The objective is to test the deletion of an individual performance monitoring job
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.5 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The NFV-MANO Performance Job is no more available.   
@@ -84,7 +84,7 @@ DELETE Individual NFV-MANO Performance Job with invalid resource identifier
    ...    Test title: Delete individual NFV-MANO Performance Job with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual NFV-MANO performance monitoring job fails when using an invalid resource identifier
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.5 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -96,7 +96,7 @@ PATCH Individual NFV-MANO Performance Job - Precondition failed
    ...    Test title: PATCH Individual NFV-MANO Performance Job - Precondition failed
    ...    Test objective: The objective is to test that the PATCH method cannot modify an individual NFV-MANO Performance job where the precondition was not met.
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: PM Job resource is not modified.
@@ -109,10 +109,35 @@ PATCH Individual NFV-MANO Performance Job - Unprocessable content
    ...    Test title: PATCH Individual NFV-MANO 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 NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: PM Job resource is not modified.
    Send Patch request for individual NFV_MANO Performance Job with unprocessable content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is     ProblemDetails

PATCH Individual NFV-MANO Performance Job with permitted authorization scope
    [Documentation]    Test ID: 8.3.2.2.10
    ...    Test title: PATCH Individual NFV-MANO Performance Job with permitted authorization scope
    ...    Test objective: The objective is to test that PATCH method with permitted authorization scope modify an existing individual NFV-MANO Performance Monitoring Job
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: PM Job resource is modified.
    Send Patch request for individual NFV-MANO Performance Job with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is     PmJobModifications

PATCH Individual NFV-MANO Performance Job with not permitted authorization scope
    [Documentation]    Test ID: 8.3.2.2.11
    ...    Test title: PATCH Individual NFV-MANO Performance Job with not permitted authorization scope
    ...    Test objective: The objective is to test that PATCH method with not permitted authorization scope fails
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
    ...    Reference: clause 6.5.4.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: PM Job resource is modified.
    Send Patch request for individual NFV-MANO Performance Job with not permitted authorization scope
    Check HTTP Response Status Code Is    401
+31 −6
Changes for SOL009/NFVMANOPerformanceManagement-API/IndividualReport.robot: 31 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,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 NFV-MANO performance report within a monitoring job.
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.5.3.1 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.5.3.1 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -19,7 +19,7 @@ Get Individual Performance Report
    ...    Test title: Get Individual Performance Report
    ...    Test objective: The objective is to test the retrieval of an individual performance report associated to a monitoring job and perform a JSON schema validation of the collected report data structure
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance reports are set for a monitoring job.
    ...    Reference: clause 6.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -32,7 +32,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 NFV-MANO performance report associated to a monitoring job fails when using an invalid resource endpoint. 
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance reports are set for a monitoring job.
    ...    Reference: clause 6.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -44,7 +44,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 NFV-MANO performance report within a monitoring job.
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.5.3.3 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.5.3.3 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -56,7 +56,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 NFV-MANO performance report within a monitoring job.
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.5.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.5.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -68,10 +68,35 @@ 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 NFV-MANO performance report within a monitoring job
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.5.3.5 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.5.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANOM
    ...    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: 8.3.2.3.7
    ...    Test title: Get Individual Performance Report with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual performance report associated to a monitoring job with permitted authorization scope
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance reports are set for a monitoring job.
    ...    Reference: clause 6.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    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: 8.3.2.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 performance report associated to a monitoring job fails with not permitted authorization scope
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance reports are set for a monitoring job.
    ...    Reference: clause 6.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Performance Report with not permitted authorization scope
    Check HTTP Response Status Code Is    401
+34 −9
Changes for SOL009/NFVMANOPerformanceManagement-API/IndividualThreshold.robot: 34 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ POST Individual Threshold - Method not implemented
    ...    Test title: POST Individual Threshold - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new Performance Threshold
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.7.3.1 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.1 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -19,7 +19,7 @@ GET Individual Threshold
    ...    Test title: GET Individual Threshold
    ...    Test objective: The objective is to test the retrieval of an individual NFV-MANO performance threshold and perform a JSON schema and content validation of the collected threshold data structure
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.2 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -33,7 +33,7 @@ GET Individual Threshold with invalid resource identifier
    ...    Test title: GET Individual Threshold with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual performance threshold fails when using an invalid resource identifier
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance jobs are set.
    ...    Reference: clause 6.5.7.3.2 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -45,7 +45,7 @@ PUT Individual Threshold - Method not implemented
    ...    Test title: PUT Individual Threshold - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing Performance threshold
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.7.3.3 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.3 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -57,7 +57,7 @@ PATCH Individual Threshold
    ...    Test title: PATCH Individual Threshold
    ...    Test objective: The objective is to test that PATCH method modify an existing NFV_MANO performance threshold.
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Threshold resource is modified.
@@ -70,7 +70,7 @@ DELETE Individual Threshold
    ...    Test title: DELETE Individual Threshold
    ...    Test objective: The objective is to test the deletion of an individual performance threshold
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.5 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Performance Threshold is not available anymore in the NFV-MANO    
@@ -83,7 +83,7 @@ DELETE Individual Threshold with invalid resource identifier
    ...    Test title: DELETE Individual Threshold with invalid resource identifier
    ...    Test objective: The objective is to test the deletion of an individual performance threshold
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.5 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none   
@@ -95,7 +95,7 @@ PATCH Individual Threshold - Precondition failed
    ...    Test title: PATCH Individual Threshold - Precondition failed
    ...    Test objective: The objective is to test that the PATCH method cannot modify an individual NFV-MANO threshold where the precondition was not met.
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Threshold resource is not modified.
@@ -108,10 +108,35 @@ PATCH Individual Threshold - Unprocessable content
    ...    Test title: PATCH Individual Threshold - Unprocessable content
    ...    Test objective: The objective is to test that PATCH method cannot modify an exsisting individual threshold resource when a request contains syntactically correct data but the data cannot be processed.
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.4.1
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Threshold resource is not modified.
    Send Patch request for individual Performance Threshold with unprocessable content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails

PATCH Individual Threshold with permitted authorization scope
    [Documentation]    Test ID: 8.3.2.5.10
    ...    Test title: PATCH Individual Threshold with permitted authorization scope
    ...    Test objective: The objective is to test that PATCH method modify an existing NFV_MANO performance threshold with permitted authorization scope.
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Threshold resource is modified.
    Send Patch request for individual Performance Threshold with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ThresholdModifications

PATCH Individual Threshold with not permitted authorization scope
    [Documentation]    Test ID: 8.3.2.5.11
    ...    Test title: PATCH Individual Threshold with not permitted authorization scope
    ...    Test objective: The objective is to test that PATCH method fails with not permitted authorization scope.
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more performance thresholds are set.
    ...    Reference: clause 6.5.7.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Threshold resource is modified.
    Send Patch request for individual Performance Threshold with not permitted authorization scope
    Check HTTP Response Status Code Is    401
+153 −1
Changes for SOL009/NFVMANOPerformanceManagement-API/NFVMANOPMKeywords.robot: 153 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ Library MockServerLibrary
Library     Process
Library     BuiltIn
Library     Collections

Library     jwt

*** Keywords ***
GET all NFV-MANO Performance Monitoring Jobs
@@ -130,6 +130,36 @@ Send Post Request to create new NFV-MANO Performance Monitoring Job
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request to create new NFV-MANO Performance Monitoring Job with permitted authorization scope
    Log    Creating a new PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${JOBS_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callbackUri=${callback_uri}
    Check GET response from Notification Endpoint
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request to create new NFV-MANO Performance Monitoring Job with not permitted authorization scope
    Log    Creating a new PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${JOBS_NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callbackUri=${callback_uri}
    Check GET response from Notification Endpoint
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request to create new NFV-MANO Performance Monitoring Job - Unreachable Endpoint
    Log    Creating a new PM Job for unreachable notification endpoint
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -280,6 +310,36 @@ Send Patch request for individual NFV-MANO Performance Job
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Patch request for individual NFV-MANO Performance Job with permitted authorization scope
    Log    Trying to perform a PATCH on PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    ${scopeValue}=    Create Dictionary    scope=${JOBS_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    Check GET response from Notification Endpoint
    ${template}=    Get File    jsons/PmJobModifications.json
    ${body}=    Format String    ${template}    callbackUri=${callback_uri}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Patch request for individual NFV-MANO Performance Job with not permitted authorization scope
    Log    Trying to perform a PATCH on PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    ${scopeValue}=    Create Dictionary    scope=${JOBS_NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    Check GET response from Notification Endpoint
    ${template}=    Get File    jsons/PmJobModifications.json
    ${body}=    Format String    ${template}    callbackUri=${callback_uri}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Patch request for individual NFV-MANO Performance Job - Etag mismatch
    Log    Trying to perform a PATCH on PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -348,6 +408,34 @@ Send Post Request Create new Performance Threshold
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request Create new Performance Threshold with permitted authorization scope
    Log    Creating a new Threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${THRESHOLD_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callbackUri=${callback_uri}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request Create new Performance Threshold with not permitted authorization scope
    Log    Creating a new Threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${THRESHOLD_NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callbackUri=${callback_uri}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request Create new Performance Threshold with unreachable notification endpoint
    Log    Creating a new Threshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":${AUTHORIZATION_TOKEN}"}
@@ -463,6 +551,42 @@ Send Patch request for individual Performance Threshold
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}

Send Patch request for individual Performance Threshold with permitted authorization scope
    Log    Trying to PUT threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    ${scopeValue}=    Create Dictionary    scope=${THRESHOLD_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    Check GET response from Notification Endpoint
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    ${template}=    Get File    jsons/ThresholdModification.json
    ${body}=    Format String    ${template}    callbackUri=${callback_uri}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}

Send Patch request for individual Performance Threshold with not permitted authorization scope
    Log    Trying to PUT threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    ${scopeValue}=    Create Dictionary    scope=${THRESHOLD_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    Check GET response from Notification Endpoint
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    ${template}=    Get File    jsons/ThresholdModification.json
    ${body}=    Format String    ${template}    callbackUri=${callback_uri}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}

Send Patch request for individual Performance Threshold - Etag mismatch
    Log    Trying to PUT threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -551,6 +675,28 @@ Get 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 NFV-MANOM
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${JOBS_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    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 NFV-MANOM
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}/reports/${reportId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Performance Report with invalid resource endpoint
    Log    Trying to get a performance report with invalid resource endpoint
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -733,3 +879,9 @@ Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}

JWT Encode
    [Arguments]    ${payload}    ${key}    ${algorithm}
    ${encoded}=    Evaluate    jwt.encode(${payload}, ${key}, ${algorithm})
    [Return]    ${encoded} 
Loading
Loading