diff --git a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot index 5bd4a1183ed5f51a74c8ac220885d009f5dd7afc..a9b8406fff04df6179dc770a19fd4a8ce5952211 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot @@ -6,75 +6,199 @@ Resource environment/IndividualPmJob.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** -GET Individual PM Job +GET individual VNF Performance Job + [Documentation] Test ID: 7.3.4.2.1 + ... 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: section 6.4.3.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET individual VNF Performance Job + 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 invalid resource identifier + [Documentation] Test ID: 7.3.4.2.2 + ... 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: section 6.4.3.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET individual VNF Performance Job with invalid resource identifier + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +DELETE Individual VNF Performance Job + [Documentation] Test ID: 7.3.4.2.3 + ... 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: section 6.4.3.3.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Job is no more available in the VNFM + Send Delete request for individual VNF Performance Job + Check HTTP Response Status Code Is 204 + Check Postcondition VNF Pm Job is Deleted + +DELETE Individual VNF Performance Job with invalid resource identifier + [Documentation] Test ID: 7.3.4.2.4 + ... 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: section 6.4.3.3.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Send Delete request for individual VNF Performance Job with invalid resource identifier + Check HTTP Response Status Code Is 404 + +POST Individual VNF Performance Job - Method not implemented + [Documentation] Test ID: 7.3.4.2.5 + ... 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: section 6.4.3.3.1 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Job is not created on the VNFM + Send Post request for individual VNF Performance Job + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Job is not Created + +PUT Individual VNF Performance Job - Method not implemented + [Documentation] Test ID: 7.3.4.2.6 + ... 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: section 6.4.3.3.4 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Job is not modified by the operation + Send Put request for individual VNF Performance Job + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Job is Unmodified (Implicit) + +PATCH Individual VNF Performance Job - Method not implemented + [Documentation] Test ID: 7.3.4.2.7 + ... Test title: PATCH Individual VNF Performance Job - method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to modify an existing new VNF Performance Monitoring Job + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM. + ... Reference: section 6.4.3.3.4 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Job is not modified by the operation + Send Patch request for individual VNF Performance Job + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Job is Unmodified (Implicit) + +*** Keywords *** +GET individual VNF Performance Job Log Trying to get a Pm Job present in the NFVO Catalogue Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJob.schema.json ${result} - Log Validation OK + ${output}= Output response + Set Suite Variable ${response} ${output} -GET Individual PM Job - Negative (Not Found) +GET individual VNF Performance Job with invalid resource identifier Log Trying to perform a negative get, using erroneous PM Job identifier Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId} - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK + ${output}= Output response + Set Suite Variable ${response} ${output} -DELETE Individual PM Job +Send Delete request for individual VNF Performance Job Log Trying to delete an existing PM Job Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Integer response status 204 - Log Received 204 No Content as expected - -DELETE Individual PM Job - Negative (Not Found) - Log Trying to delete an existing PM Job + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Delete request for individual VNF Performance Job with invalid resource identifier + Log Trying to perform a negative delete, using erroneous PM Job identifier Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId} - Integer response status 404 - Log Received 404 Not Found as expected - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - - -POST Individual PM Job - (Method not implemented) + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Post request for individual VNF Performance Job Log Trying to perform a POST (method should not be implemented) Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT Individual PM Job - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented + POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${newPmJobId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Put request for individual VNF Performance Job + Log Trying to perform a POST (method should not be implemented) Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} + ${origOutput}= Output response + Set Suite Variable ${origResponse} ${origOutput} PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Individual PM Job - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Patch request for individual VNF Performance Job + Log Trying to perform a PATCH (method should not be implemented) Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Integer response status 405 - Log Received 405 Method not implemented as expected + ${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}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${newPmJobId} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 404 + +Check Postcondition VNF Performance Job is Unmodified (Implicit) + Log Check Postcondition VNF PM job is not modified + GET individual VNF Performance Job + Log Check Response matches original VNF Pm Job + ${pmJob}= evaluate json.loads('''${response['body']}''') json + Should Be Equal ${origresponse['body']['id']} ${pmJob.id} + Should Be Equal ${origresponse['body']['criteria']} ${pmJob.criteria} + Should Be Equal ${origresponse['body']['_links']} ${pmJob._links} + +Check Postcondition VNF Pm Job is Deleted + Log Check Postcondition + GET individual VNF Performance Job + Check HTTP Response Status Code Is 404 + +Check HTTP Response Body Pm Job Identifier matches the requested Pm Job + Log Going to validate Pm Job info retrieved + Should Be Equal ${response['body']['id']} ${pmJobId} + Log Pm Job identifier as expected + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['status']} ${status} + Log Status code validated +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot index 8ad137fbf073882d4c89c0bfd6dfd6915de57a6f..46715a431d922791d51d2d16d21a13ee86ed7575 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot @@ -1,10 +1,4 @@ *** Settings *** -Documentation This resource represents an individual performance report that was collected by a PM job. The client can use this -... resource to read the performance report. The URI of this report can be obtained from a -... PerformanceInformationAvailableNotification (see clause 6.5.2.5) or from the representation of the "Individual PM job" -... resource. -... It is determined by means outside the scope of the present document, such as configuration or policy, how long an -... individual performance report is available. Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Resource environment/reports.txt @@ -12,63 +6,169 @@ Library JSONLibrary Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** -GET Report on Single PM Job - [Documentation] The client can use this method for reading an individual performance report. - ... This method shall follow the provisions specified in the tables 6.4.4.3.2-1 and 6.4.4.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. +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: section 6.4.4.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Get Individual Performance Report + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PerformanceReport + +Get Individual Performance Report with invalid resource endpoint + [Documentation] Test ID: 7.3.4.3.2 + ... 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: section 6.4.4.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Get Individual Performance Report with invalid resource endpoint + Check HTTP Response Status Code Is 404 + +POST Individual Performance Report - Method not implemented + [Documentation] Test ID: 7.3.4.3.3 + ... 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: section 6.4.4.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF performance report is not created on the VNFM + Send Post request for Individual Performance Report + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Individual Performance Report is not Created + +PUT Individual Performance Report - Method not implemented + [Documentation] Test ID: 7.3.4.3.4 + ... 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: section 6.4.4.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF performance report is not modified by the operation + Send Put request for Individual Performance Report + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Individual Performance Report is Unmodified (Implicit) + +PATCH Individual Performance Report - Method not implemented + [Documentation] Test ID: 7.3.4.3.5 + ... 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: section 6.4.4.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF performance report is not modified by the operation + Send Patch request for Individual Performance Report + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Individual Performance Report is Unmodified (Implicit) + +DELETE Individual Performance Report - Method not implemented + [Documentation] Test ID: 7.3.4.3.6 + ... Test title: DELETE Individual Performance Report - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed to delete an existing 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: section 6.4.4.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF performance report is not deleted by the operation + Send Delete request for Individual Performance Report + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Individual Performance Report Exists + +*** Keywords *** +Get Individual Performance Report + Log Trying to get a performance report present in the VNFM Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate result with PerformanceReport schema - ${result}= Output response body - Validate Json PerformanceReport.schema.json ${result} - -GET Report on Single PM Job - Negative (Not Found) - [Documentation] The client can use this method for reading an individual performance report. - ... This method shall follow the provisions specified in the tables 6.4.4.3.2-1 and 6.4.4.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. + ${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}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${erroneousReportId} - Integer response status 404 - Log Received 404 Not Found as expected - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -POST Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Post request for Individual Performance Report + Log Trying to create new performance report Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected + POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${newReportId} + ${output}= Output response + Set Suite Variable ${response} ${output} -PUT Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. +Send Put request for Individual Performance Report + Log Trying to update performance report Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} + ${origOutput}= Output response + Set Suite Variable ${origResponse} ${origOutput} PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Patch request for Individual Performance Report + Log Trying to update performance report Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} + ${origOutput}= Output response + Set Suite Variable ${origResponse} ${origOutput} PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -DELETE Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. +Send Delete request for Individual Performance Report + Log Trying to delete performance report Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check Postcondition VNF Individual Performance Report Exists + Log Checking that report still exists + Get Individual Performance Report + +Check Postcondition VNF Individual Performance Report is not Created + Log Trying to get a new report + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${newReportId} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 404 + +Check Postcondition VNF Individual Performance Report is Unmodified (Implicit) + Log Check Postcondition VNF PM job is not modified + Get Individual Performance Report + Log Check Response matches original VNF report + ${report}= evaluate json.loads('''${response['body']}''') json + Should Be Equal ${origResponse['body']['entries'][0]['objectInstanceId']} ${report['entries'][0]['objectInstanceId']} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['status']} ${status} + Log Status code validated + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot index 592f7b7ae252f02ab6bf52a1684f0748d663ccab..cbcd4578882862eda1d1298a18f2e08575707c53 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot @@ -1,5 +1,4 @@ *** Settings *** -Documentation This resource represents an individual threshold. Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Library JSONLibrary @@ -9,78 +8,196 @@ Resource environment/individualThresholds.txt *** Test Cases *** GET Individual Threshold - [Documentation] The client can use this method to query information about thresholds. - ... This method shall follow the provisions specified in the tables 6.4.5.3.2-1 and 6.4.5.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. + [Documentation] Test ID: 7.3.4.5.1 + ... 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: section 6.4.6.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET individual VNF Performance Threshold + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Threshold + Check HTTP Response Body Threshold Identifier matches the requested Threshold + +GET Individual Threshold with invalid resource identifier + [Documentation] Test ID: 7.3.4.5.2 + ... 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: section 6.4.6.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET individual VNF Performance Threshold with invalid resource identifier + Check HTTP Response Status Code Is 404 + +DELETE Individual Threshold + [Documentation] Test ID: 7.3.4.5.3 + ... 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: section 6.4.6.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Threshold is not available anymore in the VNFM + Send Delete request for individual VNF Performance Threshold + Check HTTP Response Status Code Is 204 + Check Postcondition VNF Performance Threshold is Deleted + +DELETE Individual Threshold with invalid resource identifier + [Documentation] Test ID: 7.3.4.5.4 + ... 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: section 6.4.6.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Send Delete request for individual VNF Performance Threshold with invalid resource identifier + Check HTTP Response Status Code Is 404 + +POST Individual Threshold - Method not implemented + [Documentation] Test ID: 7.3.4.5.5 + ... 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: section 6.4.6.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Threshold is not created on the VNFM + Send Post request for individual VNF Performance Threshold + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Threshold is not Created + +PUT Individual Threshold - Method not implemented + [Documentation] Test ID: 7.3.4.5.6 + ... 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: section 6.4.6.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Threshold is not modified by the operation + Send Put request for individual VNF Performance Threshold + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Threshold is Unmodified (Implicit) + +PATCH Individual Threshold - Method not implemented + [Documentation] Test ID: 7.3.4.5.7 + ... Test title: PATCH Individual Threshold - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to modify an existing VNF Performance threshold + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM. + ... Reference: section 6.4.6.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Threshold is not modified by the operation + Send Patch request for individual VNF Performance Threshold + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Threshold is Unmodified (Implicit) + +*** Keywords *** +GET Individual VNF Performance Threshold + Log Trying to get a Threhsold present in the VNFM Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - Log Trying to validate result with thresholds schema - Validate Json Threshold.schema.json ${result} - -GET Individual Threshold - Negative (Not Found) - [Documentation] The client can use this method to query information about thresholds. - ... This method shall follow the provisions specified in the tables 6.4.5.3.2-1 and 6.4.5.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. + ${output}= Output response + Set Suite Variable @{response} ${output} + +GET individual VNF Performance Threshold with invalid resource identifier + Log Trying to get a Threhsold with invalid resource endpoint Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} - Integer response status 404 - Log Received 404 Not Found as expected - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK + ${output}= Output response + Set Suite Variable @{response} ${output} -DELETE Individual Threshold - [Documentation] This method allows to delete a threshold. - ... This method shall follow the provisions specified in the tables 6.4.6.3.5-1, and 6.4.6.3.5-2 for URI query parameters, - ... request and response data structures, and response codes. +Send Delete request for individual VNF Performance Threshold + Log Trying to delete a Threhsold in the VNFM Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} - Integer response status 204 - Log Received 204 No Content as expected - ${body}= Output response body - Should Be Empty ${body} - Log Body of the response is empty - -DELETE Individual Threshold - Negative (Not Found) - [Documentation] This method allows to delete a threshold. - ... This method shall follow the provisions specified in the tables 6.4.6.3.5-1, and 6.4.6.3.5-2 for URI query parameters, - ... request and response data structures, and response codes. + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Delete request for individual VNF Performance Threshold with invalid resource identifier + Log Trying to delete a Threhsold in the VNFM with invalid id Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} - Integer response status 404 - Log Received 404 Not Found as expected - ${result}= Output response body - Log Trying to validate result with ProblemDetails schema - Validate Json ProblemDetails.schema.json ${result} - -POST Individual Threshold - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Post request for individual VNF Performance Threshold + Log Trying to create new threshold Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected + POST ${apiRoot}/${apiName}/${apiVersion}/thresholds/${newThresholdId} + ${output}= Output response + Set Suite Variable @{response} ${output} -PUT Individual Threshold - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. +Send Put request for individual VNF Performance Threshold + Log Trying to PUT threshold + Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected + GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} + ${origOutput}= Output response + Set Suite Variable ${origResponse} ${origOutput} + PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} + ${output}= Output response + Set Suite Variable @{response} ${output} -PATCH Individual Threshold - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. +Send Patch request for individual VNF Performance Threshold + Log Trying to PUT threshold + Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected + GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} + ${origOutput}= Output response + Set Suite Variable ${origResponse} ${origOutput} + PATCH ${apiRoot}/${apiName}/${apiVersion}/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 + Log Check Response matches original VNF Threshold + ${threshold}= evaluate json.loads('''${response['body']}''') json + Should Be Equal ${origresponse['body']['id']} ${threshold.id} + Should Be Equal ${origresponse['body']['criteria']} ${threshold.criteria} + +Check Postcondition VNF Performance Threshold is not Created + Log Trying to get a new Threshold + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${newThresholdId} + ${output}= Output response + Set Suite Variable @{response} ${output} + Check HTTP Response Status Code Is 404 + +Check Postcondition VNF Performance Threshold is Deleted + Log Check Postcondition Threshold is deleted + GET individual VNF Performance Threshold + Check HTTP Response Status Code Is 404 + +Check HTTP Response Body Threshold Identifier matches the requested Threshold + Log Trying to check response ID + Should Be Equal ${response['body']['id']} ${thresholdId} + Log Pm Job identifier as expected + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['status']} ${status} + Log Status code validated +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/PMJobs.robot b/SOL003/VNFPerformanceManagement-API/PMJobs.robot index 40c47dfaaf1e27d372384c124e3b9d4b184a7d24..67ba7e5985eaa7679a48ff0d24e28820e48ec653 100644 --- a/SOL003/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL003/VNFPerformanceManagement-API/PMJobs.robot @@ -8,184 +8,348 @@ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library MockServerLibrary *** Test Cases *** -GET all Pm Jobs +GET all VNF Performance Monitoring Jobs + [Documentation] Test ID: 7.3.4.1.1 + ... 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: section 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Does Not Contain reports + +GET VNF Performance Monitoring Jobs with attribute-based filter + [Documentation] Test ID: 7.3.4.1.2 + ... 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: section 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with attribute-based filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body PmJobs Matches the requested attribute-based filter + +GET all VNF Performance Monitoring Jobs with all_fields attribute selector + [Documentation] Test ID: 7.3.4.1.3 + ... 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: section 4.3.3.2.1, 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body PmJobs Matches the requested all_fields selector + +GET all VNF Performance Monitoring Jobs with exclude_default attribute selector + [Documentation] Test ID: 7.3.4.1.4 + ... 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: section 4.3.3.2.1, 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body PmJobs Matches the requested exclude_default selector + +GET all VNF Performance Monitoring Jobs with fields attribute selector + [Documentation] Test ID: 7.3.4.1.5 + ... 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: section 4.3.3.2.1, 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNFM supports the use of exclude_fields attribute selector + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body PmJobs Matches the requested fields selector + +GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector + [Documentation] Test ID: 7.3.4.1.6 + ... 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: section 4.3.3.2.1, 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNFM supports the use of exclude_fields attribute selector + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body PmJobs Matches the requested exclude_fields selector + +GET VNF Performance Monitoring Jobs with invalid attribute-based filter + [Documentation] Test ID: 7.3.4.1.7 + ... 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: section 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with invalid attribute-based filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET VNF Performance Monitoring Jobs with invalid resource endpoint + [Documentation] Test ID: 7.3.4.1.8 + ... 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: section 6.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with invalid resource endpoint + Check HTTP Response Status Code Is 404 + +Create new VNF Performance Monitoring Job + [Documentation] Test ID: 7.3.4.1.9 + ... 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: section 6.4.2.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Job is successfully created on the VNFM + Send Post Request Create new VNF Performance Monitoring Job + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is PmJob + Check Postcondition PmJob Exists + +PUT all VNF Performance Monitoring Jobs - Method not implemented + [Documentation] Test ID: 7.3.4.1.10 + ... 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: section 6.4.2.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Send PUT Request for all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 405 + +PATCH all VNF Performance Monitoring Jobs - (Method not implemented) + [Documentation] Test ID: 7.3.4.1.11 + ... 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: section 6.4.2.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 405 + +DELETE all VNF Performance Monitoring Jobs - Method not implemented + [Documentation] Test ID: 7.3.4.1.12 + ... 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: section 6.4.2.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Monitoring Jobs Exist + +*** Keywords *** +GET all VNF Performance Monitoring Jobs Log Trying to get all PM Jobs present in the VNFM Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${result} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -GET all Pm Jobs - Filter +GET VNF Performance Monitoring Jobs with attribute-based filter Log Trying to get all PM Jobs present in the VNFM, using filter params Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${POS_FILTER} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - -GET all Pm Jobs - all_fields + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET VNF Performance Monitoring Jobs with all_fields attribute selector Log Trying to get all PM Jobs present in the VNFM, using 'all_fields' filter Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?all_fields - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Trying to validate criteria schema - ${criteria}= Get Value From Json ${result} $..criteria - Validate Json criteria.schema.json ${criteria[0]} - Log Validation for criteria schema OK - Log Trying to validate criteria schema - ${reports}= Get Value From Json ${result} $..reports - Validate Json reports.schema.json ${reports[0]} - Log Validation for reports schema OK - Log Validating _links schema - ${links}= Get Value From Json ${result} $.._links - Validate Json links.schema.json ${links[0]} - Log Validation for _links schema OK + ${output}= Output response + Set Suite Variable ${response} ${output} -GET all Pm Jobs - exclude_default +GET VNF Performance Monitoring Jobs with exclude_default attribute selector Log Trying to get all VNF Packages present in the VNFM, using filter params Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?exclude_default - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${result} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -GET all Pm Jobs - fields +GET VNF Performance Monitoring Jobs with fields attribute selector Log Trying to get all VNF Packages present in the VNFM, using filter params Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Trying to validate criteria schema - ${criteria}= Get Value From Json ${result} $..criteria - Validate Json criteria.schema.json ${criteria[0]} - Log Validation for criteria schema OK - Log Trying to validate criteria schema - ${reports}= Get Value From Json ${result} $..reports - Validate Json reports.schema.json ${reports[0]} - Log Validation for reports schema OK + ${output}= Output response + Set Suite Variable ${response} ${output} -GET all Pm Jobs - exclude_fields +GET VNF Performance Monitoring Jobs with exclude_fields attribute selector Log Trying to get all VNF Packages present in the VNFM, using filter params Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${result} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected - + ${output}= Output response + Set Suite Variable ${response} ${output} -GET all Pm Jobs - Negative (wronge filter name) +GET VNF Performance Monitoring Jobs with invalid attribute-based filter Log Trying to get all PM Jobs present in the VNFM, using an erroneous filter param Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${NEG_FILTER} - Integer response status 400 - Log Received 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -GET all Pm Jobs (Negative: Not found) + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET VNF Performance Monitoring Jobs with invalid resource endpoint Log Trying to perform a GET on a erroneous URI Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_job # wrong URI /pm_job instead of /pm_jobs - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -POST all PM Jobs - Create new PM Job + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Post Request Create new VNF Performance Monitoring Job Log Creating a new PM Job Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} ${body}= Get File jsons/CreatePmJobRequest.json POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs ${body} - Integer response status 201 - Log Received 201 Created as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJob.schema.json ${result} - Log Validation OK - -PUT all PM Jobs - (Method not implemented) + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PUT Request for all VNF Performance Monitoring Jobs Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -PATCH all Pm Jobs - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented +Send PATCH Request for all VNF Performance Monitoring Jobs + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send DELETE Request for all VNF Performance Monitoring Jobs + Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -DELETE all Pm Jobs - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented +Check Postcondition VNF Performance Monitoring Jobs Exist + Log Checking that Pm Job still exists + GET all VNF Performance Monitoring Jobs + +Check Postcondition PmJob Exists + Log Checking that Pm Job exists Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${response['body']['id']} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJob + +Check HTTP Response Body PmJobs Matches the requested exclude_fields selector + Log Checking that reports element is missing + ${reports}= Get Value From Json ${response['body']} $..reports + Should Be Empty ${reports} + Log Checking that reports element is missing + ${criteria}= Get Value From Json ${response['body']} $..criteria + Should Be Empty ${criteria} + Log Reports element is empty as expected + +Check HTTP Response Body PmJobs Matches the requested fields selector + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${response['body']} $..criteria + Validate Json criteria.schema.json ${criteria[0]} + Log Validation for criteria schema OK + Log Trying to validate criteria schema + ${reports}= Get Value From Json ${response['body']} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + +Check HTTP Response Body PmJobs Matches the requested exclude_default selector + Log Checking that reports element is missing + ${reports}= Get Value From Json ${response['body']} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +Check HTTP Response Body PmJobs Matches the requested all_fields selector + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${response['body']} $..criteria + Validate Json criteria.schema.json ${criteria[0]} + Log Validation for criteria schema OK + Log Trying to validate criteria schema + ${reports}= Get Value From Json ${response['body']} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + Log Validating _links schema + ${links}= Get Value From Json ${response['body']} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +Check HTTP Response Body PmJobs Matches the requested Attribute-Based Filter + Log Checking that attribute-based filter is matched + #todo + +Check HTTP Response Body Does Not Contain reports + Log Checking that field element is missing + ${reports}= Get Value From Json ${response['body']} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['status']} ${status} + Log Status code validated + +Check HTTP Response Status Code Is 40x + Should Contain Any ${response['status']} 401 403 + Log Status code validated +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot b/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot deleted file mode 100644 index 9b6230d88ee0083ba7201443f4863aba7633370b..0000000000000000000000000000000000000000 --- a/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot +++ /dev/null @@ -1,63 +0,0 @@ -*** Setting *** -Resource environment/pmJobs.txt -Resource environment/IndividualPmJob.txt -Resource environment/variables.txt -Library OperatingSystem -Library BuiltIn -Library Collections -Library String -Library JSONSchemaLibrary schemas/ -Library JSONLibrary -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - - - -*** Test Cases *** -Create PMJob - ${post_response} = Create PMJob - Validate Status Code ${post_response.status_code} 201 - Validate Header ${post_response.headers} Content-Type - Validate JsonSchema ${post_response.body} PmJob.schema.json - ${get_response}= Retrieve PMJob ${post_response.body.id} - Should Not Be Empty ${get_response} - Validate Status Code ${get_response.status_code} 200 - Should Be Equal ${post_response.body.id} ${get_response.body.id} - Validate Header ${get_response.headers} Content-Type - Validate JsonSchema ${get_response.body} PmJob.schema.json - - -*** Keywords *** -Create PMJob - Log Creating a new PM Job - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/CreatePmJobRequest.json - POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs ${body} - [Return] response - - -Validate Status Code - [Arguments] ${curr_status} ${exp_status} - Should Be Equal ${curr_status} ${exp_status} - Log Status code validated - - -Validate Header - [Arguments] ${headers} ${CONTENT_TYPE} - Should Contain ${headers} ${CONTENT_TYPE} - Log Header is present - - -Validate JsonSchema - [Arguments] ${body} ${schema} - Validate Json ${schema} ${body} - Log Validation OK - -Retrieve PMJob - [Arguments] ${pmJobId} - Set Headers {"Accept":"${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${pmJobId} - [Return] response diff --git a/SOL003/VNFPerformanceManagement-API/Thresholds.robot b/SOL003/VNFPerformanceManagement-API/Thresholds.robot index 6e45a07033ed1a86cd8943ffbad87e56381b08af..788c8b4fdc2156a70b979a749ef2223e8aaa0ddd 100644 --- a/SOL003/VNFPerformanceManagement-API/Thresholds.robot +++ b/SOL003/VNFPerformanceManagement-API/Thresholds.robot @@ -1,5 +1,4 @@ *** Settings *** -Documentation This resource represents thresholds. The client can use this resource to create and query thresholds. Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Library JSONLibrary @@ -8,99 +7,212 @@ Resource environment/thresholds.txt Library OperatingSystem *** Test Cases *** -GET Thresholds - [Documentation] The client can use this method to query information about thresholds. - ... This method shall follow the provisions specified in the tables 6.4.5.3.2-1 and 6.4.5.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. +GET All Performance Thresholds + [Documentation] Test ID: 7.3.4.4.1 + ... 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: section 6.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all Performance Thresholds + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Thresholds + +GET Performance Thresholds with attribute-based filter + [Documentation] Test ID: 7.3.4.4.2 + ... 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: section 6.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET Performance Thresholds with attribute-based filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Thresholds + Check HTTP Response Body Thresholds match the requested attribute-based filter + +GET Performance Thresholds with invalid attribute-based filter + [Documentation] Test ID: 7.3.4.4.3 + ... 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: section 6.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET Performance Thresholds with invalid attribute-based filter + Check HTTP Response Status Code Is 404 + +GET Performance Thresholds with invalid resource endpoint + [Documentation] Test ID: 7.3.4.4.4 + ... 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: section 6.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Thresholds with invalid resource endpoint + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +Create new Performance Threshold + [Documentation] Test ID: 7.3.4.4.5 + ... 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: section 6.4.5.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Threshold is successfully created on the VNFM + Send Post Request Create new Performance Threshold + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is Threshold + Check HTTP Response Header Contains Location + Check Postcondition Threshold Exists + +PUT Performance Thresholds - Method not implemented + [Documentation] Test ID: 7.3.4.4.6 + ... 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: section 6.4.5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Send PUT Request for all Performance Thresholds + Check HTTP Response Status Code Is 405 + +PATCH Performance Thresholds - Method not implemented + [Documentation] Test ID: 7.3.4.4.7 + ... 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: section 6.4.5.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for all Performance Thresholds + Check HTTP Response Status Code Is 405 + +DELETE Performance Thresholds - Method not implemented + [Documentation] Test ID: 7.3.4.4.8 + ... 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: section 6.4.5.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF performance thresholds are not deleted by the failed operation + Send DELETE Request for all Performance Thresholds + Check HTTP Response Status Code Is 405 + Check Postcondition Thresholds Exist + +*** Keywords *** +GET all Performance Thresholds + Log Trying to get all thresholds present in the VNFM Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - Log Trying to validate result with thresholds schema - Validate Json Thresholds.schema.json ${result} - -GET Thresholds - Filter - [Documentation] The client can use this method to query information about thresholds. - ... This method shall follow the provisions specified in the tables 6.4.5.3.2-1 and 6.4.5.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET Performance Thresholds with attribute-based filter + Log Trying to get thresholds present in the VNFM with filter Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds?${FILTER_OK} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - Log Trying to validate result with Threshold schema - Validate Json Thresholds.schema.json ${result} - -GET Thresholds - NEGATIVE Filter - [Documentation] The client can use this method to query information about thresholds. - ... This method shall follow the provisions specified in the tables 6.4.5.3.2-1 and 6.4.5.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET Performance Thresholds with invalid attribute-based filter + Log Trying to get thresholds present in the VNFM with invalid filter Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds?${FILTER_KO} - Integer response status 400 - ${result}= Output response body - Log Trying to validate result with ProblemDetails schema - Validate Json ProblemDetails.schema.json ${result} - -GET Thresholds - Negative (Not Found) - [Documentation] The client can use this method to query information about thresholds. - ... This method shall follow the provisions specified in the tables 6.4.5.3.2-1 and 6.4.5.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET VNF Performance Thresholds with invalid resource endpoint + Log Trying to get thresholds present in the VNFM with invalid resource endpoint Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/threshold - Integer response status 404 - Log Received 404 Not Found as expected - ${problemDetails}= Output response body - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -POST Reports - [Documentation] The POST method can be used by the client to create a threshold. - ... This method shall follow the provisions specified in the tables 6.4.5.3.1-1 and 6.4.5.3.1-2 for URI query parameters, - ... request and response data structures, and response codes. - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Post Request Create new Performance Threshold + Log Creating a new THreshold + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${request}= Get File jsons/CreateThresholdRequest.json POST ${apiRoot}/${apiName}/${apiVersion}/thresholds ${request} - Integer response status 201 - Log Received 201 Created as expected - ${result}= Output response body - Log Trying to validate result with thresholds schema - Validate Json Threshold.schema.json ${result} - Log Trying to validate the Location header - ${headers}= Output response headers - Should Contain ${headers} Location - -PUT Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -PATCH Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} +Send PUT Request for all Performance Thresholds + Log PUT THresholds + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PATCH Request for all Performance Thresholds + Log PUT THresholds + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} -DELETE Reports - (Method not implemented) - [Documentation] This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method - ... Not Allowed" response as defined in clause 4.3.5.4. - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} +Send DELETE Request for all Performance Thresholds + Log DELETE THresholds + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check Postcondition Thresholds Exist + Log Checking that Thresholds still exists + GET all Performance Thresholds + +Check Postcondition Threshold Exists + Log Checking that Threshold exists + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${response['body']['id']} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Threshold + +Check HTTP Response Body Thresholds match the requested attribute-based filter + Log Checking that attribute-based filter is matched + #todo + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['status']} ${status} + Log Status code validated + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + diff --git a/SOL003/VNFPerformanceManagement-API/environment/IndividualPmJob.txt b/SOL003/VNFPerformanceManagement-API/environment/IndividualPmJob.txt index 0ee9980e02e89fc2f7932b8f3b668919ff803aeb..82010624aff8a8254df407c4c92cee40519b9e5b 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/IndividualPmJob.txt +++ b/SOL003/VNFPerformanceManagement-API/environment/IndividualPmJob.txt @@ -1,3 +1,6 @@ *** Variables *** ${pmJobId} 29f4ff6a-be91-4ec8-856e-fcf1e2479e4e ${erroneousPmJobId} erroneousPmJobId +${newPmJobId} newPmJobId +${response}= httpresponse +${OrigResponse}= httpresponse \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/environment/individualThresholds.txt b/SOL003/VNFPerformanceManagement-API/environment/individualThresholds.txt index 01c9fac3560ae6559b1e1cd27452dc1f5a0b2fd8..457736a9c80e6d2699add44a5a81f8f9504cbb55 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/individualThresholds.txt +++ b/SOL003/VNFPerformanceManagement-API/environment/individualThresholds.txt @@ -1,3 +1,6 @@ *** Variables *** ${thresholdId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a ${erroneousThresholdId} erroneousThresholdId +${newThresholdId} newThresholdId +${response}= httpresponse +${origResponse}= httpresponse \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/environment/reports.txt b/SOL003/VNFPerformanceManagement-API/environment/reports.txt index de12d5145866d4a221b5361816dec57eea14b902..6ac5f7c0b020825db1e44161c95118d9b08b5dbd 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/reports.txt +++ b/SOL003/VNFPerformanceManagement-API/environment/reports.txt @@ -1,4 +1,7 @@ *** Variables *** +${pmJobId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a ${reportId} 0fb4c875-e07f-46ca-a9dd-13907667a568 ${erroneousReportId} erroneousReportId -${pmJobId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a +${newReportId} newReportId +${response}= httpresponse +${OrigResponse}= httpresponse