diff --git a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot index 0f1f8bed0ab7b38cdfece7ffa86bedc509cfeb6c..274cc81a8632022d5504dcb2ad091ab5b72438e5 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot @@ -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,7 +131,34 @@ 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 Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance @@ -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}"} @@ -279,4 +326,9 @@ Check HTTP Response Header Contains ETag and Last-Modified Log ${response['headers']} Should Contain ${response['headers']} Etag Should Contain ${response['headers']} Last-Modified - Log Etag and Last-Modified Headers are present \ No newline at end of file + 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 diff --git a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot index 57ca4fdcbae5bd29dff1b4a792154aa9f4ac0ab7..d97782ce5569fe6701845b7b985d39237eca5985 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot @@ -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 diff --git a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot index 85ef306834913363145ea67169c729ffadc518be..b698c802d3d2f1112bcc079257b97f1fa65a2a50 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot @@ -7,7 +7,7 @@ Library OperatingSystem Library String Library Process Library MockServerLibrary - +Library jwt Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true @@ -17,11 +17,11 @@ GET Individual Threshold ... Test title: GET Individual Threshold ... Test objective: The objective is to test the retrieval of an individual VNF performance threshold and perform a JSON schema and content validation of the collected threshold data structure ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.6.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.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 Threshold + GET Individual VNF Performance Threshold Check HTTP Response Status Code Is 200 Check HTTP Response Header Contains ETag and Last-Modified Check HTTP Response Body Json Schema Is Threshold @@ -32,7 +32,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 VNF performance threshold 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.6.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.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 Threshold ... Test title: DELETE Individual Threshold ... Test objective: The objective is to test the deletion of an individual VNF performance threshold ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.6.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: The VNF Performance Threshold is not available anymore in the VNFM @@ -58,7 +58,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 VNF performance threshold ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.6.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.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 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 VNF Performance Threshold ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 6.4.6.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.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 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 VNF Performance threshold ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.6.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.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 Threshold ... Test title: PATCH Individual Threshold ... Test objective: The objective is to test that PATCH method allows to modify an Individual threshold resource. ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.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 Threshold - Precondition failed ... Test title: PATCH Individual Threshold - Preconition failed ... Test objective: The objective is to attempt to modify an individual threshold 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.6.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -122,7 +122,7 @@ PATCH Individual Threshold - Unprocessible Entity ... Test title: PATCH Individual Threshold - Unprocessible Entity ... Test objective: The objective is to test that PATCH method cannot modify an individual threshold 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 thresholds are set in the VNFM. - ... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -130,6 +130,33 @@ PATCH Individual Threshold - Unprocessible Entity Check HTTP Response Status Code Is 422 Check HTTP Response Body Json Schema Is ProblemDetails +GET Individual Threshold with permitted authorization scope + [Documentation] Test ID: 7.3.4.5.10 + ... Test title: GET Individual Threshold with permitted authorization scope + ... Test objective: The objective is to test the retrieval of an individual VNF performance threshold and perform a JSON schema and content validation of the collected threshold data structure + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. + ... Reference: Clause 6.4.6.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 Threshold with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains ETag and Last-Modified + Check HTTP Response Body Json Schema Is Threshold + Check HTTP Response Body Threshold Identifier matches the requested Threshold + +GET Individual Threshold with not permitted authorization scope + [Documentation] Test ID: 7.3.4.5.11 + ... Test title: GET Individual Threshold with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of an individual VNF performance threshold and perform a JSON schema and content validation of the collected threshold data structure with not permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. + ... Reference: Clause 6.4.6.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 Threshold with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Create Sessions @@ -226,9 +253,29 @@ Send Patch request for individual VNF Performance Threshold with unprocessable c ${output}= Output response Set Suite Variable ${response} ${output} +GET Individual VNF Performance Threshold with permitted authorization scope + Log Trying to get a Threhsold present in the VNFM with permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + ${scopeValue}= Create Dictionary scopeValue=${THRESHOLDS_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key=${OAUTH_KEY} algorithm=${OAUTH_ENCRYPTION_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET Individual VNF Performance Threshold with not permitted authorization scope + Log Trying to get a Threhsold present in the VNFM with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + ${scopeValue}= Create Dictionary scopeValue=${THRESHOLDS_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}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check Postcondition VNF Performance Threshold is Unmodified (Implicit) Log Check postconidtion threshold not modified - GET individual VNF Performance Threshold + GET Individual VNF Performance Threshold with permitted authorization scope Log Check Response matches original VNF Threshold ${threshold}= evaluate json.loads('''${response['body']}''') json Should Be Equal ${origresponse['body']['id']} ${threshold.id} @@ -236,7 +283,7 @@ Check Postcondition VNF Performance Threshold is Unmodified (Implicit) Check Postcondition VNF Performance Threshold is Deleted Log Check Postcondition Threshold is deleted - GET individual VNF Performance Threshold + GET Individual VNF Performance Threshold with permitted authorization scope Check HTTP Response Status Code Is 404 Check HTTP Response Body Threshold Identifier matches the requested Threshold @@ -269,3 +316,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 diff --git a/SOL003/VNFPerformanceManagement-API/NotificationEndpoint.robot b/SOL003/VNFPerformanceManagement-API/NotificationEndpoint.robot index a72911e36314c63e4c1e9ff019c5ea88aba1380a..d8ecc1828912d56254b0eaaa966e7fe90f1ae9ec 100644 --- a/SOL003/VNFPerformanceManagement-API/NotificationEndpoint.robot +++ b/SOL003/VNFPerformanceManagement-API/NotificationEndpoint.robot @@ -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 diff --git a/SOL003/VNFPerformanceManagement-API/Notifications.robot b/SOL003/VNFPerformanceManagement-API/Notifications.robot index 5f5a3d398e624e7b46c2b9ea196ca672498445c2..e5e6f26c3139e64637b3f92286f6acb54bc1c162 100644 --- a/SOL003/VNFPerformanceManagement-API/Notifications.robot +++ b/SOL003/VNFPerformanceManagement-API/Notifications.robot @@ -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 diff --git a/SOL003/VNFPerformanceManagement-API/PMJobs.robot b/SOL003/VNFPerformanceManagement-API/PMJobs.robot index eb92ae2bc4b3d20be62a0dbdd96100730bc36ac1..8eebbd4b3a696074bbe24b9f92d5c68b78105066 100644 --- a/SOL003/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL003/VNFPerformanceManagement-API/PMJobs.robot @@ -7,7 +7,7 @@ Library String Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false Library MockServerLibrary Library Process - +Library jwt Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true @@ -18,7 +18,7 @@ GET all VNF Performance Monitoring Jobs ... Test title: GET all VNF Performance Monitoring Jobs ... Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.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 VNF Performance Monitoring Jobs with attribute-based filter ... Test title: GET all VNF Performance Monitoring Jobs with attribute-based filter ... Test objective: The objective is to test the retrieval of VNF performance monitoring jobs using attribute-based filter, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued attribute-based filter ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -46,7 +46,7 @@ GET all VNF Performance Monitoring Jobs with all_fields attribute selector ... Test title: GET all VNF Performance Monitoring Jobs with all_fields attribute selector ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs all_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued all_fileds selector ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -60,7 +60,7 @@ GET all VNF Performance Monitoring Jobs with exclude_default attribute selector ... Test title: GET all VNF Performance Monitoring Jobs with exclude_default attribute selector ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_default attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_default selector ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -74,7 +74,7 @@ GET all VNF Performance Monitoring Jobs with fields attribute selector ... Test title: GET all VNF Performance Monitoring Jobs with fields attribute selector ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued fields selector ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports the use of exclude_fields attribute selector ... Post-Conditions: none @@ -88,7 +88,7 @@ GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector ... Test title: GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_fields selector ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports the use of exclude_fields attribute selector ... Post-Conditions: none @@ -102,7 +102,7 @@ GET VNF Performance Monitoring Jobs with invalid attribute-based filter ... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter ... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid attribute-based filter, 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 VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -115,7 +115,7 @@ GET VNF Performance Monitoring Jobs with invalid resource endpoint ... Test title: GET VNF Performance Monitoring Jobs with invalid resource endpoint ... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid resource endpoint ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -127,7 +127,7 @@ Create new VNF Performance Monitoring Job ... Test title: Create a new VNF Performance Monitoring Job ... Test objective: The objective is to test the creation of a new VNF performance monitoring job and perform the JSON schema validation of the returned job data structure ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: The VNF Performance Job is successfully created on the VNFM @@ -141,7 +141,7 @@ PUT all VNF Performance Monitoring Jobs - Method not implemented ... Test title: PUT all VNF Performance Monitoring Jobs - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify VNF Performance Monitoring Jobs ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -153,7 +153,7 @@ PATCH all VNF Performance Monitoring Jobs - (Method not implemented) ... Test title: PATCH all VNF Performance Monitoring Jobs - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update VNF Performance Monitoring Jobs ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -165,7 +165,7 @@ DELETE all VNF Performance Monitoring Jobs - Method not implemented ... Test title: DELETE all VNF Performance Monitoring Jobs - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to update VNF Performance Monitoring Jobs ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -178,7 +178,7 @@ GET all VNF Performance Monitoring Jobs as Paged Response ... Test title: GET all VNF Performance Monitoring Jobs as Paged Response ... Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs as Paged Response. ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports response paging for the VNF performance jobs resources ... Post-Conditions: none @@ -191,7 +191,7 @@ GET all VNF Performance Monitoring Jobs as Paged Response with nextpage_opauque_ ... Test title: GET all VNF Performance Monitoring Jobs as Paged Response with nextpage_opauque_marker parameter ... Test objective: The objective is to query information about all the available VNF performance monitoring jobs as a Paged Response and retrieve the next page using the nextpage_opaque_marker parameter ... Pre-conditions: A request for retrieving the available VNF performance monitoring jobs as a paged response has been successfully issued (Test ID 7.3.4.1.13) - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports response paging for the VNF performance jobs resources ... Post-Conditions: none @@ -203,7 +203,7 @@ GET VNF Performance Monitoring Jobs - Bad Request Response too Big ... Test title: GET VNF Performance Monitoring Jobs - Bad Request Response too Big ... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails because response is too big, 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 VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -216,7 +216,7 @@ GET all VNF Performance Monitoring Jobs with fields and exclude_default attribut ... Test title: GET all VNF Performance Monitoring Jobs with fields and exclude_default attribute selector ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs fields and exclude_default attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued fields selector ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. - ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports the use of fields and exclude_fields attribute selector ... Post-Conditions: none @@ -230,13 +230,40 @@ POST Create new VNF Performance Monitoring Job - Unprocessable Content ... Test title: POST Create new VNF Performance Monitoring Job - Unprocessable Content ... Test objective: The objective is to test the creation of a new VNF performance monitoring job fails when a request contains syntactically correct data but the data cannot be processed. ... Pre-conditions: none - ... Reference: clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Send Post Request for VNF Performance Monitoring Job with unprocessable content Check HTTP Response Status Code Is 422 - Check HTTP Response Body Json Schema Is ProblemDetails + Check HTTP Response Body Json Schema Is ProblemDetails + +GET all VNF Performance Monitoring Jobs with permitted authorization scope + [Documentation] Test ID: 7.3.4.1.17 + ... Test title: GET all VNF Performance Monitoring Jobs with permitted authorization scope + ... Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all VNF Performance Monitoring Jobs with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Does Not Contain reports + +GET all VNF Performance Monitoring Jobs with not permitted authorization scope + [Documentation] Test ID: 7.3.4.1.18 + ... Test title: GET all VNF Performance Monitoring Jobs with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure with not permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all VNF Performance Monitoring Jobs with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Create Sessions @@ -381,6 +408,26 @@ Send DELETE Request for all VNF Performance Monitoring Jobs ${output}= Output response Set Suite Variable ${response} ${output} +GET all VNF Performance Monitoring Jobs with permitted authorization scope + Log Trying to get all PM Jobs 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}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET all VNF Performance Monitoring Jobs with not permitted authorization scope + Log Trying to get all PM Jobs 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}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs + ${output}= Output response + Set Suite Variable ${response} ${output} + Check Postcondition VNF Performance Monitoring Jobs Exist Log Checking that Pm Job still exists GET all VNF Performance Monitoring Jobs @@ -481,4 +528,9 @@ Send Post Request for VNF Performance Monitoring Job with unprocessable content ${body}= Format String ${template} objectInstanceIds=${objectInstanceIds} callback_uri=${unreachable_callback_uri}:${callback_port} POST ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs ${body} ${output}= Output response - Set Suite Variable ${response} ${output} \ No newline at end of file + Set Suite Variable ${response} ${output} + +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/Thresholds.robot b/SOL003/VNFPerformanceManagement-API/Thresholds.robot index 860f1025fee3b7cc03347cbcd2f8f9ea5fde8b1e..595acf62f7b164cfe7cf41cdf8845712cfe60389 100644 --- a/SOL003/VNFPerformanceManagement-API/Thresholds.robot +++ b/SOL003/VNFPerformanceManagement-API/Thresholds.robot @@ -7,7 +7,7 @@ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_veri Library OperatingSystem Library Process Library MockServerLibrary - +Library jwt Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true @@ -17,7 +17,7 @@ GET All Performance Thresholds ... Test title: GET All Performance Thresholds ... Test objective: The objective is to test the retrieval of all the available VNF performance thresholds and perform a JSON schema validation of the collected thresholds data structure ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -30,7 +30,7 @@ GET Performance Thresholds with attribute-based filter ... Test title: GET Performance Thresholds with attribute-based filter ... Test objective: The objective is to test the retrieval of all the available VNF performance thresholds when using attribute-based filters, perform a JSON schema validation of the collected thresholds data structure, and verify that the retrieved information matches the issued attribute-based filter ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -44,7 +44,7 @@ GET Performance Thresholds with invalid attribute-based filter ... Test title: GET Performance Thresholds with invalid attribute-based filter ... Test objective: The objective is to test that the retrieval of VNF performance thresholds fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -56,7 +56,7 @@ GET Performance Thresholds with invalid resource endpoint ... Test title: GET Performance Thresholds with invalid resource endpoint ... Test objective: The objective is to test that the retrieval of VNF performance thresholds fails when using invalid resource endpoint, and perform the JSON schema validation of the failed operation HTTP response ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -69,7 +69,7 @@ Create new Performance Threshold ... Test title: Create new Performance Threshold ... Test objective: The objective is to test the creation of a new VNF performance threshold and perform the JSON schema validation of the returned threshold data structure ... Pre-conditions: A VNF instance is instantiated. - ... Reference: Clause 6.4.5.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: The VNF Performance Threshold is successfully created on the VNFM @@ -84,7 +84,7 @@ PUT Performance Thresholds - Method not implemented ... Test title: PUT Performance Thresholds - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify VNF Performance Thresholds ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNF. - ... Reference: Clause 6.4.5.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -96,7 +96,7 @@ PATCH Performance Thresholds - Method not implemented ... Test title: PATCH Performance Thresholds - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to modify VNF Performance Thresholds ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -108,7 +108,7 @@ DELETE Performance Thresholds - Method not implemented ... Test title: DELETE Performance Thresholds - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to update VNF Performance Thresholds ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: The VNF performance thresholds are not deleted by the failed operation @@ -121,7 +121,7 @@ GET All Performance Thresholds as Paged Response ... Test title: GET All Performance Thresholds as Paged Response ... Test objective: The objective is to test the retrieval of all the available VNF performance thresholds as a Paged Response. ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -134,7 +134,7 @@ GET Performance Thresholds - Bad Request Response too Big ... Test title: GET Performance Thresholds - Bad Request Response too Big ... Test objective: The objective is to test that the retrieval of VNF performance thresholds fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. - ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -147,13 +147,39 @@ POST create new Performance Threshold - Unprocessable Content ... Test title: POST create new Performance Threshold - Unprocessable Content ... Test objective: The objective is to test that creation of new VNF performance threshold fails when a request contains syntactically correct data but the data cannot be processed. ... Pre-conditions: A VNF instance is instantiated. - ... Reference: Clause 6.4.5.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 6.4.5.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Send Post Request Create new Performance Threshold with unprocessable content Check HTTP Response Status Code Is 422 Check HTTP Response Body Json Schema Is ProblemDetails + +GET All Performance Thresholds with permitted authorization scope + [Documentation] Test ID: 7.3.4.4.12 + ... Test title: GET All Performance Thresholds with permitted authorization scope + ... Test objective: The objective is to test the retrieval of all the available VNF performance thresholds and perform a JSON schema validation of the collected thresholds data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all Performance Thresholds with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Thresholds + +GET All Performance Thresholds with not permitted authorization scope + [Documentation] Test ID: 7.3.4.4.13 + ... Test title: GET All Performance Thresholds with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of all the available VNF performance thresholds and perform a JSON schema validation of the collected thresholds data structure with not permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. + ... Reference: Clause 6.4.5.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all Performance Thresholds with not permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Thresholds *** Keywords *** Create Sessions @@ -247,6 +273,26 @@ Send DELETE Request for all Performance Thresholds ${output}= Output response Set Suite Variable ${response} ${output} +GET all Performance Thresholds with permitted authorization scope + Log Trying to get all thresholds present in the VNFM with permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + ${scopeValue}= Create Dictionary scopeValue=${THRESHOLDS_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}/thresholds + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET all Performance Thresholds with not permitted authorization scope + Log Trying to get all thresholds present in the VNFM with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + ${scopeValue}= Create Dictionary scopeValue=${THRESHOLDS_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}/thresholds + ${output}= Output response + Set Suite Variable ${response} ${output} + Check Postcondition Thresholds Exist Log Checking that Thresholds still exists GET all Performance Thresholds @@ -288,3 +334,7 @@ Check LINK in Header ${linkURL}= Get Value From Json ${response['headers']} $..Link Should Not Be Empty ${linkURL} +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/environment/variables.txt b/SOL003/VNFPerformanceManagement-API/environment/variables.txt index 576c93a629c6415d35f5c006db03945ac44ab736..a6358213e2d6f5cfef0d33341f2b9b4dd7d55a0d 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/variables.txt +++ b/SOL003/VNFPerformanceManagement-API/environment/variables.txt @@ -3,10 +3,15 @@ ${VNFM_HOST} localhost # Hostname of the VNFM ${VNFM_PORT} 8080 # Listening port of the VNFM ${VNFM_SCHEMA} https - +${OAUTH_KEY} +${OAUTH_ENCRYPTION_ALGORITHM} HS256 ${AUTHORIZATION_HEADER} Authorization -${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${PM_JOBS_PERMITTED_SCOPE} vnfpm:v1:pm_jobs +${PM_JOBS_NOT_PERMITTED_SCOPE} vnfpm:v1:pm_jobs:invalid +${THRESHOLDS_PERMITTED_SCOPE} vnfpm:v1:thresholds +${THRESHOLDS_NOT_PERMITTED_SCOPE} vnfpm:v1:thresholds:invalid +${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_PATCH} application/merge-patch+json ${ACCEPT_JSON} application/json