diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 64b565270f02e4ab546f04277e3f0d62884ee676..2294752f04133810641e1aa2bc72260d0b9b8915 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -16,22 +16,20 @@ POST Configuration - Method not implemented Log Validate Status code Integer response status 405 -Get information about a configuration - Log Query VNF The GET method queries information about a configuration. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/configuration - ${Etag}= Output response headers Etag - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfConfiguration.schema.json ${json} - Log Validation OK +Get information about a configuration + [Documentation] Test ID: 9.4.2.2 + ... Test title: Get information about a configuration + ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration + ... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID: 9.4.2.1) + ... Reference: section 9.4.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers + ... Post-Conditions: The VNF configuration is not modified by the operation + Get VNF configuration + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains Etag + Check HTTP Response Body Json Schema Is vnfConfiguration + Check Postcondition VNF Configuration Untouched PUT Config - Method not implemented log Trying to perform a PUT. This method should not be implemented @@ -41,22 +39,59 @@ PUT Config - Method not implemented Log Validate Status code Integer response status 405 -PATCH Config - log Trying to perform a PATCH. This method modifies the configuration +Set new VNF Configuration + [Documentation] Test ID: 9.4.2.1 + ... Test title: Set a new VNF Configuration + ... Test objective: The objective is to test the creation of a new VNF configuration + ... Pre-conditions: A VNF instance is up and running + ... Reference: section 9.4.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers + ... Post-Conditions: The VNF configuration is set + Send VNF configuration + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains Etag + Check HTTP Response Body Json Schema Is vnfConfiModifications + Check Postcondition VNF Is Configured + +Set new VNF Configuration - HTTP Etag precondition failed + [Documentation] Test ID: 9.4.2.3 + ... Test title: Set a new VNF Configuration - HTTP Etag precondition failed + ... Test objective: The objective is to test the failure in setting a duplication of VNF configuration identified by an already used HTTP Etag identifier. + ... Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID: 9.4.2.1) with a given HTTP Etag identifier. + ... Reference: section 9.4.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers + ... Post-Conditions: The VNF configuration is not modified by the operation + Send Duplicated VNF configuration + Check HTTP Response Status Code Is 412 + Check HTTP Response Body Json Schema Is ProblemDetails + Check Postcondition VNF Configuration Untouched + +DELETE Config - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/configuration + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Get VNF configuration + Log Query VNF The GET method queries information about a configuration. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/configuration + +Send VNF configuration + log Trying to perform a PATCH. This method modifies the configuration Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File json/vnfConfigModifications.json - Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} - Log Validate Status code - ${Etag_modified}= Output response headers Etag - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfConfigModifications.schema.json ${json} - Log Validation OK + ${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} PATCH Config - Precondition failed [Documentation] Precondition Failed @@ -64,24 +99,39 @@ PATCH Config - Precondition failed ... Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity. ... The response body should contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified - log Trying to perform a PATCH. This method modifies an individual alarm resource + log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"If-Match": "${Etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File json/vnfConfigModifications.json - Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} - Log Validate Status code - Integer response status 412 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK + ${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} -DELETE Config - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/configuration - Log Validate Status code - Integer response status 405 \ No newline at end of file +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_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] ${schema} + ${contentType}= Get Value From Json ${response.headers} $..Content-Type + Should Be Equal ${contentType} ${CONTENT_TYPE} + ${json}= evaluate json.loads('''${response.body}''') json + Validate Json ${schema} ${json} + Log Json Schema Validation OK + +Check Postcondition VNF Configuration Untouched + Log Check Postcondition for GET + #todo + +Check Postcondition VNF Is Configured + Log Check Postcondition for PATCH + Get VNF configuration + ${output}= evaluate json.loads('''${response.body}''') json + ${input}= Get File json/vnfConfigModifications.json + Should Be Equal ${output} ${input} diff --git a/SOL002/VNFFaultManagement-API/Alarms.robot b/SOL002/VNFFaultManagement-API/Alarms.robot index 7da097d1d715195fde47d2561f9aef4984a428ae..33fa0f43c5d4dec174b73d15716240aa3ed3d718 100644 --- a/SOL002/VNFFaultManagement-API/Alarms.robot +++ b/SOL002/VNFFaultManagement-API/Alarms.robot @@ -16,7 +16,15 @@ POST Alarms - Method not implemented Log Validate Status code Integer response status 405 -Get information about multiple alarms +Get information about multiple alarms + [Documentation] Test ID: 7.4.2.1 + ... Test title: Get information about multiple alarms + ... Test objective: The objective is to retrieve information about the alarm list + ... Pre-conditions: + ... Reference: section 7.4.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Query VNF The GET method queries information about multiple alarms. Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} @@ -32,6 +40,14 @@ Get information about multiple alarms Log Validation OK Get information about multiple alarms with filters + [Documentation] Test ID: 7.4.2.2 + ... Test title: Get information about multiple alarms - with filters + ... Test objective: The objective is to retrieve information about the alarm list + ... Pre-conditions: + ... Reference: section 7.4.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Query VNF The GET method queries information about multiple alarms with filters. Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} @@ -47,6 +63,14 @@ Get information about multiple alarms with filters Log Validation OK Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 7.4.2.2-1 + ... Test title: Get information about multiple alarms - with Invalid attribute-based filtering parameters + ... Test objective: The objective is to retrieve information about the alarm list + ... Pre-conditions: + ... Reference: section 7.4.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Query VNF The GET method queries information about multiple alarm instances. Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} diff --git a/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot b/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot index 6b8e85783079256ef00ad27f68417502f564c46f..4ca642eb9cf017368286ddd047b858ee7fdd57d1 100644 --- a/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot +++ b/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot @@ -6,7 +6,14 @@ Suite Setup Check resource existance *** Test Cases *** Escalate the perceived severity - [Documentation] escalate the perceived severity of an alarm with the VNFM + [Documentation] Test ID: 7.4.4.1 + ... Test title: Escalate the perceived severity + ... Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource. + ... Pre-conditions: The resource representing the individual alarm has been created + ... Reference: section 7.4.4 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log escalate the perceived severity of an alarm with the VNFM Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} diff --git a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot index 5ef1f23735e4d4234009ac4d946307c2908de897..260dfebcdd5961fc9f6c380fb8eebf2e8721b97c 100644 --- a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot @@ -18,7 +18,15 @@ POST Alarm - Method not implemented Log Validate Status code Integer response status 405 -Get information about a configuration +Get information about a configuration + [Documentation] Test ID: 7.4.3.1 + ... Test title: Get information about an alarm + ... Test objective: The objective is to read an individual alarm. + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Query VNF The GET method queries information about an alarm. Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} @@ -44,7 +52,14 @@ PUT Alarm - Method not implemented Integer response status 405 PATCH Alarm - [Documentation] This method modifies an individual alarm resource + [Documentation] Test ID: 7.4.3.2 + ... Test title: Modify an individual alarm resource + ... Test objective: The objective is to Modify an individual alarm resource + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} @@ -62,10 +77,14 @@ PATCH Alarm Log Validation OK PATCH Alarm - Conflict - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the �Individual alarm� resource. - ... Typically, this is due to the fact that the alarm is already in the state that is requested to be set (such as trying to acknowledge an already-acknowledged alarm). - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Documentation] Test ID: 7.4.3.2-1 + ... Test title: Modify an individual alarm resource - Conflict + ... Test objective: The objective is to Modify an individual alarm resource + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: The alarm resource is not modified Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} @@ -81,10 +100,14 @@ PATCH Alarm - Conflict Log Validation OK PATCH Alarm - Precondition failed - [Documentation] Precondition Failed - ... A precondition given in an HTTP request header is not fulfilled. Typically, this is due to an ETag mismatch, - ... indicating that the resource was modified by another entity. The response body should contain a ProblemDetails structure, - ... in which the �detail� attribute should convey more information about the error. + [Documentation] Test ID: 7.4.3.2-1 + ... Test title: Modify an individual alarm resource - Precondition failed + ... Test objective: The objective is to Modify an individual alarm resource + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: The alarm resource is not modified Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} diff --git a/SOL002/VNFFaultManagement-API/IndividualSubscription.robot b/SOL002/VNFFaultManagement-API/IndividualSubscription.robot index 4b0746fd0804539c211b944433516dd3a991bdb0..a6afd61e16d1fd3980faa4f597f042e9ff541db9 100644 --- a/SOL002/VNFFaultManagement-API/IndividualSubscription.robot +++ b/SOL002/VNFFaultManagement-API/IndividualSubscription.robot @@ -19,6 +19,14 @@ Post Individual Subscription - Method not implemented Integer response status 405 Get Information about an individual subscription + [Documentation] Test ID: 7.4.6.1 + ... Test title: Retrieve the alarm subscriptions + ... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client + ... Pre-conditions: The subscription with the given id exists + ... Reference: section 7.4.6 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: log Trying to get information about an individual subscription Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} @@ -61,7 +69,6 @@ DELETE an individual subscription Integer response status 204 *** Keywords *** - Check resource existance Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} diff --git a/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot b/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot index e377f2661bb01b852000d37b5b097eb52ec82697..aa3b33dca1f67c5c0c892276bf635c63dd37a90b 100644 --- a/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot +++ b/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot @@ -8,55 +8,84 @@ Library OperatingSystem *** Test Cases *** Deliver a notification - Alarm + [Documentation] Test ID: 7.4.5.1 + ... Test title: Deliver a notification - Alarm + ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. + ... Pre-conditions: The VNF has subscribed to the VNFM alarm + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: log The POST method delivers a notification - Information of a VNF alarm. ${json}= Get File schemas/alarmNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher Schema POST ${callback_uri} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} Log Verifying results - Verify Mock Expectation ${req} + Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} Log Cleaning the endpoint Clear Requests ${callback_uri} Deliver a notification - Alarm Clearance + [Documentation] Test ID: 7.4.5.2 + ... Test title: Deliver a notification - Alarm Clearance + ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. + ... Pre-conditions: The VNF has subscribed to the VNFM alarm + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: log The POST method delivers a notification - Information of a VNF alarm. ${json}= Get File schemas/alarmClearedNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher Schema POST ${callback_uri} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} Log Verifying results - Verify Mock Expectation ${req} + Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} Log Cleaning the endpoint Clear Requests ${callback_uri} Deliver a notification - Alarm List Rebuilt + [Documentation] Test ID: 7.4.5.3 + ... Test title: Deliver a notification - Alarm List Rebuilt + ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. + ... Pre-conditions: The VNF has subscribed to the VNFM alarm + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: log The POST method delivers a notification - Information of a VNF alarm. ${json}= Get File schemas/alarmListRebuiltNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} Log Verifying results - Verify Mock Expectation ${req} + Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} Log Cleaning the endpoint Clear Requests ${callback_endpoint} Test a notification end point + [Documentation] Test ID: 7.4.5.4 + ... Test title: Test a notification end point + ... Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription + ... Pre-conditions: + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: log The GET method allows the server to test the notification endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${callback_endpoint} + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${notification_ep} + Log Validate Status code + Integer response status 204 + Log Validation OK PUT notification - Method not implemented log Trying to perform a PUT. This method should not be implemented @@ -83,4 +112,4 @@ DELETE subscriptions - Method not implemented Create Sessions Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${callback_schema}://${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-7.3.4 \ No newline at end of file + Create Mock Session ${callback_schema}://${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-7.3.4 diff --git a/SOL002/VNFFaultManagement-API/Subscriptions.robot b/SOL002/VNFFaultManagement-API/Subscriptions.robot index 0647a789ceb0c52ad894abada2f4bdf441b92e49..644bc0c0712ec3af28cb8d97bbb525df93648c77 100644 --- a/SOL002/VNFFaultManagement-API/Subscriptions.robot +++ b/SOL002/VNFFaultManagement-API/Subscriptions.robot @@ -8,6 +8,14 @@ Library JSONSchemaLibrary schemas/ *** Test Cases *** Create a new subscription + [Documentation] Test ID: 7.4.5.1 + ... Test title: Create a new alarm subscription + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: no subscription with the same filter and callbackUri exists + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} @@ -26,6 +34,14 @@ Create a new subscription Log Validation OK Create a new Subscription - DUPLICATION + [Documentation] Test ID: 7.4.5.2 + ... Test title: Create a new alarm subscription - DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists + ... Post-Conditions: Log Trying to create a subscription with an already created content Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test Set Headers {"Accept": "${ACCEPT}"} @@ -43,6 +59,14 @@ Create a new Subscription - DUPLICATION Log Validation OK Create a new Subscription - NO-DUPLICATION + [Documentation] Test ID: 7.4.5.3 + ... Test title: Create a new alarm subscription - NO DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: the VNFM decides to not create a duplicate subscription resource + ... Post-Conditions: Log Trying to create a subscription with an already created content Pass Execution If ${NVFM_DUPLICATION} == 1 VNFM permits duplication. Skipping the test Set Headers {"Accept": "${ACCEPT}"} @@ -57,6 +81,14 @@ Create a new Subscription - NO-DUPLICATION Log Validation OK GET Subscriptions + [Documentation] Test ID: 7.4.5.4 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions + ... Pre-conditions: + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Get the list of active subscriptions Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} @@ -71,6 +103,14 @@ GET Subscriptions Log Validation OK GET Subscription - Filter + [Documentation] Test ID: 7.4.5.5 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with filter + ... Pre-conditions: + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Get the list of active subscriptions using a filter Set Headers {"Accept": "${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} @@ -83,6 +123,14 @@ GET Subscription - Filter Log Validation OK GET subscriptions - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 7.4.5.5-1 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters + ... Pre-conditions: + ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: Log Get the list of active subscriptions using an invalid filter Set Headers {"Accept": "${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} diff --git a/SOL002/VNFFaultManagement-API/environment/variables.txt b/SOL002/VNFFaultManagement-API/environment/variables.txt index dbd89e4f5e2a7282ec902ce0532b11176a3bec2e..8777927890c97a4eabe181752a33d124d683fe51 100644 --- a/SOL002/VNFFaultManagement-API/environment/variables.txt +++ b/SOL002/VNFFaultManagement-API/environment/variables.txt @@ -32,3 +32,5 @@ ${callback_endpoint} /notification ${AlarmNotification} {} ${AlarmClearedNotification} {} ${AlarmListRebuiltNotification} {} +${PerceivedSeverity} CRITICAL +${sleep_interval} 20s diff --git a/SOL002/VNFIndicatorNotification-API/VnfIndicatorNotification.robot b/SOL002/VNFIndicatorNotification-API/VnfIndicatorNotification.robot index 02f5c707d4421caf1db6d1bb11a64bb501e9fa86..8745df345d6d2bdc298fac1e1217ae2625a23650 100644 --- a/SOL002/VNFIndicatorNotification-API/VnfIndicatorNotification.robot +++ b/SOL002/VNFIndicatorNotification-API/VnfIndicatorNotification.robot @@ -12,8 +12,8 @@ Library String *** Test Cases *** Check Notification Endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Verify Mock Expectation ${req} @@ -23,8 +23,8 @@ Post VNF Indicator Notification ${json}= Get File schemas/VnfIndicatorValueChangeNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle VNF Indicator Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -36,8 +36,8 @@ Post VNF Indicator Notification Negative 404 ${json}= Get File schemas/ProblemDetails.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle VNF Indicator Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -49,8 +49,8 @@ Post VNF Indicator Notification Negative 404 PUT VNF Indicator Notification Log PUT Method not implemented - &{req}= Create Mock Request Matcher Schema PUT ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -61,8 +61,8 @@ PUT VNF Indicator Notification PATCH VNF Indicator Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema PATCH ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -73,8 +73,8 @@ PATCH VNF Indicator Notification DELETE VNF Indicator Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema DELETE ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results diff --git a/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot b/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot index b5b895983c8b1bae38c4fdc2ebf4588e6bd20186..2ae26999fd830c077d6518f53f498ef0022d1b35 100644 --- a/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot @@ -22,7 +22,7 @@ Post Cancel operation task Should Contain ${headers} Location Log Validation OK -Post Fail operation task Conflict (Not-FAILED_TEMP) +Post Cancel operation task Conflict (Not-FAILED_TEMP) # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state [Documentation] Conflict. ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. @@ -32,7 +32,7 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) Depends on test failure Check resource FAILED_TEMP Log Final Fail an operation Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel Integer response status 409 Log Status code validated ${problemDetails}= Output response body @@ -40,7 +40,7 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${json} Log Validation OK -Post Fail operation task Conflict (parallel LCM operation) +Post Cancel operation task Conflict (parallel LCM operation) # TODO: Need to set the pre-condition of the test [Documentation] Conflict ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. @@ -50,7 +50,7 @@ Post Fail operation task Conflict (parallel LCM operation) [Setup] Launch another error handling action log Final Fail an operation Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel Log Validate Status code Integer response status 409 ${problemDetails}= Output response body @@ -59,7 +59,7 @@ Post Fail operation task Conflict (parallel LCM operation) Log Validation OK [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished -Post Fail operation task Not Found +Post Cancel operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent [Documentation] Not Found ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. @@ -70,7 +70,7 @@ Post Fail operation task Not Found [Setup] Check Fail not supported log Final fail an operation Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel Log Validate Status code Integer response status 409 ${problemDetails}= Output response body @@ -78,31 +78,31 @@ Post Fail operation task Not Found Validate Json ProblemDetails.schema.json ${json} Log Validation OK -GET Fail operation task - Method not implemented +GET Cancel operation task - Method not implemented log Trying to perform a GET. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/cancel Log Validate Status code Integer response status 405 -PUT Fail operation task - Method not implemented +PUT Cancel operation task - Method not implemented log Trying to perform a PUT. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/cancel Log Validate Status code Integer response status 405 -PATCH Fail operation task - Method not implemented +PATCH Cancel operation task - Method not implemented log Trying to perform a PATCH. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/cancel Log Validate Status code Integer response status 405 -DELETE Fail operation task - Method not implemented +DELETE Cancel operation task - Method not implemented log Trying to perform a DELETE. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/cancel Log Validate Status code Integer response status 405 diff --git a/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot index e6cb7a104ee86672de4f0e7adde3f50c673cc0e2..b8ff08a0cb2351740931c660839ff3bf4a730254 100644 --- a/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -57,7 +57,6 @@ DELETE an individual subscription Integer response status 204 *** Keywords *** - Check resource existance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} diff --git a/SOL002/VNFLifecycleManagement-API/NotificationEndpoint.robot b/SOL002/VNFLifecycleManagement-API/NotificationEndpoint.robot index f9591fd9df8ace5e174cb982a8bae3dfabfbbdf2..51d8673bcef57270224eebe6e9ae826566966e3a 100644 --- a/SOL002/VNFLifecycleManagement-API/NotificationEndpoint.robot +++ b/SOL002/VNFLifecycleManagement-API/NotificationEndpoint.robot @@ -15,8 +15,8 @@ Deliver a notification - Operation Occurence ${json}= Get File schemas/vnfLcmOperationOccurrenceNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -29,8 +29,8 @@ Deliver a notification - Id Creation ${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -43,8 +43,8 @@ Deliver a notification - Id deletion ${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${notification_ep} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -54,8 +54,8 @@ Deliver a notification - Id deletion Test a notification end point log The GET method allows the server to test the notification endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher GET ${notification_ep} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Verify Mock Expectation ${req} @@ -86,4 +86,4 @@ DELETE subscriptions - Method not implemented Create Sessions Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${callback_schema}://${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-5.3.9 \ No newline at end of file + Create Mock Session ${callback_schema}://${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-5.3.9 diff --git a/SOL002/VNFLifecycleManagement-API/VNFInstances.robot b/SOL002/VNFLifecycleManagement-API/VNFInstances.robot index c8039f68f792f16047694a0fa1600a2c59cdac94..894c63df63e1718616ac1a1d145eb710b871a351 100644 --- a/SOL002/VNFLifecycleManagement-API/VNFInstances.robot +++ b/SOL002/VNFLifecycleManagement-API/VNFInstances.robot @@ -8,7 +8,6 @@ Library JSONLibrary Library JSONSchemaLibrary schemas/ *** Test Cases *** - Create a new vnfInstance [Setup] #make sure the vnfInstand ${vnfInstanceId} doesn't exist Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances diff --git a/SOL002/VNFLifecycleManagement-API/jsons/operateVnfRequest.json b/SOL002/VNFLifecycleManagement-API/jsons/operateVnfRequest.json index 92dc07fa2d2641bac5b02ad4a0472d7735dcc05c..2ead53e198a7a32420eb866a8b0b732bf3a8ee12 100644 --- a/SOL002/VNFLifecycleManagement-API/jsons/operateVnfRequest.json +++ b/SOL002/VNFLifecycleManagement-API/jsons/operateVnfRequest.json @@ -1,5 +1,5 @@ { "changeStateTo": "STOPPED", - "stopType": "FORCEFUL" + "stopType": "FORCEFUL", "additionalParams": {} } \ No newline at end of file diff --git a/SOL002/VNFPerformanceManagement-API/PMJobs.robot b/SOL002/VNFPerformanceManagement-API/PMJobs.robot index b7fa8f70f527a047d2f4902823ce6fb9fc8924b7..f6ea5998ac96835b7cde58fafa49ca8da69ce001 100644 --- a/SOL002/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL002/VNFPerformanceManagement-API/PMJobs.robot @@ -85,7 +85,7 @@ GET all Pm Jobs - exclude_default GET all Pm Jobs - fields Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' + 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} @@ -108,7 +108,7 @@ GET all Pm Jobs - fields GET all Pm Jobs - exclude_fields Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' + 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} diff --git a/SOL002/VNFPerformanceManagement-API/Subscriptions.robot b/SOL002/VNFPerformanceManagement-API/Subscriptions.robot index 5810808bb636e4f2a4ec3cc21c9cafa4e9f6ec79..fafc6f83e3d9307965fdfbaf4c96d9fdc699cfd7 100644 --- a/SOL002/VNFPerformanceManagement-API/Subscriptions.robot +++ b/SOL002/VNFPerformanceManagement-API/Subscriptions.robot @@ -98,7 +98,7 @@ POST Subscription Should Contain ${contentType} application/json ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscriptions.schema.json ${json} + Validate Json PmSubscription.schema.json ${json} Log Validated PmSubscription schema Log Trying to validate the Location header ${headers}= Output response headers diff --git a/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot b/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot index aeaf91d6ecf1ad51fed8338225ed354d5a8efc18..3fa52b96972bbde214cc6c0e4f3b6f0848b81d4a 100644 --- a/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot +++ b/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot @@ -11,8 +11,8 @@ Library String *** Test Cases *** Check Notification Endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Verify Mock Expectation ${req} @@ -22,8 +22,8 @@ Post Performance Information Available Notification ${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle Performance Information Available Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -36,8 +36,8 @@ Post Performance Information Available Notification Negative 404 ${json}= Get File schemas/ProblemDetails.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle Performance Information Available Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -49,8 +49,8 @@ Post Threshold Crossed Notification ${json}= Get File schema/ThresholdCrossedNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle Threshold Crossed Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -63,8 +63,8 @@ PostThreshold Crossed Notification Negative 404 ${json}= Get File schemas/ProblemDetails.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handleThreshold Crossed Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -75,8 +75,8 @@ PostThreshold Crossed Notification Negative 404 PUT Performance Notification Log PUT Method not implemented - &{req}= Create Mock Request Matcher Schema PUT ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -87,8 +87,8 @@ PUT Performance Notification PATCH Performance Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema PATCH ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -99,8 +99,8 @@ PATCH Performance Notification DELETE Performance Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema DELETE ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results diff --git a/SOL002/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json b/SOL002/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json index 23ee9e24cda8498a1a4a9fa4f3cd283c9378c1ee..fc476acf121099eb3c670f1c9a1eca9f6a197522 100644 --- a/SOL002/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json +++ b/SOL002/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json @@ -7,7 +7,7 @@ "crossingDirection": "UP", "objectInstanceId": "vnfID", "performanceMetric": "performanceMetric", - "performanceValue": 7 + "performanceValue": 7, "_links": { "subscription": "link to subscription", "threshold": "link to threshold" diff --git a/SOL003/VNFFaultManagement-API/Alarms.robot b/SOL003/VNFFaultManagement-API/Alarms.robot index d7a8555a6206dfa19995be8d257f4b104b8e1f7d..3e5089234eb512d7bc6e8e055db91b9bfebc956f 100644 --- a/SOL003/VNFFaultManagement-API/Alarms.robot +++ b/SOL003/VNFFaultManagement-API/Alarms.robot @@ -1,84 +1,107 @@ -*** Settings *** -# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFFaultManagement-API.yaml -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Library OperatingSystem - -*** Test Cases *** -POST Alarms - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/alarms - Log Validate Status code - Integer response status 405 - -Get information about multiple alarms - Log Query VNF The GET method queries information about multiple alarms. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/alarms - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Alarms.schema.json ${json} - Log Validation OK - -Get information about multiple alarms with filters - Log Query VNF The GET method queries information about multiple alarms with filters. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId} - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Alarms.schema.json ${json} - Log Validation OK - -Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters - Log Query VNF The GET method queries information about multiple alarm instances. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId} - Log Validate Status code - Integer response status 400 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT Alarms - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/alarms - Log Validate Status code - Integer response status 405 - -PATCH Alarms - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/alarms - Log Validate Status code - Integer response status 405 - -DELETE Alarms - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/alarms - Log Validate Status code - Integer response status 405 - +*** Settings *** +# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFFaultManagement-API.yaml +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library OperatingSystem + +*** Test Cases *** +POST Alarms - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/alarms + Log Validate Status code + Integer response status 405 + +Get information about multiple alarms + [Documentation] Test ID: 7.4.2.1 + ... Test title: Get information about multiple alarms + ... Test objective: The objective is to retrieve information about the alarm list + ... Pre-conditions: + ... Reference: section 7.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about multiple alarms. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/alarms + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Alarms.schema.json ${json} + Log Validation OK + +Get information about multiple alarms with filters + [Documentation] Test ID: 7.4.2.2 + ... Test title: Get information about multiple alarms - with filters + ... Test objective: The objective is to retrieve information about the alarm list + ... Pre-conditions: + ... Reference: section 7.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about multiple alarms with filters. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/alarms?${alarm_filter}=${managedObjectId} + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Alarms.schema.json ${json} + Log Validation OK + +Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 7.4.2.2-1 + ... Test title: Get information about multiple alarms - with Invalid attribute-based filtering parameters + ... Test objective: The objective is to retrieve information about the alarm list + ... Pre-conditions: + ... Reference: section 7.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about multiple alarm instances. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/alarms?${invalid_alarm_filter}=${managedObjectId} + Log Validate Status code + Integer response status 400 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT Alarms - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/alarms + Log Validate Status code + Integer response status 405 + +PATCH Alarms - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/alarms + Log Validate Status code + Integer response status 405 + +DELETE Alarms - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/alarms + Log Validate Status code + Integer response status 405 diff --git a/SOL003/VNFFaultManagement-API/IndividualAlarm.robot b/SOL003/VNFFaultManagement-API/IndividualAlarm.robot index 2bd8634bb41ff43e6738b51c1534f3c1b69bf6bf..0fef1927371fdae72f8f03c7652a274551462d55 100644 --- a/SOL003/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL003/VNFFaultManagement-API/IndividualAlarm.robot @@ -1,115 +1,134 @@ -*** Settings *** -# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFFaultManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Library DependencyLibrary - -*** Variables *** -${Etag}= an etag -${Etag_modified}= a modified etag - -*** Test Cases *** -POST Alarm - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - Log Validate Status code - Output response - Integer response status 405 - -Get information about an alarm - Log Query VNF The GET method queries information about multiple alarms. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - ${Etag}= Output response headers Etag - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Alarm.schema.json ${json} - Log Validation OK - -PUT Alarm - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - Log Validate Status code - Output response - Integer response status 405 - -PATCH Alarm - [Documentation] This method modifies an individual alarm resource - log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/alarmModifications.json - Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} - Log Validate Status code - ${Etag_modified}= Output response headers Etag - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json AlarmModification.schema.json ${json} - Log Validation OK - -PATCH Alarm - Conflict - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the �Individual alarm� resource. - ... Typically, this is due to the fact that the alarm is already in the state that is requested to be set (such as trying to acknowledge an already-acknowledged alarm). - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state - log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/alarmModifications.json - Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PATCH Alarm - Precondition failed - [Documentation] Precondition Failed - ... A precondition given in an HTTP request header is not fulfilled. Typically, this is due to an ETag mismatch, - ... indicating that the resource was modified by another entity. The response body should contain a ProblemDetails structure, - ... in which the �detail� attribute should convey more information about the error. - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified - log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/alarmModifications.json - Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} - Log Validate Status code - Integer response status 412 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -DELETE Alarm - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - Log Validate Status code - Output response - Integer response status 405 +*** Settings *** +# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFFaultManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library DependencyLibrary + + +*** Test Cases *** +POST Alarm - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} + Log Validate Status code + Output response + Integer response status 405 + +Get information about an alarm + [Documentation] Test ID: 7.4.3.1 + ... Test title: Get information about an alarm + ... Test objective: The objective is to read an individual alarm. + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about an alarm. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} + ${Etag}= Output response headers Etag + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json alarm.schema.json ${json} + Log Validation OK + +PUT Alarm - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} + Log Validate Status code + Output response + Integer response status 405 + +PATCH Alarm + [Documentation] Test ID: 7.4.3.2 + ... Test title: Modify an individual alarm resource + ... Test objective: The objective is to Modify an individual alarm resource + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log Trying to perform a PATCH. This method modifies an individual alarm resource + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/alarmModifications.json + Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} + Log Validate Status code + ${Etag_modified}= Output response headers Etag + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json AlarmModification.schema.json ${json} + Log Validation OK + +PATCH Alarm - Conflict + [Documentation] Test ID: 7.4.3.2-1 + ... Test title: Modify an individual alarm resource - Conflict + ... Test objective: The objective is to Modify an individual alarm resource + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: The alarm resource is not modified + log Trying to perform a PATCH. This method modifies an individual alarm resource + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/alarmModifications.json + Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PATCH Alarm - Precondition failed + [Documentation] Test ID: 7.4.3.2-1 + ... Test title: Modify an individual alarm resource - Precondition failed + ... Test objective: The objective is to Modify an individual alarm resource + ... Pre-conditions: The related alarm exists + ... Reference: section 7.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: The alarm resource is not modified + Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified + log Trying to perform a PATCH. This method modifies an individual alarm resource + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${Etag}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/alarmModifications.json + Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} + Log Validate Status code + Integer response status 412 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Alarm - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} + Log Validate Status code + Output response + Integer response status 405 diff --git a/SOL003/VNFFaultManagement-API/IndividualSubscription.robot b/SOL003/VNFFaultManagement-API/IndividualSubscription.robot index 0b3eaf6ee9f454349194c4add384c6d70ea82113..45e735fd0e8a69e12cf69b5fa6e87c424794d424 100644 --- a/SOL003/VNFFaultManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFFaultManagement-API/IndividualSubscription.robot @@ -1,68 +1,76 @@ -*** Settings *** -Resource environment/variables.txt -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFFaultManagement-API.yaml -Documentation This resource represents an individual subscription for VNF alarms. -... The client can use this resource to read and to terminate a subscription to notifications related to VNF fault management. -Suite Setup Check resource existance - -*** Test Cases *** -Post Individual Subscription - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Output response - Integer response status 405 - -Get Information about an individual subscription - log Trying to get information about an individual subscription - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json FmSubscription.schema.json ${json} - Log Validation OK - -PUT an individual subscription - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Output response - Integer response status 405 - -PATCH an individual subscription - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Output response - Integer response status 405 - -DELETE an individual subscription - log Try to delete an individual subscription - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Output response - Integer response status 204 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} +*** Settings *** +Resource environment/variables.txt +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFFaultManagement-API.yaml +Documentation This resource represents an individual subscription for VNF alarms. +... The client can use this resource to read and to terminate a subscription to notifications related to VNF fault management. +Suite Setup Check resource existance + +*** Test Cases *** +Post Individual Subscription - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Output response + Integer response status 405 + +Get Information about an individual subscription + [Documentation] Test ID: 7.4.5.1 + ... Test title: Retrieve the alarm subscriptions + ... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client + ... Pre-conditions: The subscription with the given id exists + ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log Trying to get information about an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json FmSubscription.schema.json ${json} + Log Validation OK + +PUT an individual subscription - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Output response + Integer response status 405 + +PATCH an individual subscription - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Output response + Integer response status 405 + +DELETE an individual subscription + log Try to delete an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Output response + Integer response status 204 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Integer response status 200 \ No newline at end of file diff --git a/SOL003/VNFFaultManagement-API/Subscriptions.robot b/SOL003/VNFFaultManagement-API/Subscriptions.robot index 23e88e3adf85f62977df194410ef4d7981f70e5f..f6affa00eb1acb5f2054beb8a7d17404fc8aae42 100644 --- a/SOL003/VNFFaultManagement-API/Subscriptions.robot +++ b/SOL003/VNFFaultManagement-API/Subscriptions.robot @@ -1,122 +1,170 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFFaultManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ - -*** Test Cases *** -Create a new subscription - Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/fmSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json FmSubscription.schema.json ${json} - Log Validation OK - -Create a new Subscription - DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NVFM_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/fmSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json FmSubscription.schema.json ${json} - Log Validation OK - -Create a new Subscription - NO-DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NVFM_DUPLICATION} == 1 VNFM permits duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/fmSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 303 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -GET Subscriptions - Log Get the list of active subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 200 - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json FmSubscriptions.schema.json ${json} - Log Validation OK - -GET Subscription - Filter - Log Get the list of active subscriptions using a filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} - Integer response status 200 - Log Received a 200 OK as expected - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json FmSubscriptions.schema.json ${json} - Log Validation OK - -GET subscriptions - Bad Request Invalid attribute-based filtering parameters - Log Get the list of active subscriptions using an invalid filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} - Integer response status 400 - Log Received a 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT subscriptions - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 - -PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 - -DELETE subscriptions - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 +*** Settings *** +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFFaultManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Create a new subscription + [Documentation] Test ID: 7.4.4.1 + ... Test title: Create a new alarm subscription + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: no subscription with the same filter and callbackUri exists + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/fmSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json FmSubscription.schema.json ${json} + Log Validation OK + +Create a new Subscription - DUPLICATION + [Documentation] Test ID: 7.4.4.2 + ... Test title: Create a new alarm subscription - DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists + ... Post-Conditions: + Log Trying to create a subscription with an already created content + Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/fmSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Status code validated + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json FmSubscription.schema.json ${json} + Log Validation OK + +Create a new Subscription - NO-DUPLICATION + [Documentation] Test ID: 7.4.4.3 + ... Test title: Create a new alarm subscription - NO DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: the VNFM decides to not create a duplicate subscription resource + ... Post-Conditions: + Log Trying to create a subscription with an already created content + Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM permits duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/fmSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +GET Subscriptions + [Documentation] Test ID: 7.4.4.4 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions + ... Pre-conditions: + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Get the list of active subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 200 + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json FmSubscriptions.schema.json ${json} + Log Validation OK + +GET Subscription - Filter + [Documentation] Test ID: 7.4.4.5 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with filter + ... Pre-conditions: + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Get the list of active subscriptions using a filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} + Integer response status 200 + Log Received a 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json FmSubscriptions.schema.json ${json} + Log Validation OK + +GET subscriptions - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 7.4.4.5-1 + ... Test title: Retrieve a list of alarm subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters + ... Pre-conditions: + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Get the list of active subscriptions using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} + Integer response status 400 + Log Received a 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT subscriptions - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 + +PATCH subscriptions - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 + +DELETE subscriptions - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 \ No newline at end of file diff --git a/SOL003/VNFFaultManagement-API/environment/variables.txt b/SOL003/VNFFaultManagement-API/environment/variables.txt index 4a176e0f92204ab41fda0340c92162b91a395ec2..5e225f3a27974bbb7da6ba1f556af26b4a175f85 100644 --- a/SOL003/VNFFaultManagement-API/environment/variables.txt +++ b/SOL003/VNFFaultManagement-API/environment/variables.txt @@ -1,40 +1,31 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== -${CONTENT_TYPE} application/json -${CONTENT_TYPE_PATCH} application/merge-patch+json -${ACCEPT} application/json -${apiRoot} / -${apiName} vnffm -${apiVersion} v1 -${AUTH_USAGE} 1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX -${alarm_filter} managedObjectId -${managedObjectId} 007c111c-38a1-42c0-a666-7475ecb1567c -${invalid_alarm_filter} badFilter -${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${vnfInstanceDescription} description vnf -${vnfInstanceDescription_Update} Updated description vnf -${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip -${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c -${ARTIFACT_TYPE} application/octet-stream -${ARTIFACT_ID} artifactId -${WRONG_ACCEPT} application/json -${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${CancelMode} GRACEFUL -${LccnSubscriptionRequest} {} -${NVFM_DUPLICATION} 0 -${sub_filter} filter -${sub_filter_invalid} filter_invalid -${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${notification_ep} notification -${AlarmNotification} {} -${AlarmClearedNotification} {} -${AlarmListRebuiltNotification} {} \ No newline at end of file +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${VNFM_SCHEMA} https +${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${CONTENT_TYPE} application/json +${ACCEPT} application/json +${AUTH_USAGE} 1 + +${alarm_filter} managedObjectId +${managedObjectId} 007c111c-38a1-42c0-a666-7475ecb1567c +${invalid_alarm_filter} badFilter + +${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d +${CONTENT_TYPE_PATCH} application/merge-patch+json + +${Etag}= an etag +${Etag_modified}= a modified etag + +${VNFM_DUPLICATION} 1 +${sub_filter} filter +${sub_filter_invalid} filter_invalid + +${apiRoot} / +${apiName} vnffm +${apiVersion} v1 + +${AlarmNotification} {} +${AlarmClearedNotification} {} +${AlarmListRebuiltNotification} {} + diff --git a/SOL003/VNFFaultManagement-API/schemas/Alarms.schema.json b/SOL003/VNFFaultManagement-API/schemas/Alarms.schema.json index 218ce5f6562ae800c0c402023455fbaf9d0ed107..4be8e6ffbff559575aa9b78095abe87023c19ff1 100644 --- a/SOL003/VNFFaultManagement-API/schemas/Alarms.schema.json +++ b/SOL003/VNFFaultManagement-API/schemas/Alarms.schema.json @@ -1,5 +1,5 @@ { - "type": "array", + "type": "object", "items": { "description": "The alarm data type encapsulates information about an alarm.\n", "type": "object", @@ -94,7 +94,6 @@ ] }, "perceivedSeverity": { - "description": "Indicates the relative level of urgency for operator attention. * CRITICAL: The Critical severity level indicates that a service\n affecting condition has occurred and an immediate corrective action\n is required. Such a severity can be reported, for example, when a\n managed object becomes totally out of service and its capability needs\n to be restored (ITU-T Recommendation X.733).\n* MAJOR: The Major severity level indicates that a service affecting\n condition has developed and an urgent corrective action is required.\n Such a severity can be reported, for example, when there is a severe\n degradation in the capability of the managed object and its full\n capability needs to be restored (ITU-T Recommendation X.733).\n* MINOR: The Minor severity level indicates the existence of a\n non-service affecting fault condition and that corrective action\n should be taken in order to prevent a more serious (for example,\n service affecting) fault. Such a severity can be reported, for\n example, when the detected alarm condition is not currently degrading\n the capacity of the managed object (ITU-T Recommendation X.733).\n* WARNING: The Warning severity level indicates the detection of a\n potential or impending service affecting fault, before any significant\n effects have been felt. Action should be taken to further diagnose (if\n necessary) and correct the problem in order to prevent it from\n becoming a more serious service affecting fault (ITU-T Recommendation\n X.733).\n* INDETERMINATE: The Indeterminate severity level indicates that the\n severity level cannot be determined (ITU-T Recommendation X.733).\n* CLEARED: The Cleared severity level indicates the clearing of one or\n more previously reported alarms. This alarm clears all alarms for this\n managed object that have the same Alarm type, Probable cause and\n Specific problems (if given) (ITU-T Recommendation X.733).\n", "type": "string", "enum": [ "CRITICAL", @@ -111,7 +110,7 @@ "format": "date-time" }, "eventType": { - "description": "The enumeration EventType represents those types of events that trigger an alarm. * COMMUNICATIONS_ALARM: An alarm of this type is associated with the\n procedure and/or process required conveying information from one point\n to another (ITU-T Recommendation X.733).\n* PROCESSING_ERROR_ALARM: An alarm of this type is associated with a\n software or processing fault (ITU-T Recommendation X.733).\n* ENVIRONMENTAL_ALARM: An alarm of this type is associated with a\n condition related to an enclosure in which the equipment resides\n (ITU-T Recommendation X.733).\n* QOS_ALARM: An alarm of this type is associated with degradation in the\n quality of a service (ITU-T Recommendation X.733).\n* EQUIPMENT_ALARM: An alarm of this type is associated with an equipment\n fault (ITU-T Recommendation X.733).\n", + "description": "The enumeration EventType represents those types of events that trigger an alarm. * COMMUNICATIONS_ALARM: An alarm of this type is associated with the procedure and/or process required conveying information from one point\n to another (ITU-T Recommendation X.733).\n* PROCESSING_ERROR_ALARM: An alarm of this type is associated with a software or processing fault (ITU-T Recommendation X.733).\n* ENVIRONMENTAL_ALARM: An alarm of this type is associated with a condition related to an enclosure in which the equipment resides\n (ITU-T Recommendation X.733).\n* QOS_ALARM: An alarm of this type is associated with degradation in the quality of a service (ITU-T Recommendation X.733).\n* EQUIPMENT_ALARM: An alarm of this type is associated with an equipment fault (ITU-T Recommendation X.733).\n", "type": "string", "enum": [ "COMMUNICATIONS_ALARM", @@ -187,4 +186,4 @@ } } } -} \ No newline at end of file +} diff --git a/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot b/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot index dbb1b7a8900554a89162fb842a8dd0ca01d034bf..23568cc9c0edf3faabf4877de1346d783a799191 100644 --- a/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot +++ b/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot @@ -1,88 +1,114 @@ -*** Settings *** -Resource variables.txt -Suite Setup Create Sessions -Suite Teardown Terminate All Processes kill=true -Library MockServerLibrary -Library Process -Library OperatingSystem -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port} - - -*** Test Cases *** -Deliver a notification - Alarm - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Deliver a notification - Alarm Clearance - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmClearedNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Deliver a notification - Alarm List Rebuilt - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmListRebuiltNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Test a notification end point - log The GET method allows the server to test the notification endpoint - &{req}= Create Mock Request Matcher Schema GET ${notification_ep} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${notification_ep} - -PUT notification - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Put ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Patch ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -DELETE subscriptions - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Delete ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -*** Keywords *** -Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${notification_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port} #The API producer is set to NFVO according to SOL003-7.3.4 \ No newline at end of file +*** Settings *** +Resource environment/variables.txt +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Library MockServerLibrary +Library Process +Library OperatingSystem + + +*** Test Cases *** +Deliver a notification - Alarm + [Documentation] Test ID: 7.4.5.1 + ... Test title: Deliver a notification - Alarm + ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. + ... Pre-conditions: The VNF has subscribed to the VNFM alarm + ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log The POST method delivers a notification - Information of a VNF alarm. + ${json}= Get File schemas/alarmNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle alarmNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Log Verifying results + Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Deliver a notification - Alarm Clearance + [Documentation] Test ID: 7.4.5.2 + ... Test title: Deliver a notification - Alarm Clearance + ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. + ... Pre-conditions: The VNF has subscribed to the VNFM alarm + ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log The POST method delivers a notification - Information of a VNF alarm. + ${json}= Get File schemas/alarmClearedNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle alarmNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Log Verifying results + Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Deliver a notification - Alarm List Rebuilt + [Documentation] Test ID: 7.4.5.3 + ... Test title: Deliver a notification - Alarm List Rebuilt + ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. + ... Pre-conditions: The VNF has subscribed to the VNFM alarm + ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log The POST method delivers a notification - Information of a VNF alarm. + ${json}= Get File schemas/alarmListRebuiltNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle alarmNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Log Verifying results + Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Test a notification end point + [Documentation] Test ID: 7.4.5.4 + ... Test title: Test a notification end point + ... Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription + ... Pre-conditions: + ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log The GET method allows the server to test the notification endpoint + Get ${callback_endpoint} + Log Validate Status code + Integer response status 204 + Log Validation OK + +PUT notification - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Put ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +PATCH subscriptions - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Patch ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +DELETE subscriptions - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Delete ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-7.3.4 diff --git a/SOL003/VNFFaultManagementNotification-API/environment/variables.txt b/SOL003/VNFFaultManagementNotification-API/environment/variables.txt index c1a3977d2904b539af558522e4dbb3af6d795d0a..e2296a0cdc9f5ee4c507a5b2d43e5963edbad206 100644 --- a/SOL003/VNFFaultManagementNotification-API/environment/variables.txt +++ b/SOL003/VNFFaultManagementNotification-API/environment/variables.txt @@ -1,39 +1,5 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== -${CONTENT_TYPE} application/json -${CONTENT_TYPE_PATCH} application/merge-patch+json -${ACCEPT} application/json -${apiRoot} / -${apiName} vnflcm -${apiVersion} v1 -${AUTH_USAGE} 1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX -${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${vnfInstanceName} Test-VnfInstance -${vnfInstanceDescription} description vnf -${vnfInstanceDescription_Update} Updated description vnf -${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip -${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c -${ARTIFACT_TYPE} application/octet-stream -${ARTIFACT_ID} artifactId -${WRONG_ACCEPT} application/json -${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${CancelMode} GRACEFUL -${NVFM_DUPLICATION} 0 -${sub_filter} filter -${sub_filter_invalid} filter_invalid -${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${notification_ep} /notification -${notification_port} 9091 -${VnfLcmOperationOccurrenceNotification} {} -${VnfIdentifierCreationNotification} {} -${VnfIdentifierDeletionNotification} {} -${sleep_interval} 20s \ No newline at end of file +*** Variables *** +${callback_endpoint} /notification +${callback_uri} http://localhost +${callback_port} 9091 +${sleep_interval} 20s diff --git a/SOL003/VNFFaultManagementNotification-API/schemas/ProblemDetails.schema.json b/SOL003/VNFFaultManagementNotification-API/schemas/ProblemDetails.schema.json index cb8cecc4e0695aca03163370e39c5fe6e194253b..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 100644 --- a/SOL003/VNFFaultManagementNotification-API/schemas/ProblemDetails.schema.json +++ b/SOL003/VNFFaultManagementNotification-API/schemas/ProblemDetails.schema.json @@ -1,34 +1,34 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", - "properties": { - "type": { - "type": "string", - "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", - "format": "URI" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" - }, - "status": { - "type": "integer", - "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" - }, - "detail": { - "type": "string", - "description": "A human-readable explanation specific to this occurrence of the problem.\n" - }, - "instance": { - "type": "string", - "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", - "format": "URI" - } - }, - "required": [ - "status", - "detail" - ] +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", + "properties": { + "type": { + "type": "string", + "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", + "format": "URI" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" + }, + "status": { + "type": "integer", + "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem.\n" + }, + "instance": { + "type": "string", + "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", + "format": "URI" + } + }, + "required": [ + "status", + "detail" + ] } \ No newline at end of file diff --git a/SOL003/VNFIndicator-API/IndividualSubscription.robot b/SOL003/VNFIndicator-API/IndividualSubscription.robot index 9001d0bb77c29cbf5130b586cabb7c328acb0c3c..2254b161f73a46aa60388638b9e01020682ed902 100644 --- a/SOL003/VNFIndicator-API/IndividualSubscription.robot +++ b/SOL003/VNFIndicator-API/IndividualSubscription.robot @@ -1,99 +1,99 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/individualSubscription.txt -Library OperatingSystem -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Test Cases *** -GET Individual Subscription - Log Trying to get a given subscription identified by subscriptionId - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with VnfIndicatorSubscription schema - Validate Json VnfIndicatorSubscription.schema.json ${json} - Log Validated VnfIndicatorSubscription schema - -GET Subscription - Negative (Not Found) - Log Trying to perform a request on a subscriptionID which doesn't exist - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Subscription - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -DELETE Subscription - Log Trying to perform a DELETE on a subscriptionId - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 204 - Log Received 204 No Content as expected - -DELETE Subscription - Negative (Not Found) - Log Trying to perform a DELETE on a subscriptionId which doesn't exist - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Integer response status 404 - Log The subscriptionId is not present in database - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${problemDetails}= Output - ${json}= evaluate json.loads('''${problemDetails}''') json - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT Subscription - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Subscription - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -POST Subscription - (Method not implemented) - Log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/individualSubscription.txt +Library OperatingSystem +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + +*** Test Cases *** +GET Individual Subscription + Log Trying to get a given subscription identified by subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with VnfIndicatorSubscription schema + Validate Json VnfIndicatorSubscription.schema.json ${json} + Log Validated VnfIndicatorSubscription schema + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a subscriptionID which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Log Trying to validate ProblemDetails + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Subscription - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Subscription + Log Trying to perform a DELETE on a subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 204 + Log Received 204 No Content as expected + +DELETE Subscription - Negative (Not Found) + Log Trying to perform a DELETE on a subscriptionId which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log The subscriptionId is not present in database + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${problemDetails}= Output + ${json}= evaluate json.loads('''${problemDetails}''') json + Log Trying to validate ProblemDetails + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT Subscription - (Method not implemented) + 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +POST Subscription - (Method not implemented) + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API/IndividualVNFindicator.robot b/SOL003/VNFIndicator-API/IndividualVNFindicator.robot index 8facf654cf6d9fd0a0dc67b6bdd7b1d20ee4679d..fb7b1a193216a813ab0ac514e84583ef7ffc96cc 100644 --- a/SOL003/VNFIndicator-API/IndividualVNFindicator.robot +++ b/SOL003/VNFIndicator-API/IndividualVNFindicator.robot @@ -1,98 +1,98 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/individualVnfIndicator.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Test Cases *** -GET Individual VNF Indicator - Log The GET method reads a VNF indicator. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate response - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfIndicator.schema.json ${json} - Log Validation OK - -GET Individual VNF Indicator - Negative (Not Found) - Log Trying to perform a negative get, using an erroneous package ID - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization" : "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId} - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual VNF Indicator - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Set Headers {"Accept" : "${ACCEPT_JSON}"} - Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual VNF Indicator - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, without authentication token. - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 401 - Log Received 401 Unauthozired as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST Individual VNF Indicator (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT Individual VNF Indicator (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Individual VNF Indicator (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Individual VNF Indicator (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/individualVnfIndicator.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + +*** Test Cases *** +GET Individual VNF Indicator + Log The GET method reads a VNF indicator. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfIndicator.schema.json ${json} + Log Validation OK + +GET Individual VNF Indicator - Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId} + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Individual VNF Indicator - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept" : "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Individual VNF Indicator - Negative (Unauthorized: No Token) + Log Trying to perform a negative get, without authentication token. + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 401 + Log Received 401 Unauthozired as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Individual VNF Indicator (Method not implemented) + 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}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT Individual VNF Indicator (Method not implemented) + 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}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Individual VNF Indicator (Method not implemented) + Log Trying to perform a PATCH. 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}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Individual VNF Indicator (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API/Subscriptions.robot b/SOL003/VNFIndicator-API/Subscriptions.robot index 8f2b3faccdcb1f740c0aa287f23e7c6098bc8c00..ebfea11498e36f87d0def4e344931c5394227f50 100644 --- a/SOL003/VNFIndicator-API/Subscriptions.robot +++ b/SOL003/VNFIndicator-API/Subscriptions.robot @@ -1,154 +1,155 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/subscriptions.txt -Library OperatingSystem -Library JSONLibrary -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Test Cases *** -GET Subscription - Log Trying to get the list of subscriptions - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscriptions.schema.json ${json} - Log Validated VnfIndicatorSubscriptions schema - -GET Subscription - Filter - Log Trying to get the list of subscriptions using filters - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Received a 200 OK as expected - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscriptions.schema.json ${json} - Log Validated VnfIndicatorSubscriptions schema - -GET Subscription - Negative Filter - Log Trying to get the list of subscriptions using filters with wrong attribute name - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER} - Integer response status 400 - Log Received a 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Subscription - Negative (Not Found) - Log Trying to perform a request on a Uri which doesn't exist - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscription - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Subscription - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST Subscription - Log Trying to create a new subscription - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File json/subscriptions.json - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Received 201 Created as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response has header Location - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscription.schema.json ${json} - Log Validation of VnfIndicatorSubscription OK - -POST Subscription - DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File json/subscriptions.json - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Received 201 Created as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response has header Location - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscription.schema.json ${json} - Log Validation of VnfIndicatorSubscription OK - -POST Subscription - NO DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM is permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File json/subscriptions.json - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 303 - Log Received 303 See Other as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response has header Location - -PUT Subscription - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Subscription - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Subscription - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/subscriptions.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + +*** Test Cases *** +GET Subscription + Log Trying to get the list of subscriptions + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VnfIndicatorSubscriptions.schema.json ${json} + Log Validated VnfIndicatorSubscription schema + +GET Subscription - Filter + Log Trying to get the list of subscriptions using filters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Received a 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VnfIndicatorSubscriptions.schema.json ${json} + Log Validated VnfIndicatorSubscriptions schema + +GET Subscription - Negative Filter + Log Trying to get the list of subscriptions using filters with wrong attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER} + Integer response status 400 + Log Received a 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a Uri which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscription + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Subscription - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Subscription + Log Trying to create a new subscription + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VnfIndicatorSubscription.schema.json ${json} + Log Validation of VnfIndicatorSubscription OK + +POST Subscription - DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VnfIndicatorSubscription.schema.json ${json} + Log Validation of VnfIndicatorSubscription OK + +POST Subscription - NO DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM is permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Received 303 See Other as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + +PUT Subscription - (Method not implemented) + 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": "${VNFM_AUTHENTICATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Subscription - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFIndicator-API/VNFIndicators.robot b/SOL003/VNFIndicator-API/VNFIndicators.robot index dbf0990c3187384baf77395e6d93aebf19e54040..863d818e87ff482d5eaaf8eaadbbdb5f9fe93f56 100644 --- a/SOL003/VNFIndicator-API/VNFIndicators.robot +++ b/SOL003/VNFIndicator-API/VNFIndicators.robot @@ -1,129 +1,130 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library JSONLibrary -Resource environment/vnfIndicators.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Test Cases *** -GET all Indicators - Log The GET method queries multiple VNF indicators - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate response - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfIndicators.schema.json ${json} - Log Validation OK - -GET all Indicators - Filter - Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate response - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfIndicators.schema.json ${json} - Log Validation OK - -GET all Indicators - Negative (wronge filter name) - Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters. Negative case, with erroneous attribute name - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS} - Integer response status 400 - Log Received 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Indicators - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM \ is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Indicators - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Indicators (Negative: Not found) - Log Trying to perform a GET on a erroneous URI - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicator - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST all Indicators (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT all Indicators (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH all Indicators (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE all Indicators (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library JSONLibrary +Resource environment/vnfIndicators.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + +*** Test Cases *** +GET all Indicators + Log The GET method queries multiple VNF indicators + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfIndicators.schema.json ${json} + Log Validation OK + +GET all Indicators - Filter + Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfIndicators.schema.json ${json} + Log Validation OK + +GET all Indicators - Negative (wronge filter name) + Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters. Negative case, with erroneous attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS} + Integer response status 400 + Log Received 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Indicators - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as VNFM \ is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Indicators - Negative (Unauthorized: No Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Indicators (Negative: Not found) + 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}/indicator + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST all Indicators (Method not implemented) + 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}/indicators + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT all Indicators (Method not implemented) + 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}/indicators + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH all Indicators (Method not implemented) + Log Trying to perform a PATCH. 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}/indicators + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE all Indicators (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot b/SOL003/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot index 8709e853a99a5f638a9d6bc41919534a50c369de..2411f5c4e345423fa51f34ab6a86ca9a942351ab 100644 --- a/SOL003/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot +++ b/SOL003/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot @@ -1,95 +1,96 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/vnfIndicatorinVnfInstance.txt -Library JSONLibrary -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Test Cases *** -GET Indicators on VNF Instance - Log This resource represents VNF indicators related to a VNF instance. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfIndicators.schema.json ${json} - Log Validation OK - -GET Indicators on VNF Instance - Filter - Log This resource represents VNF indicators related to a VNF instance. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}?${POS_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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfIndicators.schema.json ${json} - Log Validation OK - -GET Indicators on VNF Instance - Negative Filter - Log This resource represents VNF indicators related to a VNF instance. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}?${NEG_FIELDS} - Integer response status 400 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Indicators on VNF Instance - Negative (Not Found) - Log Trying to perform a negative get, using wrong authorization bearer - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${erroneousVnfInstanceId} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST Indicators on VNF Instance - (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT Indicators on VNF Instance - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Indicators on VNF Instance - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Indicators on VNF Instance - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/vnfIndicatorinVnfInstance.txt +Library JSONLibrary +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + +*** Test Cases *** +GET Indicators on VNF Instance + Log This resource represents VNF indicators related to a VNF instance. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfIndicators.schema.json ${json} + Log Validation OK + +GET Indicators on VNF Instance - Filter + Log This resource represents VNF indicators related to a VNF instance. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}?${POS_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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfIndicators.schema.json ${json} + Log Validation OK + +GET Indicators on VNF Instance - Negative Filter + Log This resource represents VNF indicators related to a VNF instance. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}?${NEG_FIELDS} + Integer response status 400 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Indicators on VNF Instance - Negative (Not Found) + Log Trying to perform a negative get, using wrong authorization bearer + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${erroneousVnfInstanceId} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Indicators on VNF Instance - (Method not implemented) + 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}/indicators/${vnfInstanceId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT Indicators on VNF Instance - (Method not implemented) + 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}/indicators/${vnfInstanceId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Indicators on VNF Instance - (Method not implemented) + Log Trying to perform a PATCH. 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}/indicators/${vnfInstanceId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Indicators on VNF Instance - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFIndicator-API/environment/individualSubscription.txt b/SOL003/VNFIndicator-API/environment/individualSubscription.txt index 1bcfe4cc8b235c5a198deb3c1868c43249291052..e4a953e55b8c76f0e6b2cb44b02e4b67a0bd00be 100644 --- a/SOL003/VNFIndicator-API/environment/individualSubscription.txt +++ b/SOL003/VNFIndicator-API/environment/individualSubscription.txt @@ -1,3 +1,4 @@ -*** Variables *** -${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586 -${erroneousSubscriptionId} 442e3ee5-0499-4849-9b31-eb91ce1638f1 # Not existing ID on the subscriptions +*** Variables *** +${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586 +${erroneousSubscriptionId} erroneousSubscriptionId # Not existing ID on the subscriptions + diff --git a/SOL003/VNFIndicator-API/environment/subscriptions.txt b/SOL003/VNFIndicator-API/environment/subscriptions.txt index 2eba29ee0deb3f2f685671aba5fdc52cedf6c95e..1e97b10b3f15848d3f08ca56a02a11564d6a44d1 100644 --- a/SOL003/VNFIndicator-API/environment/subscriptions.txt +++ b/SOL003/VNFIndicator-API/environment/subscriptions.txt @@ -1,7 +1,4 @@ -*** Variables *** -${vnfInstanceId} 80b0deba-c398-445b-bef0-ac0fe733e3d0 -${indicatorId} 34e70855-a9d3-4fef-aece-76a3cd266ec8 -${erroneousIndicatorId} erroneousIndicatorId -${POS_FILTER} callbackUri=http://127.0.0.1/subscribe -${NEG_FILTER} callback=http://127.0.0.1/subscribe -${VNFM_DUPLICATION} 1 +*** Variables *** +${POS_FILTER} callbackUri=http://127.0.0.1/subscribe +${NEG_FILTER} callback=http://127.0.0.1/subscribe + diff --git a/SOL003/VNFIndicator-API/environment/generic.txt b/SOL003/VNFIndicator-API/environment/variables.txt similarity index 61% rename from SOL003/VNFIndicator-API/environment/generic.txt rename to SOL003/VNFIndicator-API/environment/variables.txt index 9a185e87c0e461818e3626e433342d30e38703a8..ada6f984ae577b44e69629757c054331aa0c9e04 100644 --- a/SOL003/VNFIndicator-API/environment/generic.txt +++ b/SOL003/VNFIndicator-API/environment/variables.txt @@ -1,18 +1,17 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 -${CONTENT_TYPE_JSON} application/json -${ACCEPT_JSON} application/json -${apiRoot} / -${AUTH_USAGE} 1 -${NEG_AUTHORIZATION} Bearer negativetoken -${apiVersion} v1 -${apiName} vnfind -${FIELD_USAGE} 1 -${VNFM_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 -${VNFM_AUTH_USAGE} 1 +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${VNFM_SCHEMA} https + +${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${NEG_AUTHORIZATION} Bearer negativetoken +${ACCEPT_JSON} application/json +${AUTH_USAGE} 1 +${CONTENT_TYPE_JSON} application/json + +${apiRoot} / +${apiVersion} v1 +${apiName} vnfind + +${VNFM_DUPLICATION} 1 + diff --git a/SOL003/VNFIndicator-API/schemas/VnfIndicatorSubscription.schema.json b/SOL003/VNFIndicator-API/schemas/VnfIndicatorSubscription.schema.json index 2713aac83b110cc599aa7042beb74198b748fb9a..7609ac928880813b73de07501fe8534f4b565ab6 100644 --- a/SOL003/VNFIndicator-API/schemas/VnfIndicatorSubscription.schema.json +++ b/SOL003/VNFIndicator-API/schemas/VnfIndicatorSubscription.schema.json @@ -1,142 +1,142 @@ -{ - "description": "This type represents a subscription related to notifications about VNF indicator value changes.\n", - "type": "object", - "required": [ - "id", - "callbackUri", - "_links" - ], - "properties": { - "id": { - "description": "An identifier with the intention of being globally unique.\n", - "type": "string" - }, - "filter": { - "description": "This type represents a subscription filter related to notifications about VNF indicator value changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n", - "type": "object", - "properties": { - "vnfInstanceSubscriptionFilter": { - "description": "This type represents subscription filter criteria to match VNF instances.\n", - "type": "object", - "properties": { - "vnfdIds": { - "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", - "type": "array", - "items": { - "description": "An identifier with the intention of being globally unique.\n", - "type": "string" - } - }, - "vnfProductsFromProviders": { - "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", - "type": "array", - "items": { - "type": "object", - "required": [ - "vnfProvider" - ], - "properties": { - "vnfProvider": { - "description": "Name of the VNF provider to match.\n", - "type": "string" - }, - "vnfProducts": { - "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n", - "type": "array", - "items": { - "type": "object", - "required": [ - "vnfProductName" - ], - "properties": { - "vnfProductName": { - "description": "Name of the VNF product to match.\n", - "type": "string" - }, - "versions": { - "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n", - "type": "array", - "items": { - "type": "object", - "required": [ - "vnfSoftwareVersion" - ], - "properties": { - "vnfSoftwareVersion": { - "description": "A version.\n", - "type": "string" - }, - "vnfdVersions": { - "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n", - "type": "array", - "items": { - "description": "A version.\n", - "type": "string" - } - } - } - } - } - } - } - } - } - } - }, - "vnfInstanceIds": { - "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", - "type": "array", - "items": { - "description": "An identifier with the intention of being globally unique.\n", - "type": "string" - } - }, - "vnfInstanceNames": { - "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "indicatorIds": { - "description": "Match particular VNF indicator identifiers.\n", - "type": "array", - "items": { - "description": "An identifier that is unique within a VNF descriptor.\n", - "type": "string" - } - } - } - }, - "callbackUri": { - "description": "The URI of the endpoint to send the notification to.\n", - "type": "string", - "format": "url" - }, - "_links": { - "description": "Links for this resource.\n", - "type": "object", - "required": [ - "self" - ], - "properties": { - "self": { - "description": "This type represents a link to a resource.\n", - "type": "object", - "required": [ - "href" - ], - "properties": { - "href": { - "description": "URI of the referenced resource.\n", - "type": "string", - "format": "url" - } - } - } - } - } - } -} \ No newline at end of file +{ + "description": "This type represents a subscription related to notifications about VNF indicator value changes.\n", + "type": "object", + "required": [ + "id", + "callbackUri", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "filter": { + "description": "This type represents a subscription filter related to notifications about VNF indicator value changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n", + "type": "object", + "properties": { + "vnfInstanceSubscriptionFilter": { + "description": "This type represents subscription filter criteria to match VNF instances.\n", + "type": "object", + "properties": { + "vnfdIds": { + "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "vnfProductsFromProviders": { + "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "type": "object", + "required": [ + "vnfProvider" + ], + "properties": { + "vnfProvider": { + "description": "Name of the VNF provider to match.\n", + "type": "string" + }, + "vnfProducts": { + "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n", + "type": "array", + "items": { + "type": "object", + "required": [ + "vnfProductName" + ], + "properties": { + "vnfProductName": { + "description": "Name of the VNF product to match.\n", + "type": "string" + }, + "versions": { + "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n", + "type": "array", + "items": { + "type": "object", + "required": [ + "vnfSoftwareVersion" + ], + "properties": { + "vnfSoftwareVersion": { + "description": "A version.\n", + "type": "string" + }, + "vnfdVersions": { + "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n", + "type": "array", + "items": { + "description": "A version.\n", + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "vnfInstanceIds": { + "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "vnfInstanceNames": { + "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "indicatorIds": { + "description": "Match particular VNF indicator identifiers.\n", + "type": "array", + "items": { + "description": "An identifier that is unique within a VNF descriptor.\n", + "type": "string" + } + } + } + }, + "callbackUri": { + "description": "The URI of the endpoint to send the notification to.\n", + "type": "string", + "format": "url" + }, + "_links": { + "description": "Links for this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } +} diff --git a/SOL003/VNFIndicatorNotification-API/VnfIndicatorNotification.robot b/SOL003/VNFIndicatorNotification-API/VnfIndicatorNotification.robot index b0189c7ffffb0352badd0d3f2fe2e587f7c942c4..229a939b3de912f56b5b6f8900269c4d8f0f1b72 100644 --- a/SOL003/VNFIndicatorNotification-API/VnfIndicatorNotification.robot +++ b/SOL003/VNFIndicatorNotification-API/VnfIndicatorNotification.robot @@ -12,8 +12,8 @@ Library String *** Test Cases *** Check Notification Endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Verify Mock Expectation ${req} @@ -23,8 +23,8 @@ Post VNF Indicator Notification ${json}= Get File schemas/VnfIndicatorValueChangeNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle VNF Indicator Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -36,8 +36,8 @@ Post VNF Indicator Notification Negative 404 ${json}= Get File schemas/ProblemDetails.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle VNF Indicator Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -49,8 +49,8 @@ Post VNF Indicator Notification Negative 404 Put VNF Indicator Notification Log PUT Method not implemented - &{req}= Create Mock Request Matcher Schema PUT ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -61,8 +61,8 @@ Put VNF Indicator Notification Patch VNF Indicator Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema PATCH ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -73,8 +73,8 @@ Patch VNF Indicator Notification Delete VNF Indicator Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema DELETE ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results diff --git a/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot b/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot index c434253c2819a38acaf419fdc8213524984d610a..6b18974989817f2f0686e60426a7fb3ef2c3901e 100644 --- a/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot @@ -1,130 +1,111 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library DependencyLibrary -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This task resource represents the "Cancel operation" operation. The client can use this resource to cancel an ongoing VNF lifecycle operation. -Suite Setup Check resource existance - -*** Test Cases *** -Post Cancel operation task - [Documentation] The POST method initiates cancelling an ongoing VNF lifecycle operation while it is being executed or rolled back, i.e. - ... the related "VNF LCM operation occurrence" is either in "PROCESSING" or "ROLLING_BACK" state. - Log Cancel a VNF lifecycle operation if that operation has experienced a temporary failure - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Cancel a VNF lifecycle operation - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode} - Log Validate Status code - Integer response status 202 - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Post Fail operation task Conflict (Not-FAILED_TEMP) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends on test failure Check resource FAILED_TEMP - Log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Post Fail operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Post Fail operation task Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also be returned - ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, - ... which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check Fail not supported - log Final fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Fail operation task - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -PUT Fail operation task - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -PATCH Fail operation task - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -DELETE Fail operation task - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Integer response status 200 - -Launch another error handling action - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Integer response status 202 - -Check Fail not supported - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - # how to check if Fail is not supported? - - -Check resource FAILED_TEMP - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This task resource represents the "Cancel operation" operation. The client can use this resource to cancel an ongoing VNF lifecycle operation. +Suite Setup Check resource existance + +*** Test Cases *** +Post Cancel operation task + [Documentation] The POST method initiates cancelling an ongoing VNF lifecycle operation while it is being executed or rolled back, i.e. + ... the related "VNF LCM operation occurrence" is either in "PROCESSING" or "ROLLING_BACK" state. + Log Cancel an ongoing VNF lifecycle operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Cancel a VNF lifecycle operation + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode} + Log Validate Status code + Integer response status 202 + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Post Cancel operation task Conflict + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in STARTING, PROCESSING or ROLLING_BACK state, + ... or another error handling action is starting, such as retry or rollback. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + Depends on test Check resource FAILED_TEMP + Log Cancel an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Post Cancel operation task Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also be returned + ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, + ... which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check Fail not supported + log Final fail an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Cancel operation task - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel + Log Validate Status code + Integer response status 405 + +PUT Cancel operation task - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel + Log Validate Status code + Integer response status 405 + +PATCH Cancel operation task - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel + Log Validate Status code + Integer response status 405 + +DELETE Cancel operation task - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Integer response status 200 + +Launch another error handling action + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Integer response status 202 + +Check Fail not supported + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + # how to check if Fail is not supported? + + +Check resource FAILED_TEMP + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} String response body operationState FAILED_TEMP \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..f7347a33c843828a93311457e3c0f1eb33bff71c --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot @@ -0,0 +1,80 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Cancel a VNF LCM Operation - STARTING + [Documentation] Test ID: 5.x.x.x + ... Test title: Cancel a VNF LCM Operation + ... Test objective: The objective is to test the workflow for Cancelling a VNF LCM Operation + ... Pre-conditions: The VNF lifecycle management operation occurrence is in STARTING state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in ROLLED_BACK state + Send Cancel Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Cancel ROLLED_BACK + Check Postcondition VNF Cancel - STARTING + +Cancel a VNF LCM Operation - PROCESSING - ROLLING_BACK + [Documentation] Test ID: 5.x.x.x + ... Test title: Cancel a VNF LCM Operation + ... Test objective: The objective is to test the workflow for Cancelling a VNF LCM Operation + ... Pre-conditions: The VNF lifecycle management operation occurrence is in PROCESSING or ROLLING_BACK state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state + Send Cancel Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Cancel FAILED_TEMP + Check Postcondition VNF Cancel - PROCESSING - ROLLING_BACK + + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks - STARTING + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState STARTING + +Precondition Checks - PROCESSING - ROLLING_BACK + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState PROCESSING + +Check Postcondition VNF Cancel - STARTING + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState ROLLED_BACK + +Check Postcondition VNF Cancel - PROCESSING - ROLLING_BACK + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Operation Notification For Cancel + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index dbf8f8f28f1ce446ff27155677d9d3461ee417b6..4d7c72434e495935718139c9b91b78e8030a8dae 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -1,89 +1,90 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Change external VNF connectivity - [Documentation] The POST method changes the external connectivity of a VNF instance - Log Trying to change the external connectivity of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeExtVnfConnectivityRequest .json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Change external VNF connectivity Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that another LCM operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeExtVnfConnectivityRequest .json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - - -GET Change external VNF connectivity - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn - Log Validate Status code - Integer response status 405 - -PUT Change external VNF connectivity - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn - Log Validate Status code - Integer response status 405 - -PATCH Change external VNF connectivity - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn - Log Validate Status code - Integer response status 405 - -DELETE Change external VNF connectivity - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Change external VNF connectivity + [Documentation] The POST method changes the external connectivity of a VNF instance + Log Trying to change the external connectivity of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeExtVnfConnectivityRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Change external VNF connectivity Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that another LCM operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to change the deployment flavour of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeExtVnfConnectivityRequest .json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + + +GET Change external VNF connectivity - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn + Log Validate Status code + Integer response status 405 + +PUT Change external VNF connectivity - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn + Log Validate Status code + Integer response status 405 + +PATCH Change external VNF connectivity - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn + Log Validate Status code + Integer response status 405 + +DELETE Change external VNF connectivity - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..17d928a114798e35e22389ebebcffba745092e12 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot @@ -0,0 +1,60 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Operate a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Change the external connectivity of a VNF instance + ... Test objective: The objective is to change the external connectivity of a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Change the external connectivity of a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state and external connectivity of the VNF is changed + Send Change Ext Connectivity Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Change Ext Connectivity STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Change Ext Connectivity PROCESSING + Check Operation Notification For Change Ext Connectivity COMPLETED + Check Postcondition VNF Change Ext Connectivity + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/changeExtVnfConnectivityRequest.json + ${changeVnfExtConnectivityRequest}= evaluate json.loads('''${body}''') json + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Change Ext Connectivity + Check resource instantiated + ${extVLId}= Get Vnf Ext Link Id ${vnfInstanceId} + Should be Equal ${changeVnfExtConnectivityRequest["extVirtualLinks"][0]["id"]} ${extVLId} + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Change Ext Connectivity + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot index 2619eefe1f96da17f7a3bedfb67466bbb28a7828..880d9c42a5d65a67c23870f4b3e112223f1f35ce 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot @@ -1,145 +1,146 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Change deployment flavour of a vnfInstance - [Documentation] Changes the deployment flavour of a VNF instance.. - Log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeVnfFlavourRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource not instantiated - Log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeVnfFlavourRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Change deployment flavour of a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeVnfFlavourRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Change deployment flavour of a vnfInstance Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check change flavour not supported - Log Trying to change the deployment flavour of a VNF instance, not exist - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeVnfFlavourRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Integer response status 404 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - - -GET Change deployment flavour VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour - Log Validate Status code - Integer response status 405 - -PUT Change deployment flavour VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour - Log Validate Status code - Integer response status 405 - -PATCH Change deployment flavour VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour - Log Validate Status code - Integer response status 405 - -DELETE Change deployment flavour VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource not instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState NOT_INSTANTIATED - -Check change flavour not supported - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - # how to check if change floavour is not supported? "flavourId" doesn't exist? - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Change deployment flavour of a vnfInstance + [Documentation] Changes the deployment flavour of a VNF instance.. + Log Trying to change the deployment flavour of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeVnfFlavourRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource not instantiated + Log Trying to change the deployment flavour of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeVnfFlavourRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Change deployment flavour of a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to change the deployment flavour of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeVnfFlavourRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Change deployment flavour of a vnfInstance Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check change flavour not supported + Log Trying to change the deployment flavour of a VNF instance, not exist + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeVnfFlavourRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} + Integer response status 404 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET Change deployment flavour VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour + Log Validate Status code + Integer response status 405 + +PUT Change deployment flavour VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour + Log Validate Status code + Integer response status 405 + +PATCH Change deployment flavour VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour + Log Validate Status code + Integer response status 405 + +DELETE Change deployment flavour VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource not instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState NOT_INSTANTIATED + +Check change flavour not supported + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + # how to check if change floavour is not supported? "flavourId" doesn't exist? + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..d1cb5dffcde698b6bb2d3249082dc53168af055a --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot @@ -0,0 +1,63 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Change VNF External Connectivity + [Documentation] Test ID: 5.4.7.1 + ... Test title: Change VNF Flavour Workflow + ... Test objective: The objective is to test the workflow for a change flavour of an existing VNF instance + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.4.7 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: Multiple flavours are supported for the VNF (as capability in the VNFD). NFVO is able to receive notifications from VNFM + ... Post-Conditions: VNF instance still in INSTANTIATED state and the flavour is changed + Send Change VNF Flavour Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Change Flavour STARTING + Check Operation Notification For Change Flavour PROCESSING + Check Operation Notification For Change Flavour COMPLETED + Check Postcondition VNF Flavor Changed + +#Create a new Grant Sync - CHANGE_FLAVOU Scale REMOVED + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/changeVnfFlavourRequest.json + ${changeVnfFlavourRequest}= evaluate json.loads('''${body}''') json + ${requestedFlavour}= Get Value From Json ${changeVnfFlavourRequest} $..newFlavourId + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + ${scaleInfo}= Get Vnf Scale Info ${vnfInstanceId} + +Check Postcondition VNF Flavor Changed + Check resource instantiated + ${newFlavour}= Get Vnf Flavour Info ${vnfInstanceId} + Should be Equal ${requestedFlavour} ${newFlavour} + +Create a new Grant - Sync - CHANGE_FLAVOUR + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} CHANGE_FLAVOUR + +Check Operation Notification For Change Flavour + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/CreateVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/CreateVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..82ae84e33073abbdb02de4b126ca654ddaded339 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/CreateVNFWorkflow.robot @@ -0,0 +1,47 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Create VNF Instance Resource + [Documentation] Test ID: 5.3.1.1 + ... Test title: Create VNF Instance workflow + ... Test objective: The objective is to test the workflow for the creation of a new VNF instance resource. + ... Pre-conditions: NFVO is subscribed to VNF Identifier Creation notifications (Test ID: 5.4.20.2) + ... Reference: section 5.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF instance resource has been created in "NOT_INSTANTIATED" state. + Send VNF Instance Resource create Request + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check Operation Notification For VNF Instance Creation + Check Postcondition VNF Instance Created NOT_INSTANTIATED + +*** Keywords *** + +Initialize System + Create Sessions + +Check Postcondition VNF Instance Created + [Arguments] ${status} + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + Check VNF Status ${response.body.instantiationState} ${status} + +Check Operation Notification For VNF Instance Creation + Check VNF Instance Operation Notification VnfIdentifierCreationNotification ${vnfInstanceId} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/DeleteVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/DeleteVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..01a0e6474c30007f7a8e382b7932e7ebd0d6db40 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/DeleteVNFWorkflow.robot @@ -0,0 +1,43 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Delete VNF Instance Resource + [Documentation] Test ID: 5.3.2.1 + ... Test title: Delete VNF Instance workflow + ... Test objective: The objective is to test the workflow for the deleteion of an existing VNF instance resource + ... Pre-conditions: The VNF Instance resource is in NOT_INSTANTIATED state. NFVO is subscribed to VNF Identifier Creation notifications (Test ID: 5.4.20.2) + ... Reference: section 5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF instance resource is deleted on the VNFM. + Send VNF Instance Resource delete Request + Check HTTP Response Status Code Is 204 + Check Operation Notification For VNF Instance Deletion + Check Postcondition VNF Instance Deleted + +*** Keywords *** + +Initialize System + Create Sessions + +Check Postcondition VNF Instance Deleted + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 404 + +Check Operation Notification For VNF Instance Deletion + Check VNF Instance Operation Notification VnfIdentifierDeletionNotification ${vnfInstanceId} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot index 7ea57b36676660ae893db5c197b9d9cad519a632..2091e372803b8d10abfd0720b30aa5547fa2d981 100644 --- a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot @@ -1,132 +1,131 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library DependencyLibrary -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This task resource represents the "Fail operation" operation. -... The client can use this resource to mark a VNF lifecycle management operation occurrence as "finally failed", -... i.e. change the state of the related VNF LCM operation occurrence resource to "FAILED", if it is not assumed that a subsequent retry or rollback will succeed. -... Once the operation is marked as "finally failed", it cannot be retried or rolled back anymore. -Suite Setup Check resource existance - -*** Test Cases *** -Post Fail operation task - [Documentation] The POST method marks a VNF lifecycle management operation occurrence as "finally failed" if that operation occurrence is in "FAILED_TEMP" state. - Log Final fail a VNF lifecycle operation if that operation has experienced a temporary failure - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Output response - Log Validate Status code - Integer response status 202 - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Post Fail operation task Conflict (Not-FAILED_TEMP) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends on test failure Check resource FAILED_TEMP - Log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Post Fail operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Post Fail operation task Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also be returned - ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, - ... which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check Fail not supported - log Final fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Fail operation task - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -PUT Fail operation task - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -PATCH Fail operation task - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -DELETE Fail operation task - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Integer response status 200 - -Launch another error handling action - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Integer response status 202 - -Check Fail not supported - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - # how to check if Fail is not supported? - -Check resource FAILED_TEMP - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This task resource represents the "Fail operation" operation. +... The client can use this resource to mark a VNF lifecycle management operation occurrence as "finally failed", +... i.e. change the state of the related VNF LCM operation occurrence resource to "FAILED", if it is not assumed that a subsequent retry or rollback will succeed. +... Once the operation is marked as "finally failed", it cannot be retried or rolled back anymore. +Suite Setup Check resource existance + +*** Test Cases *** +Post Fail operation task + [Documentation] The POST method marks a VNF lifecycle management operation occurrence as "finally failed" if that operation occurrence is in "FAILED_TEMP" state. + Log Final fail a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Output response + Log Validate Status code + Integer response status 200 + Log Validation OK + +Post Fail operation task Conflict (Not-FAILED_TEMP) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... or another error handling action is starting, such as retry or rollback. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + Depends on test failure Check resource FAILED_TEMP + Log Final Fail an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Post Fail operation task Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... or another error handling action is starting, such as retry or rollback. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another error handling action + log Final Fail an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Post Fail operation task Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also be returned + ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, + ... which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check Fail not supported + log Final fail an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Fail operation task - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Log Validate Status code + Integer response status 405 + +PUT Fail operation task - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Log Validate Status code + Integer response status 405 + +PATCH Fail operation task - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Log Validate Status code + Integer response status 405 + +DELETE Fail operation task - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Integer response status 200 + +Launch another error handling action + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Integer response status 202 + +Check Fail not supported + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + # how to check if Fail is not supported? + +Check resource FAILED_TEMP + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} String response body operationState FAILED_TEMP \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..d0fc1c2c886e91034af514583853a4309bd46fa7 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot @@ -0,0 +1,52 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Fail VNF LCM Operation + [Documentation] Test ID: 5.x.x.x + ... Test title: Fail a VNF LCM Operation + ... Test objective: The objective is to test the workflow for a Fail VNF LCM Operation + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED state + Send Fail Operation Request + Check Operation Notification For Fail FAILED + Check HTTP Response Status Code Is 200 #the order of notification and the response code is not defined. How to implement this? + Check Postcondition VNF Fail + + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Postcondition VNF Fail + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED + +Check Operation Notification For Fail + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot index dfbd12ccba44952a68e7ee0998aee4494b9a1c40..cd01bf3b6cc2af4fc7650f4e2b246617b14b195d 100644 --- a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot @@ -1,144 +1,145 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Heal a vnfInstance - [Documentation] Heal a VNF instance - Log Trying to heal a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Heal a vnfInstance Conflict (Not-Instantiated) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource not instantiated - Log Trying to heal a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Heal a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to heal a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Heal a vnfInstance Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check heal not supported - Log Trying to heal a VNF instance, not exist - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Integer response status 404 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Heal VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal - Log Validate Status code - Integer response status 405 - -PUT Heal VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal - Log Validate Status code - Integer response status 405 - -PATCH Heal VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal - Log Validate Status code - Integer response status 405 - -DELETE Heal VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource not instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState NOT_INSTANTIATED - -Check heal not supported - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - # how to check if heal is not supported? "flavourId" doesn't exist? - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Heal a vnfInstance + [Documentation] Heal a VNF instance + Log Trying to heal a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/healVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Heal a vnfInstance Conflict (Not-Instantiated) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource not instantiated + Log Trying to heal a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/healVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Heal a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to heal a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/healVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Heal a vnfInstance Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check heal not supported + Log Trying to heal a VNF instance, not exist + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/healVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} + Integer response status 404 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Heal VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal + Log Validate Status code + Integer response status 405 + +PUT Heal VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal + Log Validate Status code + Integer response status 405 + +PATCH Heal VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal + Log Validate Status code + Integer response status 405 + +DELETE Heal VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource not instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState NOT_INSTANTIATED + +Check heal not supported + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + # how to check if heal is not supported? "flavourId" doesn't exist? + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..c23bec76c06a9102fc9e4f1d478fb6bed56947f8 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot @@ -0,0 +1,56 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Heal a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Heal a VNF Instance + ... Test objective: The objective is to heal a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Heal a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state + Send Heal VNF Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Heal STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Heal PROCESSING + Check Operation Notification For Heal COMPLETED + Check Postcondition VNF Heal + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Heal + Check resource Instantiated + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Heal + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot index f3dc02cf783629a9e60333424a02d520a5172c73..4edc625ec0167a8d77038240ef54b96e095f621e 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -1,66 +1,66 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This resource represents an individual subscription. The client can use this resource to read and to terminate a -... subscription to notifications related to VNF lifecycle management -Suite Setup Check resource existance - -*** Test Cases *** -Post Individual Subscription - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 405 - -Get Information about an individual subscription - log Trying to get information about an individual subscription - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 200 - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Subscription.schema.json ${json} - Log Validation OK - -PUT an individual subscription - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 405 - -PATCH an individual subscription - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 405 - -DELETE an individual subscription - log Try to delete an individual subscription - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 204 - -*** Keywords *** - -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This resource represents an individual subscription. The client can use this resource to read and to terminate a +... subscription to notifications related to VNF lifecycle management +Suite Setup Check resource existance + +*** Test Cases *** +Post Individual Subscription - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 405 + +Get Information about an individual subscription + log Trying to get information about an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 200 + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Subscription.schema.json ${json} + Log Validation OK + +PUT an individual subscription - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 405 + +PATCH an individual subscription - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 405 + +DELETE an individual subscription + log Try to delete an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 204 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Integer response status 200 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot index 7c3026c9d23ea5572c76e6f0f7079fdd11f41c85..b5eace21eecdc7adc076de9b99aac43e02c1235f 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -1,160 +1,159 @@ -*** Settings *** -# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library DependencyLibrary -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This resource represents an individual VNF instance. The client can use this resource to modify and delete the -... underlying VNF instance, and to read information about the VNF instance. -Suite Setup Check resource existance - -*** Variables *** -${Etag}= an etag -${Etag_modified}= a modified etag - -*** Test Cases *** -Post Individual VNFInstance - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Log Validate Status code - Integer response status 405 - -Get Information about an individual VNF Instance - log Trying to get information about an individual VNF instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Log Validate Status code - ${Etag}= Output response headers Etag - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfInstance.schema.json ${json} - Log Validation OK - -PUT Individual VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Log Validate Status code - Integer response status 405 - -PATCH Individual VNFInstance - [Documentation] Modify VNF Information - ... This method modifies an individual VNF instance resource. - ... Changes to the VNF configurable properties are applied to the configuration in the VNF instance, and are reflected in the representation of this resource. - ... Other changes are applied to the VNF instance information managed by the VNFM, and are reflected in the representation of this resource - log Trying to modify an individual VNF instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/patchBodyRequest.json - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} - Log Validate Status code - ${Etag_modified}= Output response headers Etag - Integer response status 202 - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -PATCH Individual VNFInstance Precondition failed - [Documentation] Precondition Failed - ... A precondition given in an HTTP request header is not fulfilled. - ... Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity. - ... The response body should contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends On Test PATCH Individual VNFInstance # If the previous test scceeded, it means that Etag has been modified - log Trying to modify an individual VNF instance Precondition failed - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/patchBodyRequest.json - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} - Log Validate Status code - Integer response status 412 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PATCH Individual VNFInstance Conflict - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that another LCM operation is ongoing. The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to modify an individual VNF instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/patchBodyRequest.json - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -DELETE Individual VNFInstance - [Documentation] Delete VNF Identifier This method deletes an individual VNF instance resource. - log Trying to delete an individual VNF instance - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Log Validate Status code - Integer response status 204 - Log Validation OK - -DELETE Individual VNFInstance Conflict - # TODO: Need to set the pre-condition of the test. The VnfInstance shall in INSTANTIATED state - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource instantiated - log Trying to delete an individual VNF instance Conflict - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -*** Keywords *** - -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState INSTANTIATED - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Integer response status 202 - +*** Settings *** +Resource environment/configuration.txt +# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This resource represents an individual VNF instance. The client can use this resource to modify and delete the +... underlying VNF instance, and to read information about the VNF instance. +Suite Setup Check resource existance + +*** Variables *** +${Etag}= an etag +${Etag_modified}= a modified etag + +*** Test Cases *** +Post Individual VNFInstance - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Log Validate Status code + Integer response status 405 + +Get Information about an individual VNF Instance + log Trying to get information about an individual VNF instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Log Validate Status code + ${Etag}= Output response headers Etag + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfInstance.schema.json ${json} + Log Validation OK + +PUT Individual VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Log Validate Status code + Integer response status 405 + +PATCH Individual VNFInstance + [Documentation] Modify VNF Information + ... This method modifies an individual VNF instance resource. + ... Changes to the VNF configurable properties are applied to the configuration in the VNF instance, and are reflected in the representation of this resource. + ... Other changes are applied to the VNF instance information managed by the VNFM, and are reflected in the representation of this resource + log Trying to modify an individual VNF instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/patchBodyRequest.json + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} + Log Validate Status code + ${Etag_modified}= Output response headers Etag + Integer response status 202 + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +PATCH Individual VNFInstance Precondition failed + [Documentation] Precondition Failed + ... A precondition given in an HTTP request header is not fulfilled. + ... Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity. + ... The response body should contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + Depends On Test PATCH Individual VNFInstance # If the previous test scceeded, it means that Etag has been modified + log Trying to modify an individual VNF instance Precondition failed + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${Etag}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/patchBodyRequest.json + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} + Log Validate Status code + Integer response status 412 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PATCH Individual VNFInstance Conflict + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that another LCM operation is ongoing. The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to modify an individual VNF instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/patchBodyRequest.json + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +DELETE Individual VNFInstance + [Documentation] Delete VNF Identifier This method deletes an individual VNF instance resource. + log Trying to delete an individual VNF instance + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Log Validate Status code + Integer response status 204 + Log Validation OK + +DELETE Individual VNFInstance Conflict + # TODO: Need to set the pre-condition of the test. The VnfInstance shall in INSTANTIATED state + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource instantiated + log Trying to delete an individual VNF instance Conflict + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState INSTANTIATED + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} + Integer response status 202 diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot index 41be2f132a12a8f5df867f2a1467ce8a51f855b5..888c4f92d18fdc934a1c29bdf25765f82eacfa78 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot @@ -1,62 +1,62 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This resource represents a VNF lifecycle management operation occurrence. The client can use this resource to read -... status information about an individual VNF lifecycle management operation occurrence. Further, the client can use task -... resources which are children of this resource to request cancellation of an operation in progress, and to request the -... handling of operation errors via retrying the operation, rolling back the operation, or permanently failing the operation - -*** Test Cases *** - -Post Individual VNF LCM OP occurences - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Log Validate Status code - Integer response status 405 - -Get stauts information about multiple VNF instances - [Documentation] Get Operation Status - ... The client can use this method to retrieve status information about a VNF lifecycle management operation occurrence - ... by reading an individual �VNF LCM operation occurrence� resource. - Log Query status information about multiple VNF lifecycle management operation occurrences. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfLcmOpOcc.schema.json ${json} - Log Validation OK - -PUT stauts information about multiple VNF instances - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Log Validate Status code - Integer response status 405 - -PATCH stauts information about multiple VNF instances - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Log Validate Status code - Integer response status 405 - -DELETE stauts information about multiple VNF instances - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Log Validate Status code +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This resource represents a VNF lifecycle management operation occurrence. The client can use this resource to read +... status information about an individual VNF lifecycle management operation occurrence. Further, the client can use task +... resources which are children of this resource to request cancellation of an operation in progress, and to request the +... handling of operation errors via retrying the operation, rolling back the operation, or permanently failing the operation + +*** Test Cases *** +Post Individual VNF LCM OP occurences - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Log Validate Status code + Integer response status 405 + +Get stauts information about multiple VNF instances + [Documentation] Get Operation Status + ... The client can use this method to retrieve status information about a VNF lifecycle management operation occurrence + ... by reading an individual �VNF LCM operation occurrence� resource. + Log Query status information about multiple VNF lifecycle management operation occurrences. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VnfLcmOpOcc.schema.json ${json} + Log Validation OK + +PUT stauts information about multiple VNF instances - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Log Validate Status code + Integer response status 405 + +PATCH stauts information about multiple VNF instances - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Log Validate Status code + Integer response status 405 + +DELETE stauts information about multiple VNF instances - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Log Validate Status code Integer response status 405 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot index 2cb09602838f26f197a0e6f527c477b6283413b8..2fbcc71e93621ca8e2556b71e13e1297fdc46c00 100644 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot @@ -1,88 +1,89 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library DependencyLibrary -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - - -*** Test Cases *** -Instantiate a vnfInstance - [Documentation] Instantiate VNF The POST method instantiates a VNF instance. - Log Trying to Instantiate a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/instantiateVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Instantiate a vnfInstance Conflict - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. - ... The response body shall contain a ProblemDetails structure, in which the detail attribute should convey more information about the error. - [Setup] Check resource instantiated - Log Trying to Instantiate a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/instantiateVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Instantiate VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate - Log Validate Status code - Integer response status 405 - -PUT Instantiate VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate - Log Validate Status code - Integer response status 405 - -PATCH Instantiate VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate - Log Validate Status code - Integer response status 405 - -DELETE Instantiate VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library DependencyLibrary +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + + +*** Test Cases *** +Instantiate a vnfInstance + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/instantiateVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Instantiate a vnfInstance Conflict + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource instantiated + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/instantiateVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Instantiate VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate + Log Validate Status code + Integer response status 405 + +PUT Instantiate VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate + Log Validate Status code + Integer response status 405 + +PATCH Instantiate VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate + Log Validate Status code + Integer response status 405 + +DELETE Instantiate VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} String response body instantiationState INSTANTIATED \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot deleted file mode 100644 index fce05093547bb8a887e0bde864137864948e5fcd..0000000000000000000000000000000000000000 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot +++ /dev/null @@ -1,136 +0,0 @@ -*** Setting *** -Suite Setup Initialize System -Suite Teardown Terminate All Processes kill=true -Resource environment/variables.txt -Library OperatingSystem -Library MockServerLibrary -Library Process -Library BuiltIn -Library Collections -Library String -Library JSONSchemaLibrary schemas/ -Library JSONLibrary -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Variables *** -${headers} -${vnfLcmOpOccId} -${response} -&{notification_request} -&{notification_response} -${vnfInstanceId} - -*** Test Cases *** -VNF Instantiation -[Documentation] Test ID: 5.x.y.x - ... Test title: VNF Instantiation - ... Test objective: The objective is to test the instantiation of a VNF instance - ... Pre-conditions: VNF instance resources is created (Test ID: 5.a.b.c) - ... Reference: section 5.x.y - SOL003 v2.4.1 - ... Config ID: Config_prod_VNFM - ... Applicability: VNFM is in direct mode - ... Post-Conditions: VNF instance in INSTANTIATED state - Send VNF Instantiation Request - Check HTTP Response Status Code Is 202 - Check HTTP Response Header Contains Location - Check Operation Occurrence Id - Check Operation Notification STARTING - Check Operation Notification PROCESSING - Check Operation Notification COMPLETED - Check Postcondition - -*** Keywords *** -Send VNF Instantiation Request - Log Instantiate a VNF Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/instantiateVnfRequest.json - ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} - -Check HTTP Response Status Code Is - [Arguments] ${expected_status} - Should Be Equal ${response.status_code} ${expected_status} - Log Status code validated - -Check HTTP Response Header Contains - [Arguments] ${CONTENT_TYPE} - Should Contain ${response.headers} ${CONTENT_TYPE} - Log Header is present - -Check Operation Occurrence Id - ${vnfLcmOpOccId}= Get Value From Json ${response.headers} $..Location - Should Not Be Empty ${vnfLcmOpOccId} - -Check HTTP Response Body Json Schema Is - [Arguments] ${schema} - ${json}= evaluate json.loads('''${response.body}''') json - Validate Json ${schema} ${json} - ${vnfInstanceId}= ${response.body.id} - Log Json Schema Validation OK - -Check VNF Status - [Arguments] ${current} ${expected} - Should Be Equal As Strings ${current} ${expected} - Log VNF Status in the correct status - -Check VNF Instance - [Arguments] ${vnfId} - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId} - -Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${callback_uri}:${callback_port} - -Configure Notification Handler - [Arguments] ${element} ${endpoint} - ${json}= Get File schemas/${element}.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle ${element} - &{notification_request}= Create Mock Request Matcher Schema POST ${endpoint} body=${BODY} - &{notification_response}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${notification_request} ${notification_response} - -Check Operation Notification - [Arguments] ${status} - Configure Notification Handler VnfLcmOperationOccurrenceNotification ${callback_endpoint} - Wait Until Keyword Succeeds 2 min 10 sec Verify Notification ${status} - Get ${vnfLcmOpOccId} - ${body}= Output response body - Should Be Equal ${body.operationState} ${status} - Clear Requests ${callback_endpoint} - -Verify Notification COMPLETED - [Arguments] ${status} - Verify Mock Expectation ${notification_request} - -Create VNF Resource - Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/createVnfRequest.json - ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body} - -Initialize System - Create Sessions - Configure Notification Handler VnfIdentifierCreationNotification ${callback_endpoint} - Create VNF Resource - Check HTTP Response Status Code Is 201 - Check HTTP Response Header Contains Location - Check HTTP Response Header Contains ${response.headers} Content-Type - Check HTTP Response Body Json Schema Is vnfInstance.schema.json - -Check Postcondition - Log Retrieve VNF Instance - Check VNF Instance ${vnfInstanceId} - Should Not Be Empty ${response} - Check HTTP Status Code Is 200 - Should Be Equal ${response.body.id} ${vnfInstanceId} - Check HTTP Response Header Contains Content-Type - Check HTTP Response Json Schema ${response.body} vnfInstance.schema.json - Check VNF Status ${response.body.instantiationState} INSTANTIATED \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWorkflow.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..1fef05fa5051e7dd5a75a46e6ca8ac6de38cc5ca --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWorkflow.robot @@ -0,0 +1,63 @@ +*** Setting *** +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true +Resource environment/configuration.txt +Resource environment/variables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library OperatingSystem +Library MockServerLibrary +Library Process +Library BuiltIn +Library Collections +Library String +Library JSONSchemaLibrary schemas/ +Library JSONLibrary +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + + +*** Test Cases *** +VNF Instantiation + [Documentation] Test ID: 5.4.4.1 + ... Test title: VNF Instantiation worflow + ... Test objective: The objective is to test the workflow for the instantiation of a VNF instance + ... Pre-conditions: VNF instance resources is already created (Test ID: 5.4.2.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: VNF instance in INSTANTIATED state + Send VNF Instantiation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Instantiation STARTING + Check Operation Notification For Instantiation PROCESSING + Check Operation Notification For Instantiation COMPLETED + Check Postcondition VNF Status INSTANTIATED + +*** Keywords *** +Send VNF Instantiation Request + Log Instantiate a VNF Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/instantiateVnfRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + +Check Operation Notification For Instantiation + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + +Initialize System + Create Sessions + +Check Postcondition VNF Status + [Arguments] ${status} + Log Retrieve VNF Instance + Check VNF Instance ${vnfInstanceId} + Should Not Be Empty ${response} + Check HTTP Response Status Code Is 200 + Should Be Equal ${response.body.id} ${vnfInstanceId} + Check HTTP Response Header Contains Content-Type + Check HTTP Response Body Json Schema Is vnfInstance.schema.json + Check VNF Status ${response.body.instantiationState} ${status} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..5b22d8b35892b8eddaca131e7605e268639f4f69 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot @@ -0,0 +1,58 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Modify info of a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Update information about a VNF instance + ... Test objective: The objective is to update information about a VNF instance. + ... Pre-conditions: VNF instance is created (Test ID: 5.a.b.c) + ... Reference: section 5.3.6 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Update information of a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance info is updated + Send Info Modification Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Modify Info start #need more info about the notification content + Check Operation Notification For Modify Info result #need more info about the notification content, how the result is presented + Check Postcondition VNF Modify Info + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/patchBodyRequest.json + ${patchBodyRequest}= evaluate json.loads('''${body}''') json + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Modify Info + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + #do we need to compare the modified info in the updated VNF instance with the values in the request? + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Modify Info + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot b/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot index ce2a65b67b23715b7a99fbc3cf863155d06d2a63..0d2b029edd743a20e6ec1f701ff40d5a733322bf 100644 --- a/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot +++ b/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot @@ -1,90 +1,90 @@ -*** Settings *** -Suite Setup Create Sessions -Suite Teardown Terminate All Processes kill=true -Resource environment/variables.txt -Library MockServerLibrary -Library Process -Library OperatingSystem -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port} - -*** Variables *** -${sleep_interval} 20s - -*** Test Cases *** -Deliver a notification - Operation Occurence - log The POST method delivers a notification from the server to the client. - ${json}= Get File schemas/vnfLcmOperationOccurrenceNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Deliver a notification - Id Creation - log The POST method delivers a notification from the server to the client. - ${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Deliver a notification - Id deletion - log The POST method delivers a notification from the server to the client. - ${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Test a notification end point - log The GET method allows the server to test the notification endpoint - &{req}= Create Mock Request Matcher Schema GET ${notification_ep} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${notification_ep} - -PUT notification - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Put ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Patch ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -DELETE subscriptions - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Delete ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -*** Keywords *** -Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${notification_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port} #The API producer is set to NFVO according to SOL003-5.3.9 \ No newline at end of file +*** Settings *** +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Resource environment/configuration.txt +Resource environment/variables.txt +Library MockServerLibrary +Library Process +Library OperatingSystem + +*** Variables *** +${sleep_interval} 20s + +*** Test Cases *** +Deliver a notification - Operation Occurence + log The POST method delivers a notification from the server to the client. + ${json}= Get File schemas/vnfLcmOperationOccurrenceNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Deliver a notification - Id Creation + log The POST method delivers a notification from the server to the client. + ${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Deliver a notification - Id deletion + log The POST method delivers a notification from the server to the client. + ${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Test a notification end point + log The GET method allows the server to test the notification endpoint + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Verify Mock Expectation ${req} + Clear Requests ${callback_endpoint} + +PUT notification - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Put ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +PATCH subscriptions - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Patch ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +DELETE subscriptions - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Delete ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-5.3.9 diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot index 92d3460580179a82cab7dbd7fd2916e6d972ac4d..5d78a40fbf4bbd7c90c989726a4ccae20f481d3c 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot @@ -1,145 +1,146 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Operate a vnfInstance - [Documentation] Change the operational state of a VNF instance - Log Trying to change the operational state of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Operate a vnfInstance Conflict (Not-Instantiated) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource not instantiated - Log Trying to change the operational state of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Operate a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the operational state of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Operate a vnfInstance Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check operate not supported - Log Trying to change the operational state of a VNF instance, not exist - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Integer response status 404 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Operate VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate - Log Validate Status code - Integer response status 405 - -PUT Operate VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate - Log Validate Status code - Output response - Integer response status 405 - -PATCH Operate VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate - Log Validate Status code - Integer response status 405 - -DELETE Operate VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource not instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState NOT_INSTANTIATED - -Check operate not supported - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - # how to check if operate is not supported? "flavourId" doesn't exist? - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Operate a vnfInstance + [Documentation] Change the operational state of a VNF instance + Log Trying to change the operational state of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/operateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Operate a vnfInstance Conflict (Not-Instantiated) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource not instantiated + Log Trying to change the operational state of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/operateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Operate a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to change the operational state of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/operateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Operate a vnfInstance Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check operate not supported + Log Trying to change the operational state of a VNF instance, not exist + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/operateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} + Integer response status 404 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Operate VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate + Log Validate Status code + Integer response status 405 + +PUT Operate VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate + Log Validate Status code + Output response + Integer response status 405 + +PATCH Operate VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate + Log Validate Status code + Integer response status 405 + +DELETE Operate VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource not instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState NOT_INSTANTIATED + +Check operate not supported + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + # how to check if operate is not supported? "flavourId" doesn't exist? + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..17f3fe904595d63d2508f3aae9a0a4e8c32a293d --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot @@ -0,0 +1,61 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Operate a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Operate a VNF Instance + ... Test objective: The objective is to change the operational state of a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: change the operational state of a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state and the operational state is changed + Send Change VNF Operational State Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Operate STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Operate PROCESSING + Check Operation Notification For Operate COMPLETED + Check Postcondition VNF OPERATE + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/operateVnFRequest.json + ${changeVnfOperateRequest}= evaluate json.loads('''${body}''') json + ${requestedState}= Get Value From Json ${changeVnfOperateRequest} $..changeStateTo + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF OPERATE + Check resource instantiated + ${newState}= Get Vnf Operational State Info ${vnfInstanceId} + Should be Equal ${requestedState} ${newState} + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Operate + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot index f83178e588d692d8364ae19705402ec28857e86e..190e7d2f56d4ad7e585751ed11bc671324df02bf 100644 --- a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot @@ -1,132 +1,133 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library DependencyLibrary -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This task resource represents the "Retry operation" operation. The client can use this resource to initiate retrying a VNF lifecycle operation. -Suite Setup Check resource existance - -*** Test Cases *** -Post Retry operation task - [Documentation] The POST method initiates retrying a VNF lifecycle operation if that operation has experienced a temporary failure, - ... i.e. the related "VNF LCM operation occurrence" resource is in "FAILED_TEMP" state. - Depends on test Check resource FAILED_TEMP - Log Retry a VNF lifecycle operation if that operation has experienced a temporary failure - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 202 - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Post Retry operation task Conflict (Not-FAILED_TEMP) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as rollback or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends on test failure Check resource FAILED_TEMP - Log Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Output response - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Post Retry operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as rollback or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Post Retry operation task Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also be returned - ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, - ... which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check retry not supported - log Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Retry operation task - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/retry - Log Validate Status code - Integer response status 405 - -PUT Retry operation task - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/retry - Log Validate Status code - Integer response status 405 - -PATCH Retry operation task - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/retry - Log Validate Status code - Integer response status 405 - -DELETE Retry operation task - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/retry - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Integer response status 200 - -Launch another error handling action - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Integer response status 202 - -Check retry not supported - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - # how to check if retry is not supported? - -Check resource FAILED_TEMP - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This task resource represents the "Retry operation" operation. The client can use this resource to initiate retrying a VNF lifecycle operation. +Suite Setup Check resource existance + +*** Test Cases *** +Post Retry operation task + [Documentation] The POST method initiates retrying a VNF lifecycle operation if that operation has experienced a temporary failure, + ... i.e. the related "VNF LCM operation occurrence" resource is in "FAILED_TEMP" state. + Depends on test Check resource FAILED_TEMP + Log Retry a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 202 + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Post Retry operation task Conflict (Not-FAILED_TEMP) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... or another error handling action is starting, such as rollback or fail. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + Depends on test failure Check resource FAILED_TEMP + Log Retry an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Output response + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Post Retry operation task Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + Depends on test Check resource FAILED_TEMP + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... or another error handling action is starting, such as rollback or fail. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another error handling action + log Retry an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Post Retry operation task Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also be returned + ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, + ... which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check retry not supported + log Retry an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Retry operation task - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 405 + +PUT Retry operation task - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 405 + +PATCH Retry operation task - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 405 + +DELETE Retry operation task - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Integer response status 200 + +Launch another error handling action + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Integer response status 202 + +Check retry not supported + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + # how to check if retry is not supported? + +Check resource FAILED_TEMP + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} String response body operationState FAILED_TEMP \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..d2a68de91f601d7863b287c5a85348d1b65fc095 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot @@ -0,0 +1,76 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Retry VNF LCM Operation - Successful + [Documentation] Test ID: 5.x.x.x + ... Test title: Retry VNF LCM Operation - Successful + ... Test objective: The objective is to test the workflow for a Retry VNF LCM Operation and the operation is successful + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in COMPLETED state + Send Retry Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Retry PROCESSING + Check Operation Notification For Retry COMPLETED + Check Postcondition VNF Retry Successful + +Retry VNF LCM Operation - Unsuccessful + [Documentation] Test ID: 5.x.x.x + ... Test title: Retry VNF LCM Operation - Unsuccessful + ... Test objective: The objective is to test the workflow for a Retry VNF LCM Operation and the operation is not successful + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state + Send Retry Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Retry PROCESSING + Check Operation Notification For Retry FAILED_TEMP + Check Postcondition VNF Retry Unsuccessful + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Postcondition VNF Retry Successful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState COMPLETED + +Check Postcondition VNF Retry Unsuccessful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Operation Notification For Retry + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..1272406881efeed9a9d9123deac9a8f315de6011 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot @@ -0,0 +1,76 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Roll back a VNF LCM Operation - Successful + [Documentation] Test ID: 5.x.x.x + ... Test title: Roll back VNF LCM Operation - Successful + ... Test objective: The objective is to test the workflow for a Rolling Back a VNF LCM Operation and the operation is successful + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.11 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in ROLLED_BACK state + Send Roll back Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Roll Back ROLLING_BACK + Check Operation Notification For Roll Back ROLLED_BACK + Check Postcondition VNF Roll Back Successful + +Retry VNF LCM Operation - Unsuccessful + [Documentation] Test ID: 5.x.x.x + ... Test title: Retry VNF LCM Operation - Unsuccessful + ... Test objective: The objective is to test the workflow for a Retry VNF LCM Operation and the operation is not successful + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state + Send Roll back Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Roll Back ROLLING_BACK + Check Operation Notification For Roll Back FAILED_TEMP + Check Postcondition VNF Roll Back UnSuccessful + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Postcondition VNF Roll Back Successful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState ROLLED_BACK + +Check Postcondition VNF Roll Back Unsuccessful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Operation Notification For Roll Back + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot index c9c820a77bc85a5e459e88f57aca8841b1f8d24e..17867df28974b7a0c140a626cecd0bc587a5c347 100644 --- a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot @@ -1,132 +1,133 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library DependencyLibrary -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This task resource represents the "Rollback operation" operation. The client can use this resource to initiate rolling back a VNF lifecycle operation -Suite Setup Check resource existance - -*** Test Cases *** -Post Rollback operation task - [Documentation] The POST method initiates rolling back a VNF lifecycle operation if that operation has experienced a temporary failure, - ... i.e. the related �VNF LCM operation occurrence� resource is in �FAILED_TEMP� state. - Depends on test Check resource FAILED_TEMP - Log Rollback a VNF lifecycle operation if that operation has experienced a temporary failure - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Integer response status 202 - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Post Rollback operation task Conflict (Not-FAILED_TEMP) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends on test failure Check resource FAILED_TEMP - Log Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Post Rollback operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Post Rollback operation task Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also be returned - ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, - ... which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check Rollback not supported - log Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Output response - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Rollback operation task - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/rollback - Log Validate Status code - Integer response status 405 - -PUT Rollback operation task - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/rollback - Log Validate Status code - Integer response status 405 - -PATCH Rollback operation task - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/rollback - Log Validate Status code - Integer response status 405 - -DELETE Rollback operation task - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/rollback - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - Integer response status 200 - -Launch another error handling action - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Integer response status 202 - -Check Rollback not supported - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - # how to check if Rollback is not supported? - -Check resource FAILED_TEMP - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This task resource represents the "Rollback operation" operation. The client can use this resource to initiate rolling back a VNF lifecycle operation +Suite Setup Check resource existance + +*** Test Cases *** +Post Rollback operation task + [Documentation] The POST method initiates rolling back a VNF lifecycle operation if that operation has experienced a temporary failure, + ... i.e. the related �VNF LCM operation occurrence� resource is in �FAILED_TEMP� state. + Depends on test Check resource FAILED_TEMP + Log Rollback a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Integer response status 202 + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Post Rollback operation task Conflict (Not-FAILED_TEMP) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... or another error handling action is starting, such as retry or fail. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + Depends on test failure Check resource FAILED_TEMP + Log Rollback an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Post Rollback operation task Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + Depends on test Check resource FAILED_TEMP + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... or another error handling action is starting, such as retry or fail. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another error handling action + log Rollback an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Post Rollback operation task Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also be returned + ... if the task is not supported for the VNF LCM operation occurrence represented by the parent resource, + ... which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check Rollback not supported + log Rollback an operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Output response + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Rollback operation task - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Integer response status 405 + +PUT Rollback operation task - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Integer response status 405 + +PATCH Rollback operation task - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Integer response status 405 + +DELETE Rollback operation task - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + Integer response status 200 + +Launch another error handling action + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + Integer response status 202 + +Check Rollback not supported + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + # how to check if Rollback is not supported? + +Check resource FAILED_TEMP + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} String response body operationState FAILED_TEMP \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot index b0999b5744f9572101af4a31d2fbccced9980f78..0c50cbcea49fc4895148e2c91ac43770d545ebcc 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot @@ -1,142 +1,143 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Scale a vnfInstance - [Documentation] Instantiate VNF The POST method instantiates a VNF instance. - Log Trying to Instantiate a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Scale a vnfInstance Conflict (Not-Instantiated) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource not instantiated - Log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Scale a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Scale a vnfInstance Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check scale not supported - Log Trying to scale a vnf Instance, not exist - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 404 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Scale VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale - Log Validate Status code - Integer response status 405 - -PUT Scale VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale - Log Validate Status code - Integer response status 405 - -PATCH Scale VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale - Log Validate Status code - Integer response status 405 - -DELETE Scale VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource not instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState NOT_INSTANTIATED - -Check scale not supported - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Missing response body instantiatedVnfInfo scaleStatus - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Scale a vnfInstance + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Scale a vnfInstance Conflict (Not-Instantiated) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource not instantiated + Log Trying to Scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Scale a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to Scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Scale a vnfInstance Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check scale not supported + Log Trying to scale a vnf Instance, not exist + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} + Integer response status 404 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Scale VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale + Log Validate Status code + Integer response status 405 + +PUT Scale VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale + Log Validate Status code + Integer response status 405 + +PATCH Scale VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale + Log Validate Status code + Integer response status 405 + +DELETE Scale VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource not instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState NOT_INSTANTIATED + +Check scale not supported + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Missing response body instantiatedVnfInfo scaleStatus + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot deleted file mode 100644 index 9a8f2bb401a81ad1581cb57e5757412fa32ccc6e..0000000000000000000000000000000000000000 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot +++ /dev/null @@ -1,79 +0,0 @@ -*** Settings *** -Resource environment/variables.txt -Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library BuiltIn -Library JSONLibrary - -*** Variables *** -${GRANT_POLLING_TOT} 2 -${GRANT_POLLING_INTERVAL} 5s -${SCALE_POLLING_TOT} 10 -${SCALE_POLLING_INTERVAL} 15s -${headers} -${vnfLcmOpOccId} -${status} - -*** Test Cases *** -Scale Out a vnfInstance - [Documentation] Test ID: 5.x.y.x - ... Test title: Scale out VNF operation - ... Test objective: The objective is to test a scale out of an existing VNF instance - ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) - ... Reference: section 5.4.5 - SOL003 v2.4.1 - ... Config ID: Config_prod_VNFM - ... Applicability: Scale operation is supported for the VNF (as capability in the VNFD) - ... NFVO is not subscribed for - ... Post-Conditions: VNF instance still in INSTANTIATED state and VNF was scaled - [Setup] Check resource existance - Send VNFScaleOut request - Check Response Status 202 ${status} - Get VnfLcmOpOccId - Check Operation Status Transition from starting to processing - Check Operation Status Transition from processing to completed - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check Response Status - [Arguments] ${expected_status} ${status} - Should Be Equal ${expected_status} ${status} - -Send VNFscaleOut Request - Log Trying to scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfOutRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - ${headers}= Output response headers - ${headers}= evaluate json.loads('''${headers}''') json - ${status}= Output response status - -Get VnfLcmOpOccId - ${vnfLcmOpOccId}= Get Value From Json ${headers} $..Location - Should Not Be Empty ${vnfLcmOpOccId} - -Check Operation Status Transition from starting to processing - Check Operation Status Transition ${vnfLcmOpOccId} STARTING PROCESSING ${GRANT_POLLING_TOT} ${GRANT_POLLING_INTERVAL} - -Check Operation Status Transition from processing to completed - Check Operation Status Transition ${vnfLcmOpOccId} PROCESSING COMPLETED ${SCALE_POLLING_TOT} ${SCALE_POLLING_INTERVAL} - -Check Operation Status Transition - [Arguments] ${vnfLcmOpOccId} ${initial_status} ${final_status} ${POLLING_TOT} ${POLLING_INTERVAL} - :FOR ${INDEX} IN RANGE 1 ${POLLING_TOT} - \ GET ${apiRoot}/${apiName}/${apiVersion}/${vnfLcmOpOccId} - \ ${status}= Output response status - \ Check Response Status 200 ${status} - \ ${body}= Output response body - \ ${json}= evaluate json.loads('''${body}''') json - \ ${operationState}= Get Value From Json ${json} $..operationState - \ Run Keyword If Should Not Be Equal ${initial_status} ${operationState} Exit For Loop - \ Sleep ${POLLING_INTERVAL} - Should Be Equal ${final_status} ${operationState} diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot deleted file mode 100644 index 1737ad60dfb7ad63d197d3f804831b194c5c355a..0000000000000000000000000000000000000000 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot +++ /dev/null @@ -1,58 +0,0 @@ -*** Settings *** -Resource environment/variables.txt -Resource VnfLcmMntOperationKeywords.robot -Resource SubscriptionKeywords.robot -Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library BuiltIn -Library Collections -Library JSONLibrary - - -*** Test Cases *** -Precondition Checks - Check resource instantiated - ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE - Set Suite Variable ${LccnSubscriptions} - ${scaleInfo}= Get Vnf Scale Info ${vnfInstanceId} - -POST Scale Out a vnfInstance - [Documentation] Test ID: 5.x.y.x - ... Test title: Scale out VNF operation - ... Test objective: The objective is to test a scale out of an existing VNF instance - ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) - ... Reference: section 5.4.5 - SOL003 v2.4.1 - ... Config ID: Config_prod_VNFM - ... Applicability: Scale operation is supported for the VNF (as capability in the VNFD) - ... NFVO is not subscribed for - ... Post-Conditions: VNF instance still in INSTANTIATED state and VNF was scaled - - ${headers} ${status}= Send VNFScaleOut request - Check Response Status 202 ${status} - ${vnfLcmOpOccId}= Get VnfLcmOpOccId ${headers} - -Wait for Notification - STARTING - Deliver a notification - Operation Occurence - ${VnfLcmOccInstance}= Get VnfLcmOccInstance ${vnfLcmOpOccId} - Check operationState STARTING ${VnfLcmOccInstance} - -Granting exchange - Create a new Grant - Synchronous mode - -Wait for Notification - PROCESSING - Deliver a notification - Operation Occurence - ${VnfLcmOccInstance}= Get VnfLcmOccInstance ${vnfLcmOpOccId} - Check operationState PROCESSING ${VnfLcmOccInstance} - -Wait for Notification - COMPLETED - Deliver a notification - Operation Occurence - ${VnfLcmOccInstance}= Get VnfLcmOccInstance ${vnfLcmOpOccId} - Check operationState COMPLETED ${VnfLcmOccInstance} - -Postcondition Checks - Check resource instantiated - ${newScaleInfo}= Get Vnf Scale Info ${vnfInstanceId} - #TODO: How to check if VNF is scaled? - - - \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot index 58c55f7025a6190860ea4c1462c91260131e29e5..fef240ad8e833d8bc149e0836e814aa2a6668fec 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot @@ -1,146 +1,147 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Scale a vnfInstance to level - [Documentation] Instantiate VNF The POST method instantiates a VNF instance. - Log Trying to Instantiate a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Scale a vnfInstance to level Conflict (Not-Instantiated) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource not instantiated - Log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Scale a vnfInstance to level Conflict (parallel LCM operation) - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -Scale a vnfInstance Not Found - # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent - [Documentation] Not Found - ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. - ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. - ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. - [Setup] Check scale to level not supported - Log Trying to scale a vnf Instance, not exist - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Integer response status 404 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - - -GET Scale to level VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level - Log Validate Status code - Output response - Integer response status 405 - -PUT Scale to level VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level - Log Validate Status code - Output response - Integer response status 405 - -PATCH Scale to level VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level - Log Validate Status code - Output response - Integer response status 405 - -DELETE Scale to level VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level - Log Validate Status code - Output response - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource not instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState NOT_INSTANTIATED - - Check scale to level not supported - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Missing response body instantiatedVnfInfo scaleStatus - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Scale a vnfInstance to level + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Scale a vnfInstance to level Conflict (Not-Instantiated) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource not instantiated + Log Trying to Scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Scale a vnfInstance to level Conflict (parallel LCM operation) + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to Scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +Scale a vnfInstance Not Found + # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent + [Documentation] Not Found + ... Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. + ... Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. + ... In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error. + [Setup] Check scale to level not supported + Log Trying to scale a vnf Instance, not exist + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} + Integer response status 404 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET Scale to level VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level + Log Validate Status code + Output response + Integer response status 405 + +PUT Scale to level VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level + Log Validate Status code + Output response + Integer response status 405 + +PATCH Scale to level VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level + Log Validate Status code + Output response + Integer response status 405 + +DELETE Scale to level VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level + Log Validate Status code + Output response + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource not instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState NOT_INSTANTIATED + + Check scale to level not supported + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Missing response body instantiatedVnfInfo scaleStatus + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..876691df6a8397a5e2250af0a33e0c451f2f2eb7 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelWorkflow.robot @@ -0,0 +1,72 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +VNF Instance Scale To Level + [Documentation] Test ID: 5.4.6.1 + ... Test title: VNF Instance Scale To Level worflow + ... Test objective: The objective is to test the workflow for the scale to level of a VNF instance + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.4.6 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Scale operation is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state and VNF is scaled to the new level + Send VNF Scale To Level Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Scale STARTING + Check Operation Notification For Scale PROCESSING + Check Operation Notification For Scale COMPLETED + Check Postcondition VNF Scaled To New Level + +#Create a new Grant - Sync - Scale REMOVED + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/scaleVnfToLevelRequest.json + ${scaleVnfToLevelRequest}= evaluate json.loads('''${body}''') json + ${instantiationLevelId}= Get Value From Json ${scaleVnfToLevelRequest} $..instantiationLevelId #How to use this info to get the instantiation scale level? + ${scaleInfo}= Get Value From Json ${scaleVnfToLevelRequest} $..scaleInfo + +Check Postcondition VNF Scaled To New Level + Check resource instantiated + ${newScaleInfo}= Get Vnf Scale Info ${vnfInstanceId} + Compare ScaleInfos ${scaleInfo} ${newScaleInfo} + +Compare ScaleInfos + [Arguments] ${old_scaleinfo} ${new_scaleinfo} + FOR ${element} IN ${old_scaleinfo} + ${old_level}= Set Variable If ${element.aspectId}==${aspectId} ${element.scaleLevel} + ${old_level_value}= Convert To Integer ${old_level} + END + FOR ${element} IN ${new_scaleinfo} + ${new_level}= Set Variable If ${element.aspectId}==${aspectId} ${element.scaleLevel} + ${new_level_value}= Convert To Integer ${new_level} + END + Should be true ${old_level_value}==${new_level_value} + + +Create a new Grant - Sync - ScaleToLevel + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} SCALE_TO_LEVEL + +Check Operation Notification For Scale + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..538c00b4eec30c2008aa13a8c6fd9edcf7affc89 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFWorkflow.robot @@ -0,0 +1,75 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +VNF Instance Scale Out + [Documentation] Test ID: 5.4.5.1 + ... Test title: VNF Instance Scale Out worflow + ... Test objective: The objective is to test the workflow for the scaling out a VNF instance + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.4.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Scale operation is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state and VNF is scaled out + Send VNF Scale Out Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Scale STARTING + Check Operation Notification For Scale PROCESSING + Check Operation Notification For Scale COMPLETED + Check Postcondition VNF SCALE_OUT + +#Create a new Grant - Sync - Scale REMOVED + +*** Keywords *** + +Initialize System + Create Sessions + ${scaleInfo}= Get Vnf Scale Info ${vnfInstanceId} + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + ${scaleInfo}= Get Vnf Scale Info ${vnfInstanceId} + +Check Postcondition VNF + [Arguments] ${operation} + Check resource instantiated + ${newScaleInfo}= Get Vnf Scale Info ${vnfInstanceId} + Compare ScaleInfos ${operation} ${scaleInfo} ${newScaleInfo} + +Compare ScaleInfos + [Arguments] ${type} ${old_scaleinfo} ${new_scaleinfo} + FOR ${element} IN ${old_scaleinfo} + ${old_level}= Set Variable If ${element.aspectId}==${aspectId} ${element.scaleLevel} + ${old_level_value}= Convert To Integer ${old_level} + END + FOR ${element} IN ${new_scaleinfo} + ${new_level}= Set Variable If ${element.aspectId}==${aspectId} ${element.scaleLevel} + ${new_level_value}= Convert To Integer ${new_level} + END + Run Keyword If ${type}==SCALE_OUT Should Be True ${old_level_value}<${new_level_value} + ... ELSE Should Be True ${old_level_value}<${new_level_value} + +Create a new Grant - Sync - Scale + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} SCALE + +Check Operation Notification For Scale + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot index 42e9fa9b2130d87a23bf0925f2072d062e4ed979..152afc14b82ea91ff90f18258576ad73ecd64843 100644 --- a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot @@ -1,39 +1,69 @@ -*** Settings *** -Resource environment/variables.txt -Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library BuiltIn -Library JSONLibrary -Library MockServerLibrary - - -*** Keywords *** -Check subscriptions about one VNFInstance and operation type - [Arguments] ${vnfInstanceId} ${notificationType} ${operationType}="" ${operationState}="" - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - Run Keyword If ${notificationType}=="VnfIdentifierCreationNotification" or ${notificationType}=="VnfIdentifierDeletionNotification" GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?vnfInstanceIds=${vnfInstanceId}¬ificationTypes=${notificationType} - ... ELSE GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?vnfInstanceIds=${vnfInstanceId}¬ificationTypes=${notificationType}&operationTypes=${operationType}&operationStates=${operationState} - Integer response status 200 - Array response body minItems=1 - ${body} Output response body - [Return] ${body} - - -Deliver a notification - Operation Occurence - log The POST method delivers a notification from the server to the client. - ${json}= Get File schemas/vnfLcmOperationOccurrenceNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification - &{req}= Create Mock Request Matcher POST ${notification_ep} body_type='JSON_SCHEMA' body=${BODY} - &{rsp}= Create Mock Response 204 headers="Content-Type: application/json" body_type='JSON_SCHEMA' - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - - - +*** Settings *** +Resource environment/variables.txt +Resource VnfLcmMntOperationKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Process +Library Collections +Library JSONLibrary +Library MockServerLibrary + +*** Keywords *** +Check subscriptions about one VNFInstance and operation type + [Arguments] ${vnfInstanceId} ${notificationType} ${operationType}="" ${operationState}="" + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${notificationType}=="VnfIdentifierCreationNotification" or ${notificationType}=="VnfIdentifierDeletionNotification" GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?vnfInstanceIds=${vnfInstanceId}¬ificationTypes=${notificationType} + ... ELSE GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?vnfInstanceIds=${vnfInstanceId}¬ificationTypes=${notificationType}&operationTypes=${operationType}&operationStates=${operationState} + Integer response status 200 + Array response body minItems=1 + ${body} Output response body + [Return] ${body} + +Create Sessions + Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} + +Configure Notification Status Handler + [Arguments] ${endpoint} ${status}="" + Run Keyword If ${status}!="" set to dictionary ${json["operationState"]} dp=${status} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle ${element} + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification VNF Instance Handler + [Arguments] ${endpoint} ${instanceId}="" + Run Keyword If ${instanceId}!="" set to dictionary ${json["vnfInstanceId"]} dp=${instanceId} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle ${element} + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${element} ${endpoint} ${endpoint_fwd} + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock HTTP forward to handle ${element} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} + +Check Operation Notification + [Arguments] ${element} ${status}="" + ${json}= Get File schemas/${element}.schema.json + Configure Notification Forward ${element} ${notification_ep} ${notification_ep_fwd} + Configure Notification Status Handler ${notification_ep_fwd} ${status} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${notification_ep} + Clear Requests ${notification_ep_fwd} + +Check VNF Instance Operation Notification + [Arguments] ${element} ${instance_id} + ${json}= Get File schemas/${element}.schema.json + Configure Notification Forward ${element} ${notification_ep} ${notification_ep_fwd} + Configure Notification VNF Instance Handler ${notification_ep_fwd} ${instance_id} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot index f11b871cfb1b5fe0518fe5c107ca588539f3cccf..c13be834d4fa9c730ee06b8ea099feee7c0b90a7 100644 --- a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot +++ b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot @@ -1,124 +1,125 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ - -*** Test Cases *** -Create a new subscription - Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/lccbSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Subscription.schema.json ${json} - Log Validation OK - -Create a new Subscription - DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NVFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/lccbSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Subscription.schema.json ${json} - Log Validation OK - -Create a new Subscription - NO-DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NVFM_DUPLICATION} == 1 VNFM permits duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/lccbSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 303 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -GET Subscriptions - Log Get the list of active subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 200 - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Subscriptions.schema.json ${json} - Log Validation OK - -GET Subscription - Filter - Log Get the list of active subscriptions using a filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} - Integer response status 200 - Log Received a 200 OK as expected - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Subscriptions.schema.json ${json} - Log Validation OK - -GET subscriptions - Bad Request Invalid attribute-based filtering parameters - Log Get the list of active subscriptions using an invalid filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} - Integer response status 400 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT subscriptions - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 - -PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 - -DELETE subscriptions - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Create a new subscription + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/lccbSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Subscription.schema.json ${json} + Log Validation OK + +Create a new Subscription - DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/lccbSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Status code validated + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Subscription.schema.json ${json} + Log Validation OK + +Create a new Subscription - NO-DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM permits duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/lccbSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +GET Subscriptions + Log Get the list of active subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 200 + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Subscriptions.schema.json ${json} + Log Validation OK + +GET Subscription - Filter + Log Get the list of active subscriptions using a filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} + Integer response status 200 + Log Received a 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json Subscriptions.schema.json ${json} + Log Validation OK + +GET subscriptions - Bad Request Invalid attribute-based filtering parameters + Log Get the list of active subscriptions using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} + Integer response status 400 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT subscriptions - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 + +PATCH subscriptions - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 + +DELETE subscriptions - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot index 0d905b0bc758eb435eea8169922859d3edddd110..fe1a357a5ccc66054646a21562d3486223f68526 100644 --- a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot @@ -1,124 +1,125 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Suite Setup Check resource existance - -*** Test Cases *** -Terminate a vnfInstance - [Documentation] Terminates a VNF instance - Log Trying to terminate a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -Terminate a vnfInstance Conflict (Not-Instantiated) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state - [Documentation] Conflict. - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Check resource not instantiated - Log Trying to terminate a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Terminate a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - -GET Terminate VNFInstance - Method not implemented - log Trying to perform a GET. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate - Log Validate Status code - Integer response status 405 - -PUT Terminate VNFInstance - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate - Log Validate Status code - Integer response status 405 - -PATCH Terminate VNFInstance - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate - Log Validate Status code - Integer response status 405 - -DELETE Terminate VNFInstance - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate - Log Validate Status code - Integer response status 405 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - -Check resource not instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - String response body instantiationState NOT_INSTANTIATED - -Check change flavour not supported - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - # how to check if change floavour is not supported? "flavourId" doesn't exist? - -Launch another LCM operation - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Suite Setup Check resource existance + +*** Test Cases *** +Terminate a vnfInstance + [Documentation] Terminates a VNF instance + Log Trying to terminate a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/terminateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Terminate a vnfInstance Conflict (Not-Instantiated) + # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state + [Documentation] Conflict. + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Check resource not instantiated + Log Trying to terminate a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/terminateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Terminate a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, + ... or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + [Setup] Launch another LCM operation + log Trying to change the deployment flavour of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/terminateVnFRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} + Log Validate Status code + Integer response status 409 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + +GET Terminate VNFInstance - Method not implemented + log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate + Log Validate Status code + Integer response status 405 + +PUT Terminate VNFInstance - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate + Log Validate Status code + Integer response status 405 + +PATCH Terminate VNFInstance - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate + Log Validate Status code + Integer response status 405 + +DELETE Terminate VNFInstance - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate + Log Validate Status code + Integer response status 405 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Integer response status 200 + +Check resource not instantiated + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + String response body instantiationState NOT_INSTANTIATED + +Check change flavour not supported + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + # how to check if change floavour is not supported? "flavourId" doesn't exist? + +Launch another LCM operation + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} Integer response status 202 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..a069cd0f89501c9a55f84ffcf8f761553dc11f39 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot @@ -0,0 +1,56 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Terminate a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Terminate a VNF Instance + ... Test objective: The objective is to terminate a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. + ... Post-Conditions: VNF instance in NOT_INSTANTIATED state + Send Terminate VNF Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Terminate STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Terminate PROCESSING + Check Operation Notification For Terminate COMPLETED + Check Postcondition VNF Terminate + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Terminate + Check resource not Instantiated + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Terminate + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot index a393cfc895f5c8867dae70e33127a4e17fa2ed6b..c1b61d05b38024041aaf9c7f6ae2dd80a871cb1f 100644 --- a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot +++ b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot @@ -1,97 +1,129 @@ -*** Settings *** -# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ - -*** Test Cases *** -Create a new vnfInstance - [Setup] #make sure the vnfInstand ${vnfInstanceId} doesn't exist - Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/createVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfInstance.schema.json ${json} - Log Validation OK - -Get information about multiple VNF instances - Log Query VNF The GET method queries information about multiple VNF instances. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfInstances.schema.json ${json} - Log Validation OK - -Get information about multiple VNF instances Bad Request Invalid attribute-based filtering parameters - Log Query VNF The GET method queries information about multiple VNF instances. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?attribute_not_exist=some_value - Log Validate Status code - Integer response status 400 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Get information about multiple VNF instances Bad Request Invalid attribute selector - Log Query VNF The GET method queries information about multiple VNF instances. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?fields=wrong_field - Log Validate Status code - Integer response status 400 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT VNFInstances - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Log Validate Status code - Integer response status 405 - -PATCH VNFInstances - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Log Validate Status code - Integer response status 405 - -DELETE VNFInstances - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Log Validate Status code - Integer response status 405 \ No newline at end of file +*** Settings *** +# Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Create a new vnfInstance + [Documentation] Test ID: 5.4.2.1 + ... Test title: Create a VNF instance + ... Test objective: The objective is to create a new VNF instance resource + ... Pre-conditions: VNF instance with the given vnfInstanceId doesn't exist + ... Reference: section 5.4.2.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: VNF instance created + Log Create VNF instance by POST to /vnf_instances + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/createVnfRequest.json + Post ${apiRoot}${apiName}/${apiVersion}/vnf_instances ${body} + Integer response status 200 + Log Status code validated + ${headers}= Output response headers +# Should Contain ${headers} Location +# ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body +# ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfInstance.schema.json ${result} + Log Validation OK + +Get information about multiple VNF instances + [Documentation] Test ID: 5.4.2.2 + ... Test title: Get information about multiple VNF instances + ... Test objective: The objective is to query information about multiple VNF instances + ... Pre-conditions: + ... Reference: section 5.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about multiple VNF instances. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfInstances.schema.json ${json} + Log Validation OK + +Get information about multiple VNF instances Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 5.4.2.2-1 + ... Test title: Get information about multiple VNF instances - Invalid attribute-based filtering parameters + ... Test objective: The objective is to query information about multiple VNF instances with Invalid attribute-based filtering parameters + ... Pre-conditions: + ... Reference: section 5.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about multiple VNF instances. + Log Query VNF The GET method queries information about multiple VNF instances. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?attribute_not_exist=some_value + Log Validate Status code + Integer response status 400 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Get information about multiple VNF instances Bad Request Invalid attribute selector + [Documentation] Test ID: 5.4.2.2-1 + ... Test title: Get information about multiple VNF instances - Invalid attribute selector + ... Test objective: The objective is to query information about multiple VNF instances with Invalid attribute selector + ... Pre-conditions: + ... Reference: section 5.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Query VNF The GET method queries information about multiple VNF instances. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?fields=wrong_field + Log Validate Status code + Integer response status 400 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT VNFInstances - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances + Log Validate Status code + Integer response status 405 + +PATCH VNFInstances - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances + Log Validate Status code + Integer response status 405 + +DELETE VNFInstances - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances + Log Validate Status code + Integer response status 405 diff --git a/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot b/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot index b1083208eb1762779e8d6c7433c7461ef79ec218..4d44695ddae3ba334023dd842331d06897624517 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot @@ -1,63 +1,64 @@ -*** Setting *** -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 VNFInstantiation - ${post_response} = Instantiate VNF - Validate Status Code ${post_response.status_code} 201 - Validate Header ${post_response.headers} Location - Validate Header ${post_response.headers} Content-Type - Validate JsonSchema ${post_response.body} vnfInstance.schema.json - ${get_response}= Retrieve VNFinstance ${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} vnfInstance.schema.json - - -*** Keywords *** -Instantiate VNF - Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/createVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${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} - ${json}= evaluate json.loads('''${body}''') json - Validate Json ${schema} ${json} - Log Validation OK - -Retrieve VNFinstance - [Arguments] ${vnfId} - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId} - [Return] response \ No newline at end of file +*** Setting *** +Resource environment/configuration.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 VNFInstantiation + ${post_response} = Instantiate VNF + Validate Status Code ${post_response.status_code} 201 + Validate Header ${post_response.headers} Location + Validate Header ${post_response.headers} Content-Type + Validate JsonSchema ${post_response.body} vnfInstance.schema.json + ${get_response}= Retrieve VNFinstance ${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} vnfInstance.schema.json + + +*** Keywords *** +Instantiate VNF + Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/createVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${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} + ${json}= evaluate json.loads('''${body}''') json + Validate Json ${schema} ${json} + Log Validation OK + +Retrieve VNFinstance + [Arguments] ${vnfId} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId} + [Return] response \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index f625a23024cf71772233428876cd96db4dabd0c4..ab10db01ef944647dfb7837b000e99ba20425dd0 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -1,116 +1,234 @@ -*** Settings *** -Resource environment/variables.txt -Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml -Library OperatingSystem -Library BuiltIn -Library JSONLibrary -Library JSONSchemaLibrary schemas/ - -*** Keywords *** -Get Vnf Instance - [Arguments] ${vnfInstanceId} - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - ${body}= Output response body - ${json}= evaluate json.loads('''${body}''') json - [Return] ${json} - -Check resource Instantiated - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} - Integer response status 200 - String response body instantiationState INSTANTIATED - -Get Vnf Scale Info - [Arguments] ${vnfInstanceId} - ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} - ${scaleInfo}= Get Value From Json ${vnfInstance} $..scaleStatus - [Return] ${scaleInfo} - -Check Response Status - [Arguments] ${expected_status} ${status} - Should Be Equal ${expected_status} ${status} - -Send VNFscaleOut Request - Log Trying to scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/scaleVnfOutRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - ${headers}= Output response headers - ${json}= evaluate json.loads('''${headers}''') json - ${status}= Output response status - [Return] ${json} ${status} - -Get VnfLcmOpOccId - [Arguments] ${headers} - ${vnfLcmOpOccId}= Get Value From Json ${headers} $..Location - Should Not Be Empty ${vnfLcmOpOccId} - [Return] ${vnfLcmOpOccId} - -Get VnfLcmOccInstance - [Arguments] ${vnfLcmOpOccId} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - ${body}= Output response body - ${json}= evaluate json.loads('''${body}''') json - [Return] ${json} - -Check operationState - [Arguments] ${operationState} ${VnfLcmOccInstance} - ${currentState}= Get Value From Json ${VnfLcmOccInstance} $..operationState - Should Be Equal ${currentState} ${operationState} - - -Check Operation Status Transition - [Arguments] ${vnfLcmOpOccId} ${initial_status} ${final_status} ${POLLING_TOT} ${POLLING_INTERVAL} - :FOR ${INDEX} IN RANGE 1 ${POLLING_TOT} - \ GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - \ ${status}= Output response status - \ Check Response Status 200 ${status} - \ ${body}= Output response body - \ ${json}= evaluate json.loads('''${body}''') json - \ ${operationState}= Get Value From Json ${json} $..operationState - \ Run Keyword If Should Not Be Equal ${initial_status} ${operationState} Exit For Loop - \ Sleep ${POLLING_INTERVAL} - Should Be Equal ${final_status} ${operationState} - -Create a new Grant - Synchronous mode - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants - Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/grantRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json Grant.schema.json ${json} - Log Validation OK - -Create a new Grant - Asynchronous mode - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants - Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/grantRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} - Output response - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library JSONLibrary +Library Collections +Library JSONSchemaLibrary schemas/ + +*** Keywords *** + +Get Vnf Instance + [Arguments] ${vnfInstanceId} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + ${body}= Output response body + ${json}= evaluate json.loads('''${body}''') json + [Return] ${json} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check Operation Occurrence Id + ${vnfLcmOpOccId}= Get Value From Json ${response.headers} $..Location + Should Not Be Empty ${vnfLcmOpOccId} + +Check HTTP Response Body Json Schema Is + [Arguments] ${schema} + ${json}= evaluate json.loads('''${response.body}''') json + Validate Json ${schema} ${json} + ${vnfInstanceId}= evaluate ${response.body.id} + Log Json Schema Validation OK + +Check resource Instantiated + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + Check VNF Status ${response.body.instantiationState} INSTANTIATED + +Check resource not Instantiated + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + Check VNF Status ${response.body.instantiationState} NOT_INSTANTIATED + +Check VNF Instance + [Arguments] ${vnfId} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId} + +Check VNF Status + [Arguments] ${current} ${expected} + Should Be Equal As Strings ${current} ${expected} + Log VNF Status in the correct status + +Get Vnf Scale Info + [Arguments] ${vnfInstanceId} + ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} + ${scaleInfo}= Get Value From Json ${vnfInstance} $..scaleStatus + [Return] ${scaleInfo} + +Get Vnf Flavour Info + [Arguments] ${vnfInstanceId} + ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} + ${flavourInfo}= Get Value From Json ${vnfInstance} $..flavourId + [Return] ${flavourInfo} + +Get Vnf Operational State Info + [Arguments] ${vnfInstanceId} + ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} + ${stateInfo}= Get Value From Json ${vnfInstance} $..vnfState + [Return] ${stateInfo} + +Get Vnf Ext Link Id + [Arguments] ${vnfInstanceId} + ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} + [Return] ${vnfInstance.instantiatedVnfInfo.extVirtualLinkInfo.id} + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response.headers} ${CONTENT_TYPE} + Log Header is present + +Send VNF Scale Out Request + Log Trying to scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfOutRequest.json + ${json}= evaluate json.loads('''${body}''') json + ${aspectId}= Set Variable ${json.aspectId} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} + +Send VNF Scale To Level Request + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/scaleVnfToLevelRequest.json + ${json}= evaluate json.loads('''${body}''') json + ${aspectId}= Set Variable ${json.aspectId} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} + +Send VNF Instance Resource Create Request + Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/createVnfRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body} + +Send VNF Instance Resource Delete Request + log Delete an individual VNF instance + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + +Send Change VNF Flavour Request + Log Trying to change the deployment flavour of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeVnfFlavourRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} + +Send Change VNF Operational State Request + Log Trying to change the operational state of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/operateVnFRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} + +Send Heal VNF Request + Log Trying to heal a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/healVnFRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} + +Send Change Ext Connectivity Request + Log Trying to change the external connectivity of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/changeExtVnfConnectivityRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} + +Send Terminate VNF Request + Log Trying to terminate a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/terminateVnFRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} + +Send Info Modification Request + Log Trying to update information of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/patchBodyRequest.json + ${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} + +Send Retry Operation Request + Log Retry a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry + +Send Roll back Operation Request + Log Rollback a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + +Send Fail Operation Request + Log Fail a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + +Send Cancel Operation Request + Log Cancel an ongoing VNF lifecycle operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode} + +Create a new Grant - Synchronous mode + [Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation} + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants + Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/grantRequest.json + ${json_body}= evaluate json.loads('''${body}''') json + Set To Dictionary ${json_body} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} operation=${operation} + ${body}= evaluate json.dumps(${json_body}) json + Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + Integer response status 201 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json grant.schema.json ${json} + Log Validation OK + +Create a new Grant - Asynchronous mode + [Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation} + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants + Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/grantRequest.json + ${json_body}= evaluate json.loads('''${body}''') json + Set To Dictionary ${json_body} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} operation=${operation} + ${body}= evaluate json.dumps(${json_body}) json + Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + Output response + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} Log Validation OK \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot index b9657514f4b8c11d7a7cfe8ce5ba412fd9e82a79..c77f50c493df820e194245ae4eb27692cb7cd887 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot @@ -1,80 +1,81 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -... spec=SOL003-VNFLifecycleManagement-API.yaml -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This resource represents VNF lifecycle management operation occurrences. The client can use this resource to query -... status information about multiple VNF lifecycle management operation occurrences. - -*** Test Cases *** -Post VNF LCM OP occurences - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs - Log Validate Status code - Integer response status 405 - -Get stauts information about multiple VNF LCM OP OCC - Log Query status information about multiple VNF lifecycle management operation occurrences. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfLcmOpOccs.schema.json ${json} - Log Validation OK - -Get stauts information about multiple VNF LCM OP OCC Bad Request Invalid attribute-based filtering parameters - Log Query status information about multiple VNF lifecycle management operation occurrences. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs?attribute_not_exist=some_value - Log Validate Status code - Integer response status 400 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -Get stauts information about multiple VNF LCM OP OCC Bad Request Invalid attribute selector - Log Query VNF The GET method queries information about multiple VNF instances. - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs?fields=wrong_field - Log Validate Status code - Integer response status 400 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT stauts information about multiple VNF LCM OP OCC - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs - Log Validate Status code - Integer response status 405 - -PATCH stauts information about multiple VNF LCM OP OCC - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs - Log Validate Status code - Integer response status 405 - -DELETE stauts information about multiple VNF LCM OP OCC - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs - Log Validate Status code +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This resource represents VNF lifecycle management operation occurrences. The client can use this resource to query +... status information about multiple VNF lifecycle management operation occurrences. + +*** Test Cases *** +Post VNF LCM OP occurences - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs + Log Validate Status code + Integer response status 405 + +Get stauts information about multiple VNF LCM OP OCC + Log Query status information about multiple VNF lifecycle management operation occurrences. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VnfLcmOpOccs.schema.json ${json} + Log Validation OK + +Get stauts information about multiple VNF LCM OP OCC Bad Request Invalid attribute-based filtering parameters + Log Query status information about multiple VNF lifecycle management operation occurrences. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs?attribute_not_exist=some_value + Log Validate Status code + Integer response status 400 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +Get stauts information about multiple VNF LCM OP OCC Bad Request Invalid attribute selector + Log Query VNF The GET method queries information about multiple VNF instances. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs?fields=wrong_field + Log Validate Status code + Integer response status 400 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT stauts information about multiple VNF LCM OP OCC - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs + Log Validate Status code + Integer response status 405 + +PATCH stauts information about multiple VNF LCM OP OCC - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs + Log Validate Status code + Integer response status 405 + +DELETE stauts information about multiple VNF LCM OP OCC - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs + Log Validate Status code Integer response status 405 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/configuration.txt b/SOL003/VNFLifecycleManagement-API/environment/configuration.txt new file mode 100644 index 0000000000000000000000000000000000000000..9a55fb7deac7d8c14f1aa8fcd1b2b6857e349862 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/environment/configuration.txt @@ -0,0 +1,38 @@ +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${VNFM_SCHEMA} https +${ACCEPT} application/json +${CONTENT_TYPE} application/json +${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${AUTH_USAGE} 1 +${CONTENT_TYPE_PATCH} application/merge-patch+json + +${apiRoot} / +${apiName} vnflcm +${apiVersion} v1 + +${CancelMode} GRACEFUL +${VNFM_DUPLICATION} 0 + + + + + +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_SCHEMA} https +${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX +${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT +${ACCEPT_PLAIN} text/plain +${ACCEPT_ZIP} application/zip +${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c +${ARTIFACT_TYPE} application/octet-stream +${ARTIFACT_ID} artifactId +${WRONG_ACCEPT} application/json +${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d +${SYNC_MODE} 0 +${sleep_interval} 20s +${callback_uri} http://localhost +${callback_port} 9091 +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt b/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt new file mode 100644 index 0000000000000000000000000000000000000000..d8e260b924a90f7744a738e16fdd2aa62a4939cf --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt @@ -0,0 +1,6 @@ +*** variables *** +${LccnSubscriptions} +${scaleInfo} +${element} +${aspectId} +${scaleOutResponse} diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index aadf8e8b873100192be19669c4eaa77bf21e842f..bf673fbf8a28e0388169c156c1b18663d931c4d1 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -1,44 +1,38 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== -${CONTENT_TYPE} application/json -${CONTENT_TYPE_PATCH} application/merge-patch+json -${ACCEPT} application/json -${apiRoot} / -${apiName} vnflcm -${apiVersion} v1 -${AUTH_USAGE} 1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX -${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${vnfInstanceName} Test-VnfInstance -${vnfInstanceDescription} description vnf -${vnfInstanceDescription_Update} Updated description vnf -${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip -${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c -${ARTIFACT_TYPE} application/octet-stream -${ARTIFACT_ID} artifactId -${WRONG_ACCEPT} application/json -${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${CancelMode} GRACEFUL -${NVFM_DUPLICATION} 0 -${sub_filter} filter -${sub_filter_invalid} filter_invalid -${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${notification_ep} /notification -${notification_port} 9091 -${VnfLcmOperationOccurrenceNotification} {} -${VnfIdentifierCreationNotification} {} -${VnfIdentifierDeletionNotification} {} -${SYNC_MODE} 0 -${sleep_interval} 20s -${GRANT_POLLING_TOT} 2 -${GRANT_POLLING_INTERVAL} 5s -${SCALE_POLLING_TOT} 10 -${SCALE_POLLING_INTERVAL} 15s \ No newline at end of file +*** Variables *** +${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d +${callback_endpoint} /notification +${callback_endpoint_fwd} /notification/check +${callback_port} 9091 +${callback_uri} http://localhost + + +${VnfLcmOperationOccurrenceNotification} {} +${VnfIdentifierCreationNotification} {} +${VnfIdentifierDeletionNotification} {} +${response} {} +${notification_request} [] +${notification_response} [] +${json} {} +${requestedFlavour} test + +${sub_filter} filter +${sub_filter_invalid} filter_invalid + + + + + +${vnfInstanceName} Test-VnfInstance +${vnfInstanceDescription} description vnf +${vnfInstanceDescription_Update} Updated description vnf +${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c + +${changeVnfFlavourRequest} {} +${requestedFlavour} test +${changeVnfOperateRequest} {} +${requestedState} test +${changeVnfExtConnectivityRequest} {} +${patchBodyRequest} {} + diff --git a/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json b/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json index 0ffa1062607fb3d20d6410eb5d971992c9bf6434..f44d3cec5b8b268efaa23b3b9a12d2948076acc7 100644 --- a/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json +++ b/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json @@ -1,10 +1,10 @@ -{ - "filter": { - "vnfInstanceSubscriptionFilter": { - "vnfdIds": [ - "6fc3539c-e602-4afa-8e13-962fb5a7d81f" - ] - } - }, - "callbackUri": "http://127.0.0.1/subscribe" -} \ No newline at end of file +{ + "filter": { + "vnfInstanceSubscriptionFilter": { + "vnfdIds": [ + "6fc3539c-e602-4afa-8e13-962fb5a7d81f" + ] + } + }, + "callbackUri": "http://localhost:9091/notification" +} diff --git a/SOL003/VNFLifecycleManagement-API/jsons/operateVnfRequest.json b/SOL003/VNFLifecycleManagement-API/jsons/operateVnfRequest.json index fca99e5d9ea5ec6971b1d576c29a6aa15ee169af..8f7b4a1921382044a1fbeccef580901f80157ee9 100644 --- a/SOL003/VNFLifecycleManagement-API/jsons/operateVnfRequest.json +++ b/SOL003/VNFLifecycleManagement-API/jsons/operateVnfRequest.json @@ -1,5 +1,5 @@ -{ - "changeStateTo": "STOPPED", - "stopType": "FORCEFUL" - "additionalParams": {} -} \ No newline at end of file +{ + "changeStateTo": "STOPPED", + "stopType": "FORCEFUL", + "additionalParams": {} +} diff --git a/SOL003/VNFLifecycleManagement-API/schemas/ProblemDetails.schema.json b/SOL003/VNFLifecycleManagement-API/schemas/ProblemDetails.schema.json index cb8cecc4e0695aca03163370e39c5fe6e194253b..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 100644 --- a/SOL003/VNFLifecycleManagement-API/schemas/ProblemDetails.schema.json +++ b/SOL003/VNFLifecycleManagement-API/schemas/ProblemDetails.schema.json @@ -1,34 +1,34 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", - "properties": { - "type": { - "type": "string", - "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", - "format": "URI" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" - }, - "status": { - "type": "integer", - "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" - }, - "detail": { - "type": "string", - "description": "A human-readable explanation specific to this occurrence of the problem.\n" - }, - "instance": { - "type": "string", - "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", - "format": "URI" - } - }, - "required": [ - "status", - "detail" - ] +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", + "properties": { + "type": { + "type": "string", + "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", + "format": "URI" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" + }, + "status": { + "type": "integer", + "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem.\n" + }, + "instance": { + "type": "string", + "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", + "format": "URI" + } + }, + "required": [ + "status", + "detail" + ] } \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot index 1a893a8a28420fdb5996c749b506c8bc37eb4717..f1715ad4501e72ac1abc78237f2752dad50272f1 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot @@ -1,96 +1,143 @@ -*** Settings *** -Resource environmentvariables.txt -Library REST http://${NFVO_HOST}:${NFVO_PORT} -... spec=SOL003-VNFLifecycleOperationGranting-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Documentation This resource represents grants. The client can use this resource to obtain permission -... from the NFVO to perform a particular VNF lifecycle operation. - -*** Test Cases *** -Create a new Grant - Synchronous mode - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants - Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/grantRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json grant.schema.json ${json} - Log Validation OK - -Create a new Grant - Asynchronous mode - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants - Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/grantRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} - Output response - Integer response status 202 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - Log Validation OK - -Create a new Grant - Forbidden - # TODO: How to set up the pre-condition for this test? - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants - Log The grant request should be rejected - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/grantRejectedRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} - Integer response status 403 - Log Status code validated - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Grants - Method not implemented - Log Trying to perform a GET. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/grants - Log Validate Status code - Integer response status 405 - -PUT Grants - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/grants - Log Validate Status code - Integer response status 405 - -PATCH Grants - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/grants - Log Validate Status code - Output response - Integer response status 405 - -DELETE Grants - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/grants - Log Validate Status code - Integer response status 405 +*** Settings *** +Resource environment/variables.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +... spec=SOL003-VNFLifecycleOperationGranting-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Documentation This resource represents grants. The client can use this resource to obtain permission +... from the NFVO to perform a particular VNF lifecycle operation. + +*** Variables *** +${response} {} + +*** Test Cases *** +Request a new Grant - Synchronous mode + [Documentation] Test ID: 9.4.2.1 + ... Test title: Requests a grant for a particular VNF lifecycle operation - Synchronous mode + ... Test objective: The objective is to request a grant for a particular VNF lifecycle operation + ... Pre-conditions: + ... Reference: section 9.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The NFVO can decide immediately what to respond to a grant request + ... Post-Conditions: The grant information is available to the VNFM. + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants + Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test + Send Request Grant Request + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is grant.schema.json + Log Validation OK + +Request a new Grant - Asynchronous mode + [Documentation] Test ID: 9.4.2.2 + ... Test title: Requests a grant for a particular VNF lifecycle operation - Asynchronous mode + ... Test objective: The objective is to request a grant for a particular VNF lifecycle operation + ... Pre-conditions: + ... Reference: section 9.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The NFVO can not decide immediately what to respond to a grant request + ... Post-Conditions: The grant information is available to the VNFM. + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants + Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test + Send Request Grant Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is grant.schema.json + Wait Until Keyword Succeeds 2 min 10 sec Get an individual grant - Successful + Log Validation OK + +Request a new Grant - Forbidden + [Documentation] Test ID: 9.4.2.3 + ... Test title: Requests a grant for a particular VNF lifecycle operation - Forbidden + ... Test objective: The objective is to request a grant for a particular VNF lifecycle operation + ... Pre-conditions: The grant should not be accorded + ... Reference: section 9.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants + Log The grant request should be rejected + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/grantRejectedRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + Integer response status 403 + Log Status code validated + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Grants - Method not implemented + Log Trying to perform a GET. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/grants + Log Validate Status code + Integer response status 405 + +PUT Grants - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/grants + Log Validate Status code + Integer response status 405 + +PATCH Grants - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/grants + Log Validate Status code + Output response + Integer response status 405 + +DELETE Grants - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/grants + Log Validate Status code + Integer response status 405 + + +*** Keywords *** +Send Request Grant Request + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/grantRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_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] ${schema} + ${json}= evaluate json.loads('''${response.body}''') json + Validate Json ${schema} ${json} + Log Json Schema Validation OK + +Get an individual grant - Successful + log Trying to read an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${response.headers.Location} + Log Validate Status code + Integer response status 200 + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json grant.schema.json ${json} + Log Validation OK + \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot b/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot index 2bfa959a111eb111aa5408a23722a72b3250f3d4..21bf5587305e0c184f7a5214d909de9a7c5ee53b 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot @@ -1,89 +1,110 @@ -*** Settings *** -Resource environment/variables.txt -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Library REST http://${NFVO_HOST}:${NFVO_PORT} -... spec=SOL003-VNFLifecycleOperationGranting-API.yaml -Documentation This resource represents an individual grant. The client can use this resource to read the grant. -... It is determined by means outside the scope of the present document, such as configuration or policy, -... how long an individual grant is available. -Suite Setup Check resource existance - -*** Test Cases *** -Post Individual Grant - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 405 - -Get an individual grant - Successful - # TODO: How to set up the precondition? - log Trying to read an individual grant - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json grant.schema.json ${json} - Log Validation OK - -Get an individual grant - Process ongoing - # TODO: How to set up the precondition? - log Trying to read an individual grant - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 202 - -Get an individual grant - grant rejected - # TODO: How to set up the precondition? - log Trying to read an individual grant - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 403 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT an individual grant - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 405 - -PATCH an individual grant - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 405 - -DELETE an individual grant - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} - Log Validate Status code - Integer response status 204 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} +*** Settings *** +Resource environment/variables.txt +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +... spec=SOL003-VNFLifecycleOperationGranting-API.yaml +Documentation This resource represents an individual grant. The client can use this resource to read the grant. +... It is determined by means outside the scope of the present document, such as configuration or policy, +... how long an individual grant is available. +Suite Setup Check resource existance + +*** Test Cases *** +Post Individual Grant - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 405 + +Get an individual grant - Successful + [Documentation] Test ID: 9.4.3.1 + ... Test title: Requests a grant for a particular VNF lifecycle operation - Successful + ... Test objective: The objective is to request a grant for a particular VNF lifecycle operation + ... Pre-conditions: The related grant information is available to the VNFM + ... Reference: section 9.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log Trying to read an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json grant.schema.json ${json} + Log Validation OK + +Get an individual grant - Process ongoing + [Documentation] Test ID: 9.4.3.2 + ... Test title: Requests a grant for a particular VNF lifecycle operation - Process ongoing + ... Test objective: The objective is to request a grant for a particular VNF lifecycle operation + ... Pre-conditions: The process of creating the grant is ongoing, no grant is available yet. + ... Reference: section 9.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log Trying to read an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 202 + +Get an individual grant - grant rejected + [Documentation] Test ID: 9.4.3.3 + ... Test title: Requests a grant for a particular VNF lifecycle operation - grant rejected + ... Test objective: The objective is to request a grant for a particular VNF lifecycle operation + ... Pre-conditions: The related grant is rejected + ... Reference: section 9.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log Trying to read an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 403 + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT an individual grant - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 405 + +PATCH an individual grant - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 405 + +DELETE an individual grant - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + Log Validate Status code + Integer response status 204 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Integer response status 200 \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt index 76d0cb1db0ccad0376f09826e8aae25a60d47f64..cc67ab3bd1dcceef72023cfb4b3db8684b67fe03 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt +++ b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt @@ -1,32 +1,44 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== -${CONTENT_TYPE} application/json -${CONTENT_TYPE_PATCH} application/merge-patch+json -${ACCEPT} application/json -${apiRoot} / -${apiName} grant -${apiVersion} v1 -${AUTH_USAGE} 1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX -${grantId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${vnfInstanceDescription} description vnf -${vnfInstanceDescription_Update} Updated description vnf -${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip -${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c -${ARTIFACT_TYPE} application/octet-stream -${ARTIFACT_ID} artifactId -${WRONG_ACCEPT} application/json -${SYNC_MODE} 1 -${sub_filter} filter -${sub_filter_invalid} filter_invalid -${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${notification_ep} notification -${VrQuotaAvailNotification} {} \ No newline at end of file +*** Variables *** +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${CONTENT_TYPE} application/json +${ACCEPT} application/json +${AUTH_USAGE} 1 +${grantId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d + +${apiRoot} / +${apiName} grant +${apiVersion} v1 + +${SYNC_MODE} 1 + + + + + + + + +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${VNFM_SCHEMA} https +${CONTENT_TYPE_PATCH} application/merge-patch+json +${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX + +${vnfInstanceDescription} description vnf +${vnfInstanceDescription_Update} Updated description vnf +${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT +${ACCEPT_PLAIN} text/plain +${ACCEPT_ZIP} application/zip +${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c +${ARTIFACT_TYPE} application/octet-stream +${ARTIFACT_ID} artifactId +${WRONG_ACCEPT} application/json + +${sub_filter} filter +${sub_filter_invalid} filter_invalid +${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${notification_ep} notification +${VrQuotaAvailNotification} {} diff --git a/SOL003/VNFLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json b/SOL003/VNFLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json index cb8cecc4e0695aca03163370e39c5fe6e194253b..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json +++ b/SOL003/VNFLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json @@ -1,34 +1,34 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", - "properties": { - "type": { - "type": "string", - "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", - "format": "URI" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" - }, - "status": { - "type": "integer", - "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" - }, - "detail": { - "type": "string", - "description": "A human-readable explanation specific to this occurrence of the problem.\n" - }, - "instance": { - "type": "string", - "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", - "format": "URI" - } - }, - "required": [ - "status", - "detail" - ] +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", + "properties": { + "type": { + "type": "string", + "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", + "format": "URI" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" + }, + "status": { + "type": "integer", + "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem.\n" + }, + "instance": { + "type": "string", + "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", + "format": "URI" + } + }, + "required": [ + "status", + "detail" + ] } \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/IndividualSubscription.robot b/SOL003/VNFPackageManagement-API/IndividualSubscription.robot index ee387e6283cdd467e9ff43887b7970945e4a38c4..c474f154d835e1c608983e286c8d52212880d8db 100644 --- a/SOL003/VNFPackageManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFPackageManagement-API/IndividualSubscription.robot @@ -1,91 +1,92 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/individualSubscription.txt -Library OperatingSystem -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET Individual Subscription - Log Trying to get a single subscription identified by subscriptionId - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PkgmSubscription.schema.json ${json} - Log Validated PkgmSubscription schema - -GET Subscription - Negative (Not Found) - Log Trying to perform a request on a subscriptionID which doesn't exist - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -DELETE Subscription - Log Trying to perform a DELETE on a subscriptionId - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 204 - Log Received 204 No Content as expected - Comment Log Trying to get the deleted element - Comment Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Comment Set Request Header Accept ${ACCEPT_JSON} - Comment Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Comment GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Comment Response Status Code Should Equal 404 - Comment Log The subscriptionId is not present in database - -DELETE Subscription - Negative (Not Found) - Log Trying to perform a DELETE on a subscriptionId which doesn't exist - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Integer response status 404 - Log The subscriptionId is not present in database - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT Subscription - (Method not implemented) - 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}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Subscription - (Method not implemented) - Log Trying to perform a PATCH. 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}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -POST Subscription - (Method not implemented) - Log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/individualSubscription.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Individual Subscription + Log Trying to get a single subscription identified by subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscription.schema.json ${json} + Log Validated PkgmSubscription schema + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a subscriptionID which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Subscription + Log Trying to perform a DELETE on a subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 204 + Log Received 204 No Content as expected + Comment Log Trying to get the deleted element + Comment Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} + Comment Set Request Header Accept ${ACCEPT_JSON} + Comment Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Comment GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Comment Response Status Code Should Equal 404 + Comment Log The subscriptionId is not present in database + +DELETE Subscription - Negative (Not Found) + Log Trying to perform a DELETE on a subscriptionId which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log The subscriptionId is not present in database + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT Subscription - (Method not implemented) + 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +POST Subscription - (Method not implemented) + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot b/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot index 61d95d69844b79ef4518e062c6ca08add6fb7ad1..eb7d16f16c8720485a16ed5ef864841899315b06 100644 --- a/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot +++ b/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot @@ -1,68 +1,68 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/individualVnfPackage.txt -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET Individual VNF Package - Log Trying to get a VNF Package present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${vnfPkgInfo}= Output response body - ${json}= evaluate json.loads('''${vnfPkgInfo}''') json - Validate Json vnfPkgInfo.schema.json ${json} - Log Validation OK - -GET Individual VNF Package - Negative (Not Found) - Log Trying to perform a negative get, using wrong authorization bearer - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPackageId} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST Individual VNF Package - (Method not implemented) - 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}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT Individual VNF Package - (Method not implemented) - 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}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Individual VNF Package - (Method not implemented) - Log Trying to perform a PATCH. 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}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Individual VNF Package - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/individualVnfPackage.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Individual VNF Package + Log Trying to get a VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate response + ${vnfPkgInfo}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfo}''') json + Validate Json vnfPkgInfo.schema.json ${json} + Log Validation OK + +GET Individual VNF Package - Negative (Not Found) + Log Trying to perform a negative get, using wrong authorization bearer + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPackageId} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Individual VNF Package - (Method not implemented) + 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}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT Individual VNF Package - (Method not implemented) + 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}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Individual VNF Package - (Method not implemented) + Log Trying to perform a PATCH. 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}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Individual VNF Package - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API/SOL003-VNFPackageManagement_pending.robot b/SOL003/VNFPackageManagement-API/SOL003-VNFPackageManagement_pending.robot deleted file mode 100644 index 1350b9b7ccb770bf92d95b640dd4a759546d0c57..0000000000000000000000000000000000000000 --- a/SOL003/VNFPackageManagement-API/SOL003-VNFPackageManagement_pending.robot +++ /dev/null @@ -1,14 +0,0 @@ -*** Settings *** -Library HttpLibrary.HTTP -Resource ../variables.txt -Library JSONSchemaLibrary schemas/ - -VNFD of an individual VNF package - Log Request that will generate a 409 Error. As prerequisite is needed a VNF Package in PROCESSING onboardingState - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Set Request Header Accept ${ACCEPT_PLAIN} - Set Request Header Accept ${ACCEPT_ZIP} - GET ${apiRoot}/vnfpkgm/v1/vnf_packages/${vnfPkgId_processing}/vnfd - Response Status Code Should Equal 409 - Log Received 409 Conflict \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/Subscriptions.robot b/SOL003/VNFPackageManagement-API/Subscriptions.robot index 012bccc9aea739fd7f43af2ad1cff82c9132e26c..3fcda8b0a290190dc083cb18ca9a97fb5d428d13 100644 --- a/SOL003/VNFPackageManagement-API/Subscriptions.robot +++ b/SOL003/VNFPackageManagement-API/Subscriptions.robot @@ -1,139 +1,139 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/subscriptions.txt -Library OperatingSystem -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET Subscription - Log Trying to get the list of subscriptions - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PkgmSubscriptions.schema.json ${json} - Log Validated PkgmSubscriptions schema - -GET Subscription - Filter - Log Trying to get the list of subscriptions using filters - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PkgmSubscriptions.schema.json ${json} - Log Validated PkgmSubscriptions schema - -GET Subscription - Negative Filter - Log Trying to get the list of subscriptions using filters with wrong attribute name - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} - Integer response status 400 - Log Received a 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Subscription - Negative (Not Found) - Log Trying to perform a request on a Uri which doesn't exist - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscription - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST Subscription - Log Trying to create a new subscription - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File json/subscriptions.json - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Received 201 Created as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response has header Location - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PkgmSubscription.schema.json ${json} - Log Validation of PkgmSubscription OK - -POST Subscription - DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File json/subscriptions.json - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Received 201 Created as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response has header Location - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PkgmSubscription.schema.json ${json} - Log Validation of PkgmSubscription OK - -POST Subscription - NO DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File json/subscriptions.json - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 303 - Log Received 303 See Other as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response header contains Location - -PUT Subscription - (Method not implemented) - 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}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Subscription - (Method not implemented) - Log Trying to perform a PATCH. 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}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Subscription - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/subscriptions.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Subscription + Log Trying to get the list of subscriptions + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscriptions.schema.json ${json} + Log Validated PkgmSubscription schema + +GET Subscription - Filter + Log Trying to get the list of subscriptions using filters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscriptions.schema.json ${json} + Log Validated PkgmSubscription schema + +GET Subscription - Negative Filter + Log Trying to get the list of subscriptions using filters with wrong attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 400 + Log Received a 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a Uri which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscription + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Subscription + Log Trying to create a new subscription + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscription.schema.json ${json} + Log Validation of PkgmSubscription OK + +POST Subscription - DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscription.schema.json ${json} + Log Validation of PkgmSubscription OK + +POST Subscription - NO DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Received 303 See Other as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response header contains Location + +PUT Subscription - (Method not implemented) + 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Subscription - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot b/SOL003/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot index 19aec8b7b90ce339d423e7cc96aed85d19abb924..f5f5975b39828a3ff250d07090134d29fa23a5c7 100644 --- a/SOL003/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot +++ b/SOL003/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot @@ -1,114 +1,114 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/vnfdInIndividualVnfPackage.txt -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET VNFD in Individual VNF Package (PLAIN) - Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} - -GET VNFD in Individual VNF Package (ZIP) - Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_ZIP} - -GET VNFD in Individual VNF Package (PLAIN-ZIP) - Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd - Integer response status 200 - ${contentType}= Output response headers Content-Type - Run Keyword If ${NFVO_PLAIN} == 0 Should Contain ${contentType} ${CONTENT_TYPE_ZIP} - Run Keyword If ${NFVO_PLAIN} == 1 Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} - -GET VNFD in Individual VNF Package - Negative (PLAIN/ZIP) - Log Trying to get a negative case performing a get on a VNFD from a given VNF Package present in the NFVO Catalogue. Accept will be text/plain but VNFD is composed my multiple files. - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd - Integer response status 406 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNFD in Individual VNF Package - Negative (Not Found) - Log Trying to perform a negative get, using an erroneous package ID - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/vnfd - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNFD in Individual VNF Package - Negative (onboardingState issue) - Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/vnfd - Integer response status 409 - Log Received 409 Conflict as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST VNFD in Individual VNF Package (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT VNFD in Individual VNF Package (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH VNFD in Individual VNF Package (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE VNFD in Individual VNF Package (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/vnfdInIndividualVnfPackage.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET VNFD in Individual VNF Package (PLAIN) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} + +GET VNFD in Individual VNF Package (ZIP) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + +GET VNFD in Individual VNF Package (PLAIN-ZIP) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + +GET VNFD in Individual VNF Package - Negative (PLAIN/ZIP) + Log Trying to get a negative case performing a get on a VNFD from a given VNF Package present in the NFVO Catalogue. Accept will be text/plain but VNFD is composed my multiple files. + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd + Integer response status 406 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNFD in Individual VNF Package - Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/vnfd + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNFD in Individual VNF Package - Negative (onboardingState issue) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/vnfd + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFPackageManagement-API/VNFPackageArtifacts.robot b/SOL003/VNFPackageManagement-API/VNFPackageArtifacts.robot index 5a549a0c96bc20fd2adea0940905bc2bf7911169..43de63defff38c3025cc18723066e3f08512bec0 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageArtifacts.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageArtifacts.robot @@ -1,109 +1,109 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/vnfPackageArtifacts.txt -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET VNF Package Artifact - Log Trying to get a VNF Package Artifact - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_OCTET} - -GET VNF Package Artifact - Range - Log Trying to get an Artifact using RANGE Header and using an NFVO that can handle it - Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Set Headers {"Range": "${range}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 206 - Log Received 206 Partial Content as expected. - ${headers}= Output response headers - Should Contain ${headers} Content-Range - Should Contain ${headers} Content-Length - -GET VNF Package Artifact - NFVO No RANGE - Log Trying to get an Artifact using RANGE Header and using an NFVO that cannot handle it - Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. - Set Headers {"Range": "${range}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 200 - Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. - -GET VNF Package Artifact - Negative Range - Log Trying to get a range of bytes of the limit of the VNF Package - Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Set Headers {"Range": "${range}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 416 - Log Received 416 Range not satisfiable as expected. - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNF Package Artifact- Negative (Not Found) - Log Trying to perform a negative get, using an erroneous package ID - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNF Package Artifact - Negative (onboardingState issue) - Log Trying to get a VNF Package artifact present in the NFVO Catalogue, but not in ONBOARDED operationalStatus - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath} - Integer response status 409 - Log Received 409 Conflict as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST VNF Package Artifact - (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT VNF Package Artifact - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH VNF Package Artifact - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE VNF Package Artifact - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/vnfPackageArtifacts.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET VNF Package Artifact + Log Trying to get a VNF Package Artifact + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_OCTET} + +GET VNF Package Artifact - Range + Log Trying to get an Artifact using RANGE Header and using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 206 + Log Received 206 Partial Content as expected. + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Should Contain ${headers} Content-Length + +GET VNF Package Artifact - NFVO No RANGE + Log Trying to get an Artifact using RANGE Header and using an NFVO that cannot handle it + Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 200 + Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. + +GET VNF Package Artifact - Negative Range + Log Trying to get a range of bytes of the limit of the VNF Package + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 416 + Log Received 416 Range not satisfiable as expected. + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Artifact- Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Artifact - Negative (onboardingState issue) + Log Trying to get a VNF Package artifact present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath} + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST VNF Package Artifact - (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT VNF Package Artifact - (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH VNF Package Artifact - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNF Package Artifact - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API/VNFPackageContent.robot b/SOL003/VNFPackageManagement-API/VNFPackageContent.robot index 2963b12401b441083c67b7399ed2f6371a597b80..95c635b4fc6b7968bb60f0430295e71a15e53ead 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageContent.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageContent.robot @@ -1,120 +1,120 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Resource environment/vnfPackageContent.txt -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET VNF Package Content - Log Trying to get a VNF Package Content - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_ZIP} - -GET VNF Package Content - Range - Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it - Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Set Headers {"Range": "${range}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Integer response status 206 - Log Received 206 Partial Content as expected. - ${headers}= Output response headers - Should Contain ${headers} Content-Range - Log Header Content-Range is present - Should Contain ${headers} Content-Length - Log Header Content-Length is present - -GET VNF Package Content - Range NFVO No RANGE - Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it - Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Set Headers {"Range": "${range}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Integer response status 200 - Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. - -GET VNF Package Content - Negative Range - Log Trying to get a range of bytes of the limit of the VNF Package - Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Set Headers {"Range": "${erroneousRange}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Integer response status 416 - Log Received 416 Range not satisfiable as expected. - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNF Package Content - Negative (Not Found) - Log Trying to perform a negative get, using an erroneous package ID - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_content - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNF Package Content - Negative (onboardingState issue) - Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_content - Integer response status 409 - Log Received 409 Conflict as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST VNF Package Content - (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT VNF Package Content - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH VNF Package Content - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE VNF Package Content - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Resource environment/vnfPackageContent.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET VNF Package Content + Log Trying to get a VNF Package Content + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + +GET VNF Package Content - Range + Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 206 + Log Received 206 Partial Content as expected. + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Log Header Content-Range is present + Should Contain ${headers} Content-Length + Log Header Content-Length is present + +GET VNF Package Content - Range NFVO No RANGE + Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 200 + Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. + +GET VNF Package Content - Negative Range + Log Trying to get a range of bytes of the limit of the VNF Package + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${erroneousRange}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 416 + Log Received 416 Range not satisfiable as expected. + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Content - Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_content + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Content - Negative (onboardingState issue) + Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_content + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST VNF Package Content - (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT VNF Package Content - (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH VNF Package Content - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNF Package Content - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API/VNFPackages.robot b/SOL003/VNFPackageManagement-API/VNFPackages.robot index c230d5b61101cbce636c94b1e816b1d8a8a18ba0..c79cbfd436de60e4b512073e5d657ae03d5bbd5e 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackages.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackages.robot @@ -1,234 +1,234 @@ -*** Settings *** -Resource environment/vnfPackages.txt # VNF Packages specific parameters -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library JSONLibrary -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - -*** Test Cases *** -GET all Packages - Log Trying to get all VNF Packages present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfPkgsInfo.schema.json ${json} - Log Validation OK - Log Checking missing information for softwareImages element - ${softwareImages}= Get Value From Json ${json} $..softwareImages - Should Be Empty ${softwareImages} - Log softwareImages element is missing as excepted - Log Checking missing information for additionalArtifact element - ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts - Should Be Empty ${additional_artifacts} - Log additionalArtifact element is missing as excepted - Log Checking missing information for _links element - ${links}= Get Value From Json ${json} $.._links - Should Be Empty ${links} - Log _links element is missing as excepted - -GET all Packages - Filter - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${POS_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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json vnfPkgsInfo.schema.json ${json} - Log Validation OK - -GET all Packages - Negative (wronge filter name) - Log Trying to perform a negative get, filtering by the inexistent field 'nfvId' - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} ${AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${NEG_FIELDS} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Packages - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Packages - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Packages - all_fields - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Log Trying to validate response - Validate Json vnfPkgsInfo.schema.json ${json} - Log Validation OK - Log Trying to validate softwareImages schema - ${softwareImages}= Get Value From Json ${json} $..softwareImages - Validate Json softwareImage.schema.json ${softwareImages[0]} - Log Validation for softwareImage schema OK - Log Trying to validate additionalArtifacts schema - ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts - Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} - Log Validation for additionalArtifacts schema OK - ${links}= Get Value From Json ${json} $.._links - Validate Json links.schema.json ${links[0]} - Log Validation for _links schema OK - -GET all Packages - exclude_default - Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_default - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Log Trying to validate response - Validate Json vnfPkgsInfo.schema.json ${json} - Log Validation OK - Log Checking missing information for softwareImages element - ${softwareImages}= Get Value From Json ${json} $..softwareImages - Should Be Empty ${softwareImages} - Log softwareImages element is missing as excepted - Log Checking missing information for additionalArtifact element - ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts - Should Be Empty ${additional_artifacts} - Log additionalArtifact element is missing as excepted - Log Checking missing information for _links element - ${links}= Get Value From Json ${json} $.._links - Should Be Empty ${links} - Log _links element is missing as excepted - -GET all Packages - fields - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo - Validate Json vnfPkgsInfo.schema.json ${json} - Log Validation for vnfPkgInfo OK - Log Trying to validate softwareImages schema - ${softwareImages}= Get Value From Json ${json} $..softwareImages - Validate Json softwareImage.schema.json ${softwareImages[0]} - Log Validation for softwareImage schema OK - Log Trying to validate additionalArtifacts schema - ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts - Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} - Log Validation for additionalArtifacts schema OK - -GET all Packages - exclude_fields - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exlude_fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Log Checking missing information for softwareImages element - ${softwareImages}= Get Value From Json ${json} $..softwareImages - Should Be Empty ${softwareImages} - Log softwareImages element is missing as excepted - Log Checking missing information for additionalArtifact element - ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts - Should Be Empty ${additional_artifacts} - Log additionalArtifact element is missing as excepted - -GET all PACKAGE (Negative: Not found) - 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}/vnf_package - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST all PACKAGE (Method not implemented) - 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}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT all PACKAGE (Method not implemented) - 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}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH all PACKAGE (Method not implemented) - Log Trying to perform a PATCH. 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}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE all PACKAGE (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Resource environment/vnfPackages.txt # VNF Packages specific parameters +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET all Packages + Log Trying to get all VNF Packages present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + +GET all Packages - Filter + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + +GET all Packages - Negative (wronge filter name) + Log Trying to perform a negative get, filtering by the inexistent filter 'nfvId' + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Packages - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Packages - Negative (Unauthorized: No Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Packages - all_fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Trying to validate response + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + Log Trying to validate softwareImages schema + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Validate Json softwareImage.schema.json ${softwareImages[0]} + Log Validation for softwareImage schema OK + Log Trying to validate additionalArtifacts schema + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} + Log Validation for additionalArtifacts schema OK + ${links}= Get Value From Json ${json} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET all Packages - exclude_default + Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_default + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Trying to validate response + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + +GET all Packages - fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using fields + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation for vnfPkgInfo OK + Log Trying to validate softwareImages schema + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Validate Json softwareImage.schema.json ${softwareImages[0]} + Log Validation for softwareImage schema OK + Log Trying to validate additionalArtifacts schema + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} + Log Validation for additionalArtifacts schema OK + +GET all Packages - exclude_fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exlude_fields=${fields} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + +GET all PACKAGE (Negative: Not found) + 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}/vnf_package + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST all PACKAGE (Method not implemented) + 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}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT all PACKAGE (Method not implemented) + 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}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH all PACKAGE (Method not implemented) + Log Trying to perform a PATCH. 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}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE all PACKAGE (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API/environment/variables.txt b/SOL003/VNFPackageManagement-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..1cfd8314dbc53a86a930af0caa0ab3a55bd37833 --- /dev/null +++ b/SOL003/VNFPackageManagement-API/environment/variables.txt @@ -0,0 +1,16 @@ +*** Variables *** +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${ACCEPT_JSON} application/json +${AUTH_USAGE} 1 +${CONTENT_TYPE_JSON} application/json +${NEG_AUTHORIZATION} Bearer negativetoken +${NFVO_FIELDS} 1 + +${vnfPackageId} 788106a2-d692-44f3-a86d-384f0ce35e42 + +${apiRoot} / +${apiVersion} v1 +${apiName} vnfpkgm \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt b/SOL003/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt index 459e121a67b9731206baba787ac34de9b621e8d1..570dab4f3c51169856cf59982c47028e881cfade 100644 --- a/SOL003/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt +++ b/SOL003/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt @@ -1,11 +1,6 @@ -*** Variables *** -${ACCEPT_ZIP} application/zip -${CONTENT_TYPE_ZIP} application/zip -${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO -${erroneousVnfPkgId} erroneousPkgId -${vnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 -${erroneousRange} bytes=100000-1000000 # Requesting a out of range number of bytes -${onboardingStateVnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 # The VNF Package is in CREATED onboardingState -${range} bytes=0-1023 -${artifactPath} artifactPath -${CONTENT_TYPE_OCTET} application/octet-stream +*** Variables *** +${artifactPath} artifactPath +${CONTENT_TYPE_OCTET} application/octet-stream +${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO +${range} bytes=0-1023 +${erroneousVnfPkgId} erroneousPkgId diff --git a/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt b/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt index 87cd173f3d0601ed887e29c27d84a201e17094ed..45a2a51a8178e388bb5ae572094330777a25af1a 100644 --- a/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt +++ b/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt @@ -1,9 +1,8 @@ -*** Variables *** -${ACCEPT_ZIP} application/zip -${CONTENT_TYPE_ZIP} application/zip -${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO -${erroneousVnfPkgId} erroneousPkgId -${vnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 -${erroneousRange} bytes=100000-1000000 # Requesting a out of range number of bytes -${onboardingStateVnfPkgId} f9f130e4-05eb-4082-a676-4c97d13a883d # The VNF Package is in CREATED onboardingState -${range} bytes=0-1023 +*** Variables *** +${ACCEPT_ZIP} application/zip +${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO +${range} bytes=0-1023 +${erroneousRange} bytes=10000000-1000000000 # Requesting a out of range number of bytes +${erroneousVnfPkgId} erroneousPkgId +${onboardingStateVnfPkgId} f9f130e4-05eb-4082-a676-4c97d13a883d # The VNF Package is in CREATED onboardingState +${CONTENT_TYPE_ZIP} application/zip diff --git a/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt b/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt index d209245d4784c6a2101cf0d212fa3a05219ce5e4..8efcc7d312d40bf9388877a3de5a3352dab5b324 100644 --- a/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt +++ b/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt @@ -1,5 +1,4 @@ -*** Variables *** -${POS_FIELDS} vnfdId=41fdd38a-3d4c-465c-83e0-f80e014425f8 ,vnfProvider=NXW # Positive case, suing compiant fields name for filtering get request -${NEG_FIELDS} nfvId=41fdd38a-3d4c-465c-83e0-f80e014425f8 # Negative case, using wrong name of field -${CAN_FILTER} 1 # NFVO in able to use filters when retrieving VNF Packages -${fields} softwareImages,additionalArtifacts +*** Variables *** +${POS_FILTER} vnfdId=41fdd38a-3d4c-465c-83e0-f80e014425f8 ,vnfProvider=NXW # Positive case, suing compiant fields name for filtering get request +${NEG_FILTER} nfvId=41fdd38a-3d4c-465c-83e0-f80e014425f8 # Negative case, using wrong name of field +${fields} softwareImages,additionalArtifacts diff --git a/SOL003/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt b/SOL003/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt index 550531a5d4d6664a9e9b03b858a33fa7923bc68e..ad8b310b86430410fa8c639bc5abb1c89a316dc7 100644 --- a/SOL003/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt +++ b/SOL003/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt @@ -1,11 +1,8 @@ -*** Variables *** -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip -${CONTENT_TYPE_PLAIN} text/plain -${CONTENT_TYPE_ZIP} application/zip -${NFVO_VNFD_PLAIN} 1 -${NFVO_VNFD_ZIP} 0 -${vnfPkgPlainVNFD} c26ad7fb-072b-48c4-a663-7d71646d9e98 # The VNF Pakcage contains a VNFD which is a Single Plain File -${vnfPkgZipVNFD} f5b220d4-6177-4ebb-a554-a43311e16075 # The VNF Package contains a VNFD composed by multiple files -${erroneousVnfPkgId} erroneousPkgId -${onboardingStateVnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 # The VNF Package is in CREATED onboardingState +*** Variables *** +${ACCEPT_PLAIN} text/plain +${CONTENT_TYPE_PLAIN} text/plain +${vnfPkgPlainVNFD} c26ad7fb-072b-48c4-a663-7d71646d9e98 # The VNF Pakcage contains a VNFD which is a Single Plain File +${ACCEPT_ZIP} application/zip +${CONTENT_TYPE_ZIP} application/zip +${vnfPkgZipVNFD} f5b220d4-6177-4ebb-a554-a43311e16075 # The VNF Package contains a VNFD composed by multiple files + diff --git a/SOL003/VNFPackageManagement-API/jsons/subscriptios.json b/SOL003/VNFPackageManagement-API/jsons/subscriptions.json similarity index 100% rename from SOL003/VNFPackageManagement-API/jsons/subscriptios.json rename to SOL003/VNFPackageManagement-API/jsons/subscriptions.json diff --git a/SOL003/VNFPackageManagementNotification-API_nxw/PackageManagementNotification.robot b/SOL003/VNFPackageManagementNotification-API/PackageManagementNotification.robot similarity index 72% rename from SOL003/VNFPackageManagementNotification-API_nxw/PackageManagementNotification.robot rename to SOL003/VNFPackageManagementNotification-API/PackageManagementNotification.robot index 10320e42a177295462faf38c6b461d47645e713e..420c3c6106c80c55d745c98e6207cb30a313d1e1 100644 --- a/SOL003/VNFPackageManagementNotification-API_nxw/PackageManagementNotification.robot +++ b/SOL003/VNFPackageManagementNotification-API/PackageManagementNotification.robot @@ -12,8 +12,8 @@ Library String *** Test Cases *** Check Notification Endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Verify Mock Expectation ${req} @@ -23,8 +23,8 @@ Post VNF Package Onboarding Notification ${json}= Get File schemas/PackageOnboardingNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle VNF Package Onboarding Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -37,8 +37,8 @@ Post VNF Package Onboarding Notification Negative 404 ${json}= Get File schemas/ProblemDetails.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle VNF Package Onboarding Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -50,8 +50,8 @@ Post VNF Package Change Notification ${json}= Get File schema/PackageChangeNotification.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle Package Change Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -64,8 +64,8 @@ Post Package Change Notification Negative 404 ${json}= Get File schemas/ProblemDetails.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock request and response to handle Package Change Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -76,8 +76,8 @@ Post Package Change Notification Negative 404 PUT VNF Package Management Notification Log PUT Method not implemented - &{req}= Create Mock Request Matcher Schema PUT ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -88,8 +88,8 @@ PUT VNF Package Management Notification PATCH VNF Package Management Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema PATCH ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results @@ -100,8 +100,8 @@ PATCH VNF Package Management Notification DELETE VNF Package Management Notification Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema DELETE ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 Create Mock Expectation ${req} ${rsp} Sleep ${sleep_interval} Log Verifying results diff --git a/SOL003/VNFPackageManagementNotification-API_nxw/environment/variables.txt b/SOL003/VNFPackageManagementNotification-API/environment/variables.txt similarity index 100% rename from SOL003/VNFPackageManagementNotification-API_nxw/environment/variables.txt rename to SOL003/VNFPackageManagementNotification-API/environment/variables.txt diff --git a/SOL003/VNFPackageManagementNotification-API_nxw/schemas/PackageChangeNotification.schema.json b/SOL003/VNFPackageManagementNotification-API/schemas/PackageChangeNotification.schema.json similarity index 100% rename from SOL003/VNFPackageManagementNotification-API_nxw/schemas/PackageChangeNotification.schema.json rename to SOL003/VNFPackageManagementNotification-API/schemas/PackageChangeNotification.schema.json diff --git a/SOL003/VNFPackageManagementNotification-API_nxw/schemas/PackageOnboardingNotification.schema.json b/SOL003/VNFPackageManagementNotification-API/schemas/PackageOnboardingNotification.schema.json similarity index 100% rename from SOL003/VNFPackageManagementNotification-API_nxw/schemas/PackageOnboardingNotification.schema.json rename to SOL003/VNFPackageManagementNotification-API/schemas/PackageOnboardingNotification.schema.json diff --git a/SOL003/VNFPackageManagementNotification-API_nxw/schemas/ProblemDetails.schema.json b/SOL003/VNFPackageManagementNotification-API/schemas/ProblemDetails.schema.json similarity index 100% rename from SOL003/VNFPackageManagementNotification-API_nxw/schemas/ProblemDetails.schema.json rename to SOL003/VNFPackageManagementNotification-API/schemas/ProblemDetails.schema.json diff --git a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot index 40ea45ee034bbcd38aa0d3ff5e085a0aaa12b606..797c251089da768300aec191aee9713d24a9a1f6 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot @@ -1,80 +1,83 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library JSONLibrary -Resource environment/IndividualPmJob.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} - -*** Test Cases *** -GET Individual PM Job - Log Trying to get a Pm Job present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJob.schema.json ${json} - Log Validation OK - -GET Individual PM Job - Negative (Not Found) - Log Trying to perform a negative get, using erroneous PM Job identifier - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -DELETE Individual PM Job - Log Trying to delete an existing PM Job - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK -POST Individual PM Job - (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library JSONLibrary +Resource environment/IndividualPmJob.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} + +*** Test Cases *** +GET Individual PM 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJob.schema.json ${json} + Log Validation OK + +GET Individual PM Job - Negative (Not Found) + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Individual PM 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 + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +POST Individual PM Job - (Method not implemented) + 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 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + 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 + 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 + diff --git a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot index 33fd55567fe8d6a59c7552c35828574af072ff9a..62ef785e4471bc5a6dcac85afe8d153f361e8094 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot @@ -1,75 +1,76 @@ -*** 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/generic.txt # Generic Parameters -Resource environment/reports.txt -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PerformanceReport.schema.json ${json} - -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - 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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} - Integer response status 405 - Log Received 405 Method not implemented as expected +*** 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 +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. + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PerformanceReport.schema.json ${json} + +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. + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + 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. + 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 + +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}/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. + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +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}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFPerformanceManagement-API/IndividualSubscription.robot b/SOL003/VNFPerformanceManagement-API/IndividualSubscription.robot index fddc1e9dcf5c1ae66ce2b4bbbcc78b89d4430d70..cfec146ab5384460d892fdb38257e63c4db90cda 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualSubscription.robot @@ -1,81 +1,82 @@ -*** Settings *** -Documentation This resource represents subscriptions. The client can use this resource to subscribe to notifications related to VNF -... performance management and to query its subscriptions. -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -Library OperatingSystem -Library JSONLibrary -Resource environment/individualSubscription.txt - -*** Test Cases *** -GET Individual Subscription - [Documentation] The client can use this method for reading an individual subscription about Performance management notifications - ... subscribed by the client. - ... This method shall follow the provisions specified in the tables 6.4.8.3.2-1 and 6.4.8.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} - Log Validated PmSubscription schema - -GET Individual Subscription - Negative (Not Found) - [Documentation] The client can use this method for reading an individual subscription about Performance management notifications - ... subscribed by the client. - ... This method shall follow the provisions specified in the tables 6.4.8.3.2-1 and 6.4.8.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}" - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Integer response status 404 - Log Received a 404 Not found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validated ProblemDetails schema - -POST Individual Subscription - (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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PUT Individual Subscription - (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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Individual Subscription - (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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Individual Subscription - (Method not implemented) - [Documentation] This method terminates an individual subscription. - ... This method shall follow the provisions specified in the tables 6.4.8.3.5-1 and 6.4.8.3.5-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}" - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 204 - Log Received a 204 No Content as expected - ${body}= Output response body - Should Be Empty ${body} - Log Body of the response is empty +*** Settings *** +Documentation This resource represents subscriptions. The client can use this resource to subscribe to notifications related to VNF +... performance management and to query its subscriptions. +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Resource environment/individualSubscription.txt + +*** Test Cases *** +GET Individual Subscription + [Documentation] The client can use this method for reading an individual subscription about Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.8.3.2-1 and 6.4.8.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscription.schema.json ${json} + Log Validated PmSubscription schema + +GET Individual Subscription - Negative (Not Found) + [Documentation] The client can use this method for reading an individual subscription about Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.8.3.2-1 and 6.4.8.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log Received a 404 Not found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validated ProblemDetails schema + +POST Individual Subscription - (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}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT Individual Subscription - (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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Individual Subscription - (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}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Individual Subscription - (Method not implemented) + [Documentation] This method terminates an individual subscription. + ... This method shall follow the provisions specified in the tables 6.4.8.3.5-1 and 6.4.8.3.5-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 204 + Log Received a 204 No Content as expected + ${body}= Output response body + Should Be Empty ${body} + Log Body of the response is empty + diff --git a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot index e86c7dd9d9686d2dc4a661aa8089c94fa0951bed..ee76ae0ce83d321c59f9c52b4c68c08fb7c41574 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot @@ -1,88 +1,89 @@ -*** Settings *** -Documentation This resource represents an individual threshold. -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library JSONLibrary -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -Library OperatingSystem -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with thresholds schema - Validate Json Threshold.schema.json ${json} - -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} - Integer response status 404 - Log Received 404 Not Found as expected - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with ProblemDetails schema - Validate Json ProblemDetails.schema.json ${json} - -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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected - -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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected - -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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Documentation This resource represents an individual threshold. +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library JSONLibrary +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +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. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with thresholds schema + Validate Json Threshold.schema.json ${json} + +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. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +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. + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + 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. + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} + Integer response status 404 + Log Received 404 Not Found as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with ProblemDetails schema + Validate Json ProblemDetails.schema.json ${json} + +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. + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/thresholds + Integer response status 405 + Log Received 405 Method not implemented as expected + +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. + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds + Integer response status 405 + Log Received 405 Method not implemented as expected + +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. + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFPerformanceManagement-API/PMJobs.robot b/SOL003/VNFPerformanceManagement-API/PMJobs.robot index a18862e189431451f13746b5e7090b13a75901d7..526803738f194e575e1912670650f3f27a171198 100644 --- a/SOL003/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL003/VNFPerformanceManagement-API/PMJobs.robot @@ -1,202 +1,203 @@ -*** Settings *** -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library JSONLibrary -Library OperatingSystem -Resource environment/pmJobs.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -Library MockServerLibrary - -*** Test Cases *** -GET all Pm Jobs - Log Trying to get all PM Jobs present in the VNFM - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJobs.schema.json ${json} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${json} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected - -GET all Pm Jobs - Filter - Log Trying to get all PM Jobs present in the VNFM, using filter params - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJobs.schema.json ${json} - Log Validation OK - -GET all Pm Jobs - all_fields - Log Trying to get all PM Jobs present in the VNFM, using 'all_fields' filter - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJobs.schema.json ${json} - Log Validation OK - Log Trying to validate criteria schema - ${criteria}= Get Value From Json ${json} $..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 ${json} $..reports - Validate Json reports.schema.json ${reports[0]} - Log Validation for reports schema OK - Log Validating _links schema - ${links}= Get Value From Json ${json} $.._links - Validate Json links.schema.json ${links[0]} - Log Validation for _links schema OK - -GET all Pm Jobs - exclude_default - Log Trying to get all VNF Packages present in the VNFM, using filter params - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJobs.schema.json ${json} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${json} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected - -GET all Pm Jobs - fields - Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJobs.schema.json ${json} - Log Validation OK - Log Trying to validate criteria schema - ${criteria}= Get Value From Json ${json} $..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 ${json} $..reports - Validate Json reports.schema.json ${reports[0]} - Log Validation for reports schema OK - -GET all Pm Jobs - exclude_fields - Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJobs.schema.json ${json} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${json} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected - Log Checking that criteria element is missing - ${criteria}= Get Value From Json ${json} $..criteria - Should Be Empty ${criteria} - Log Criteria element is empty as expected - -GET all Pm Jobs - Negative (wronge filter name) - Log Trying to get all PM Jobs present in the VNFM, using an erroneous filter param - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 headers Content-Type - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Pm Jobs (Negative: Not found) - Log Trying to perform a GET on a erroneous URI - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 headers Content-Type - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -POST all PM Jobs - Create new PM Job - Log Creating a new PM Job - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - ${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 - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmJob.schema.json ${json} - Log Validation OK - -PUT all PM Jobs - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH all Pm Jobs - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE all Pm Jobs - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library JSONLibrary +Library OperatingSystem +Resource environment/pmJobs.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library MockServerLibrary + +*** Test Cases *** +GET all Pm 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Checking that reports element is missing + ${reports}= Get Value From Json ${json} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +GET all Pm Jobs - 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + +GET all Pm Jobs - all_fields + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${json} $..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 ${json} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + Log Validating _links schema + ${links}= Get Value From Json ${json} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET all Pm Jobs - exclude_default + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Checking that reports element is missing + ${reports}= Get Value From Json ${json} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +GET all Pm Jobs - fields + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${json} $..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 ${json} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + +GET all Pm Jobs - exclude_fields + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Checking that reports element is missing + ${reports}= Get Value From Json ${json} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + Log Checking that criteria element is missing + ${criteria}= Get Value From Json ${json} $..criteria + Should Be Empty ${criteria} + Log Criteria element is empty as expected + +GET all Pm Jobs - Negative (wronge filter name) + 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 headers Content-Type + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Pm Jobs (Negative: Not found) + 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 headers Content-Type + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST all PM Jobs - Create new PM 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJob.schema.json ${json} + Log Validation OK + +PUT all PM Jobs - (Method not implemented) + 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 + +PATCH all Pm Jobs - (Method not implemented) + Log Trying to perform a PATCH. 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 + +DELETE all Pm Jobs - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + 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 + diff --git a/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot b/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot deleted file mode 100644 index 94cb5f394429ee0b63b270a69fefb0b6f14495a9..0000000000000000000000000000000000000000 --- a/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot +++ /dev/null @@ -1,65 +0,0 @@ -*** Setting *** -Resource 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}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - ${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} - ${json}= evaluate json.loads('''${body}''') json - Validate Json ${schema} ${json} - Log Validation OK - -Retrieve PMJob - [Arguments] ${pmJobId} - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - 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/Subscriptions.robot b/SOL003/VNFPerformanceManagement-API/Subscriptions.robot index c2bada4a3d8308c2b25ecf2b7e1eaf6941f04651..4b850abd0243ba9f65bc9870576c8992bb251daa 100644 --- a/SOL003/VNFPerformanceManagement-API/Subscriptions.robot +++ b/SOL003/VNFPerformanceManagement-API/Subscriptions.robot @@ -1,184 +1,185 @@ -*** Settings *** -Documentation This resource represents subscriptions. The client can use this resource to subscribe to notifications related to VNF -... performance management and to query its subscriptions. -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -Library OperatingSystem -Library JSONLibrary -Resource environment/subscriptions.txt - -*** Test Cases *** -GET Subscription - [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications - ... subscribed by the client. - ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscriptions.schema.json ${json} - Log Validated PmSubscription schema - -GET Subscription - Filter - [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications - ... subscribed by the client. - ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscriptions.schema.json ${json} - Log Validated PmSubscription schema - -GET Subscription - Negative Filter (Erroneous filter) - [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications - ... subscribed by the client. - ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ko} - Integer response status 400 - Log Received a 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validated ProblemDetails schema - -GET Subscription - Negative (Not Found) - [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications - ... subscribed by the client. - ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, - ... request and response data structures, and response codes. - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscription - Integer response status 404 - Log Received a 404 Not found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validated ProblemDetails schema - -POST Subscription - [Documentation] The POST method creates a new subscription. - ... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters, - ... request and response data structures, and response codes. - ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance - ... degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. - ... Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the - ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide - ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing - ... the existing subscription resource with the same filter and callbackUri). - Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} - Integer response status 201 - Log Received a 201 Created as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} - Log Validated PmSubscription schema - Log Trying to validate the Location header - ${headers}= Output response headers - Should Contain ${headers} Location - -POST Subscription - DUPLICATION - [Documentation] The POST method creates a new subscription. - ... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters, - ... request and response data structures, and response codes. - ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance - ... degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. - ... Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the - ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide - ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing - ... the existing subscription resource with the same filter and callbackUri). - Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM is permitting duplication. Skipping the test - Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} - Integer response status 303 - Log Received a 303 See other as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - Should Be Empty ${result} - Log Body is empty - Log Trying to validate the Location header - ${headers}= Output response headers - Should Contain ${headers} Location - -POST Subscription - NO DUPLICATION - [Documentation] The POST method creates a new subscription. - ... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters, - ... request and response data structures, and response codes. - ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance - ... degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. - ... Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the - ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide - ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing - ... the existing subscription resource with the same filter and callbackUri). - Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test - Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Set headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} - Integer response status 201 - Log Received a 201 Created as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} - Log Validated PmSubscription schema - Log Trying to validate the Location header - ${headers}= Output response headers - Should Contain ${headers} Location - -PUT Subscription - (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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected - -PATCH Subscription - (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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE Subscription - (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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected +*** Settings *** +Documentation This resource represents subscriptions. The client can use this resource to subscribe to notifications related to VNF +... performance management and to query its subscriptions. +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt # Generic Parameters +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Resource environment/subscriptions.txt + +*** Test Cases *** +GET Subscription + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscriptions.schema.json ${json} + Log Validated PmSubscription schema + +GET Subscription - Filter + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscriptions.schema.json ${json} + Log Validated PmSubscription schema + +GET Subscription - Negative Filter (Erroneous filter) + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ko} + Integer response status 400 + Log Received a 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validated ProblemDetails schema + +GET Subscription - Negative (Not Found) + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.7.3.2-1 and 6.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscription + Integer response status 404 + Log Received a 404 Not found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validated ProblemDetails schema + +POST Subscription + [Documentation] The POST method creates a new subscription. + ... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance + ... degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. + ... Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the + ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide + ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing + ... the existing subscription resource with the same filter and callbackUri). + Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + ${body_request}= Get File jsons/subscriptions.json + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + Integer response status 201 + Log Received a 201 Created as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscription.schema.json ${json} + Log Validated PmSubscription schema + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +POST Subscription - DUPLICATION + [Documentation] The POST method creates a new subscription. + ... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance + ... degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. + ... Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the + ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide + ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing + ... the existing subscription resource with the same filter and callbackUri). + Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM is permitting duplication. Skipping the test + Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + ${body_request}= Get File jsons/subscriptions.json + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + Integer response status 303 + Log Received a 303 See other as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + Should Be Empty ${result} + Log Body is empty + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +POST Subscription - NO DUPLICATION + [Documentation] The POST method creates a new subscription. + ... This method shall follow the provisions specified in the tables 6.4.7.3.1-1 and 6.4.7.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance + ... degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. + ... Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the + ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide + ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing + ... the existing subscription resource with the same filter and callbackUri). + Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test + Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + ${body_request}= Get File jsons/subscriptions.json + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + Integer response status 201 + Log Received a 201 Created as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscription.schema.json ${json} + Log Validated PmSubscription schema + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +PUT Subscription - (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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (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}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Subscription - (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}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFPerformanceManagement-API/Thresholds.robot b/SOL003/VNFPerformanceManagement-API/Thresholds.robot index 7fb80edc507f68b659617c7521de2c37461ee5ec..1838eeea49fbe904693c9e90ff5c54a2d3728447 100644 --- a/SOL003/VNFPerformanceManagement-API/Thresholds.robot +++ b/SOL003/VNFPerformanceManagement-API/Thresholds.robot @@ -1,110 +1,111 @@ -*** Settings *** -Documentation This resource represents thresholds. The client can use this resource to create and query thresholds. -Library JSONSchemaLibrary schemas/ -Resource environment/generic.txt # Generic Parameters -Library JSONLibrary -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with thresholds schema - Validate Json Thresholds.schema.json ${json} - -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with Threshold schema - Validate Json Thresholds.schema.json ${json} - -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/thresholds?${FILTER_KO} - Integer response status 400 - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with ProblemDetails schema - Validate Json ProblemDetails.schema.json ${json} - -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. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": ${VNFM_AUTHENTICATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/threshold - Integer response status 404 - Log Received 404 Not Found as expected - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - 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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - 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 - ${json}= evaluate json.loads('''${result}''') json - Log Trying to validate result with thresholds schema - Validate Json Threshold.schema.json ${json} - 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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds - 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. - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected - -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 ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds - Integer response status 405 - Log Received 405 Method not implemented as expected +*** 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 +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +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. + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with thresholds schema + Validate Json Thresholds.schema.json ${json} + +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. + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with Threshold schema + Validate Json Thresholds.schema.json ${json} + +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. + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with ProblemDetails schema + Validate Json ProblemDetails.schema.json ${json} + +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. + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Log Trying to validate ProblemDetails + Validate Json ProblemDetails.schema.json ${json} + 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}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with thresholds schema + Validate Json Threshold.schema.json ${json} + 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 + +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}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds + Integer response status 405 + Log Received 405 Method not implemented as expected + +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}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds + Integer response status 405 + Log Received 405 Method not implemented as expected + diff --git a/SOL003/VNFPerformanceManagement-API/environment/reports.txt b/SOL003/VNFPerformanceManagement-API/environment/reports.txt index 2cdc547150486d4d00c9eee1023e1d2d44359865..de12d5145866d4a221b5361816dec57eea14b902 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/reports.txt +++ b/SOL003/VNFPerformanceManagement-API/environment/reports.txt @@ -1,4 +1,4 @@ -*** Variables *** -${pmJobId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a -${reportId} 0fb4c875-e07f-46ca-a9dd-13907667a568 -${erroneousReportId} erroneousReportId +*** Variables *** +${reportId} 0fb4c875-e07f-46ca-a9dd-13907667a568 +${erroneousReportId} erroneousReportId +${pmJobId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a diff --git a/SOL003/VNFPerformanceManagement-API/environment/variables.txt b/SOL003/VNFPerformanceManagement-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..cf74185827e74ae1e67fa0ed3c6d4e537e400736 --- /dev/null +++ b/SOL003/VNFPerformanceManagement-API/environment/variables.txt @@ -0,0 +1,19 @@ +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${VNFM_SCHEMA} https + +${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${NEG_AUTHORIZATION} Bearer negativetoken + +${CONTENT_TYPE_JSON} application/json +${ACCEPT_JSON} application/json +${AUTH_USAGE} 1 +${FIELD_USAGE} 1 + +${VNFM_DUPLICATION} 1 + +${apiRoot} / +${apiVersion} v1 +${apiName} vnfpm + diff --git a/SOL003/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot b/SOL003/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot index 71f9741915ad0cc58a3aeb5b3932493ea710b65c..fff93f0b781a55e6dbaa187dc70d9fe2a71f5974 100644 --- a/SOL003/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot +++ b/SOL003/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot @@ -1,117 +1,117 @@ -*** Setting *** -Resource environment/generic.txt -Suite Setup Create Sessions -Suite Teardown Terminate All Processes kill=true -Library MockServerLibrary -Library Process -Library OperatingSystem -Library BuiltIn -Library Collections -Library String - - -*** Test Cases *** -Check Notification Endpoint - &{req}= Create Mock Request Matcher Schema GET ${callback_endpoint} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${callback_endpoint} - -Post Performance Information Available Notification - ${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Performance Information Available Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - - -Post Performance Information Available Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Performance Information Available Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Post Threshold Crossed Notification - ${json}= Get File schema/ThresholdCrossedNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Threshold Crossed Notification - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - - -Post Threshold Crossed Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handleThreshold Crossed Notification to handle 404 error - &{req}= Create Mock Request Matcher Schema POST ${callback_endpoint_error} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - - -PUT Performance Notification - Log PUT Method not implemented - &{req}= Create Mock Request Matcher Schema PUT ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - - -PATCH Performance Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema PATCH ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - - -DELETE Performance Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher Schema DELETE ${callback_endpoint} - &{rsp}= Create Mock Response Schema status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - - -*** Keywords *** -Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue +*** Setting *** +Resource environment/variables.txt +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Library MockServerLibrary +Library Process +Library OperatingSystem +Library BuiltIn +Library Collections +Library String + + +*** Test Cases *** +Check Notification Endpoint + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Verify Mock Expectation ${req} + Clear Requests ${callback_endpoint} + +Post Performance Information Available Notification + ${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Performance Information Available Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post Performance Information Available Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Performance Information Available Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Post Threshold Crossed Notification + ${json}= Get File schema/ThresholdCrossedNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Threshold Crossed Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post Threshold Crossed Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handleThreshold Crossed Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PUT Performance Notification + Log PUT Method not implemented + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PATCH Performance Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +DELETE Performance Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagementNotification-API/environment/generic.txt b/SOL003/VNFPerformanceManagementNotification-API/environment/variables.txt similarity index 100% rename from SOL003/VNFPerformanceManagementNotification-API/environment/generic.txt rename to SOL003/VNFPerformanceManagementNotification-API/environment/variables.txt diff --git a/SOL003/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json b/SOL003/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json index 91abb2c3b4caacc6b6100173e85e87f335e49962..1225d630e6384770e32cdfe99ae28c5cf3e9df02 100644 --- a/SOL003/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json +++ b/SOL003/VNFPerformanceManagementNotification-API/jsons/ThresholdCrossedNotification.json @@ -1,16 +1,15 @@ -{ - "id": "id", - "notificationType" : "ThresholdCrossedNotification", - "subscriptionId ": "subscriptionId", - "timeStamp": "2012-04-21T18:25:43-05:00", - "thresholdId": "thresholdId", - "crossingDirection": "UP", - "objectInstanceId": "vnfID", - "performanceMetric": "performanceMetric", - "performanceValue": 7 - "_links": { - "subscription": "link to subscription", - "threshold": "link to threshold" - } - -} \ No newline at end of file +{ + "id": "id", + "notificationType" : "ThresholdCrossedNotification", + "subscriptionId ": "subscriptionId", + "timeStamp": "2012-04-21T18:25:43-05:00", + "thresholdId": "thresholdId", + "crossingDirection": "UP", + "objectInstanceId": "vnfID", + "performanceMetric": "performanceMetric", + "performanceValue": 7, + "_links": { + "subscription": "link to subscription", + "threshold": "link to threshold" + } +} diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot index 4b5e90a9dbad5890bad13f9133a6399e3e9d2540..1bb3a6bfd98e8ef7f7fcee37d7ac93e23e688f23 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot @@ -1,63 +1,71 @@ -*** Settings *** -Resource environment/variables.txt -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ -Library REST ${VNFM_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} -... spec=SOL003-VirtualisedResourcesQuotaAvailableNotification-API.yaml -Documentation This resource represents an individual subscription. The client can use this resource to read and to terminate a -... subscription to notifications related to the availability of the virtualised resources quotas. -Suite Setup Check resource existance - -*** Test Cases *** -Post Individual Subscription - Method not implemented - log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 405 - -Get Information about an individual subscription - log Trying to get information about an individual subscription - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 200 - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VrQuotaAvailSubscription.schema.json ${json} - Log Validation OK - -PUT an individual subscription - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 405 - -PATCH an individual subscription - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 405 - -DELETE an individual subscription - log Try to delete an individual subscription - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Log Validate Status code - Integer response status 204 - -*** Keywords *** -Check resource existance - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} +*** Settings *** +Resource environment/variables.txt +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +... spec=SOL003-VirtualisedResourcesQuotaAvailableNotification-API.yaml +Documentation This resource represents an individual subscription. The client can use this resource to read and to terminate a +... subscription to notifications related to the availability of the virtualised resources quotas. +Suite Setup Check resource existance + +*** Test Cases *** +Post Individual Subscription - Method not implemented + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 405 + +Get Information about an individual subscription + [Documentation] Test ID: 11.4.3.1 + ... Test title: Retrieve the resource quota subscriptions + ... Test objective: The objective is to read an individual subscription for resource quota subscribed by the client + ... Pre-conditions: The subscription with the given id exists + ... Reference: section 11.4.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log Trying to get information about an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 200 + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VrQuotaAvailSubscription.schema.json ${json} + Log Validation OK + +PUT an individual subscription - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 405 + +PATCH an individual subscription - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 405 + +DELETE an individual subscription + log Try to delete an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Log Validate Status code + Integer response status 204 + +*** Keywords *** +Check resource existance + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Integer response status 200 \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot index d5942e94c44f6d43f030461d4345c9e3610ae8f0..9ca89be72becb11849b62b7d35be27c4ebd76157 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot @@ -1,58 +1,66 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${notification_port} -Library MockServerLibrary -Library Process -Library OperatingSystem - -*** Variables *** -${sleep_interval} 20s - -*** Test Cases *** -Deliver a notification - Vr Quota Availibility - log The POST method delivers a notification from the server to the client. - ${json}= Get File schemas/VrQuotaAvailNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Vr Quota AvailibilityNotification - &{req}= Create Mock Request Matcher Schema POST ${notification_ep} body=${BODY} - &{rsp}= Create Mock Response Schema headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${notification_ep} - -Test a notification end point - log The GET method allows the server to test the notification endpoint - Get ${notification_ep} - Log Validate Status code - Output response - Integer response status 204 - -PUT notification - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Put ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Patch ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -DELETE subscriptions - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Delete ${notification_ep} - Log Validate Status code - Output response - Integer response status 405 - -*** Keywords *** -Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${notification_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port} #The API producer is set to NFVO according to SOL003-5.3.9 \ No newline at end of file +*** Settings *** +Resource environment/variables.txt +Library MockServerLibrary +Library Process +Library OperatingSystem + +*** Variables *** + + +*** Test Cases *** +Deliver a notification - Vr Quota Availibility + [Documentation] Test ID: 11.4.4.1 + ... Test title: Deliver a notification - Vr Quota Availibility + ... Test objective: The objective is to notify related to the availability of the virtualised resources quota. + ... Pre-conditions: The VNF has subscribed to the Vr Quota Availibility resource + ... Reference: section 11.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + log The POST method delivers a notification from the server to the client. + ${json}= Get File schemas/VrQuotaAvailNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Vr Quota AvailibilityNotification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Test a notification end point + log The GET method allows the server to test the notification endpoint + Get ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 204 + +PUT notification - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Put ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +PATCH subscriptions - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Patch ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +DELETE subscriptions - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Delete ${callback_endpoint} + Log Validate Status code + Output response + Integer response status 405 + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL003-5.3.9 + diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot index fbd7129c1ef782500e91868643ba0a498e57cbd4..2b7a4234eaf91c53aaf0a7bde80f160cebc27991 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot @@ -1,123 +1,172 @@ -*** Settings *** -Resource environment/variables.txt -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} -... spec=SOL003-VirtualisedResourcesQuotaAvailableNotification-API.yaml -Library OperatingSystem -Library JSONLibrary -Library JSONSchemaLibrary schemas/ - - -*** Test Cases *** -Create a new subscription - Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/vrQuotaAvailSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VrQuotaAvailSubscription.schema.json ${json} - Log Validation OK - -Create a new Subscription - DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/vrQuotaAvailSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Status code validated - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json VrQuotaAvailSubscription.schema.json ${json} - Log Validation OK - -Create a new Subscription - NO-DUPLICATION - Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 1 VNFM permits duplication. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File json/vrQuotaAvailSubscriptionRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 303 - Log Status code validated - ${headers}= Output response headers - Should Contain ${headers} Location - Log Validation OK - -GET Subscriptions - Log Get the list of active subscriptions - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 200 - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json subscriptions.schema.json ${json} - Log Validation OK - -GET Subscription - Filter - Log Get the list of active subscriptions using a filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} - Integer response status 200 - Log Received a 200 OK as expected - ${result}= Output response body - ${json}= evaluate json.loads('''${result}''') json - Validate Json subscriptions.schema.json ${json} - Log Validation OK - -GET subscriptions - Bad Request Invalid attribute-based filtering parameters - Log Get the list of active subscriptions using an invalid filter - Set Headers {"Accept": "${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} - Integer response status 400 - Log Received a 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE} - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -PUT subscriptions - Method not implemented - log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 - -PATCH subscriptions - Method not implemented - log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - -DELETE subscriptions - Method not implemented - log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Log Validate Status code - Integer response status 405 +*** Settings *** +Resource environment/variables.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +... spec=SOL003-VirtualisedResourcesQuotaAvailableNotification-API.yaml +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + + +*** Test Cases *** +Create a new subscription + [Documentation] Test ID: 11.4.2.1 + ... Test title: Create a new subscription related to the availability of the virtualised resources quotas + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: no subscription with the same filter and callbackUri exists + ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/vrQuotaAvailSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VrQuotaAvailSubscription.schema.json ${json} + Log Validation OK + +Create a new Subscription - DUPLICATION + [Documentation] Test ID: 11.4.2.2 + ... Test title: Create a new resource quota subscription - DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 7.4.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists + ... Post-Conditions: + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/vrQuotaAvailSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Status code validated + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VrQuotaAvailSubscription.schema.json ${json} + Log Validation OK + +Create a new Subscription - NO-DUPLICATION + [Documentation] Test ID: 11.4.2.3 + ... Test title: Create a new resource quota subscription - NO DUPLICATION + ... Test objective: The objective is to create a new subscription. + ... Pre-conditions: subscription with the same filter and callbackUri exists + ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: the VNFM decides to not create a duplicate subscription resource + ... Post-Conditions: + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 1 VNFM permits duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File json/vrQuotaAvailSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +GET Subscriptions + [Documentation] Test ID: 11.4.2.4 + ... Test title: Retrieve a list of resource quota subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions + ... Pre-conditions: + ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Get the list of active subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 200 + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json subscriptions.schema.json ${json} + Log Validation OK + +GET Subscription - Filter + [Documentation] Test ID: 11.4.2.5 + ... Test title: Retrieve a list of resource quota subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with filter + ... Pre-conditions: + ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Get the list of active subscriptions using a filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} + Integer response status 200 + Log Received a 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json VrQuotaAvailSubscriptions.schema.json ${json} + Log Validation OK + +GET subscriptions - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 11.4.2.5-1 + ... Test title: Retrieve a list of resource quota subscriptions + ... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters + ... Pre-conditions: + ... Reference: section 11.4.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: + ... Post-Conditions: + Log Get the list of active subscriptions using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} + Integer response status 400 + Log Received a 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE} + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT subscriptions - Method not implemented + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 + +PATCH subscriptions - Method not implemented + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + +DELETE subscriptions - Method not implemented + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Log Validate Status code + Integer response status 405 + \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt index 2f105eb5555a6d17ff9911eeb9c4714a883ea1d8..8725649e6bd56b7af902e4cb3a75acf537efbee5 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt @@ -1,37 +1,27 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== -${CONTENT_TYPE} application/json -${CONTENT_TYPE_PATCH} application/merge-patch+json -${ACCEPT} application/json -${apiRoot} / -${apiName} vrqan -${apiVersion} v1 -${AUTH_USAGE} 1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX -${alarm_filter} managedObjectId -${managedObjectId} 007c111c-38a1-42c0-a666-7475ecb1567c -${invalid_alarm_filter} badFilter -${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${vnfInstanceDescription} description vnf -${vnfInstanceDescription_Update} Updated description vnf -${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip -${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c -${ARTIFACT_TYPE} application/octet-stream -${ARTIFACT_ID} artifactId -${WRONG_ACCEPT} application/json -${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${NFVO_DUPLICATION} 0 -${sub_filter} filter -${sub_filter_invalid} filter_invalid -${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${notification_ep} notification -${notification_port} 9091 -${VrQuotaAvailNotification} {} \ No newline at end of file +*** Variables *** +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${CONTENT_TYPE} application/json +${AUTH_USAGE} 1 +${ACCEPT} application/json +${NFVO_DUPLICATION} 0 +${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f + + +${sub_filter} filter +${sub_filter_invalid} filter_invalid + +${callback_endpoint} /notification +${callback_port} 9091 +${callback_uri} http://localhost +${sleep_interval} 20s + + +${apiRoot} / +${apiName} vrqan +${apiVersion} v1 + +${VrQuotaAvailNotification} {} + diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/ProblemDetails.schema.json b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/ProblemDetails.schema.json index cb8cecc4e0695aca03163370e39c5fe6e194253b..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/ProblemDetails.schema.json +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/ProblemDetails.schema.json @@ -1,34 +1,34 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", - "properties": { - "type": { - "type": "string", - "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", - "format": "URI" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" - }, - "status": { - "type": "integer", - "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" - }, - "detail": { - "type": "string", - "description": "A human-readable explanation specific to this occurrence of the problem.\n" - }, - "instance": { - "type": "string", - "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", - "format": "URI" - } - }, - "required": [ - "status", - "detail" - ] +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", + "properties": { + "type": { + "type": "string", + "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", + "format": "URI" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" + }, + "status": { + "type": "integer", + "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem.\n" + }, + "instance": { + "type": "string", + "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", + "format": "URI" + } + }, + "required": [ + "status", + "detail" + ] } \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/VrQuotaAvailSubscriptions.schema.json b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/VrQuotaAvailSubscriptions.schema.json index 6394f38119da95caa764e09e3af7f34c66d734ba..8bab3d1575abdc963c8dd8d981471d6ed43ec854 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/VrQuotaAvailSubscriptions.schema.json +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/schemas/VrQuotaAvailSubscriptions.schema.json @@ -84,4 +84,4 @@ } } } -} \ No newline at end of file +} diff --git a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot new file mode 100644 index 0000000000000000000000000000000000000000..3216a694c442ccc16908f552f1dd98c3b283e7bb --- /dev/null +++ b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot @@ -0,0 +1,182 @@ +*** Settings *** +Documentation This clause defines all the resources and methods provided by the Individual NS descriptor interface. \ +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/nsDescriptors.txt # Specific nsDescriptors Parameters +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +Library JSONSchemaLibrary schemas/ +*** Variable *** +*** Test Cases *** +GET Single Network Service Descriptor + [Documentation] The GET method reads information about an individual NS descriptor. + ... This method shall follow the provisions specified in the Tables 5.4.3.3.2-1 and 5.4.3.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method reads information about an individual NS descriptor + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Validation of Content-Type : OK + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfo.schema.json ${json} + Log Validation OK + + +GET Single Network Service Descriptor (Negative: Not found) + Log Trying to perform a GET on an erroneous nsDescriptorInfoId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId} + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +PATCH Single Network Service Descriptor - (Disabling a nsdInfo) + [Documentation] The PATCH method modifies the operational state and/or user defined data of an individual NS descriptor resource. + ... This method can be used to: + ... + ... 1) Enable a previously disabled individual NS descriptor resource, allowing again its use for instantiation of new + ... network service with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change as a + ... result. + ... + ... 2) Disable a previously enabled individual NS descriptor resource, preventing any further use for instantiation of + ... new network service(s) with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change + ... as a result. + ... + ... 3) Modify the user defined data of an individual NS descriptor resource. + ... + Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/NsdInfoModificationDisable.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} ${body} + Integer response status 200 + Log Received 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfoModification.schema.json ${json} + Log Validation of NsdInfoModifications OK + +PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdInfo) + Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in disabled operational state + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/NsdInfoModificationEnable.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} ${body} + Integer response status 200 + Log Received 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfoModification.schema.json ${json} + Log Validation of NsdInfoModifications OK + + +PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previously enabled nsdInfo) + Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/NsdInfoModificationEnable.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId} ${body} + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + + PATCH Single Network Service Descriptor - NEGATIVE (Trying to get an ETag mismatch) + Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set Headers {"If-Match": "${Etag}"} + ${body}= Get File json/NsdInfoModificationEnable.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId} ${body} + Integer response status 412 + Log Received 412 Precondition failed as expected + ${returned_etag}= Output response headers Etag + Log Verify different etags + Should Not Be Equal ${Etag} ${returned_etag} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +DELETE Single Network Service Descriptor + [Documentation] The DELETE method deletes an individual NS descriptor resource. + ... An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState = + ... NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method + ... shall fail. + Log Trying to perform a DELETE nsdInfo. The nsdInfo should be in "NOT_USED" usageState and in "DISABLED" operationalState. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} + Integer response status 204 + Log Received 204 No Content as expected + + +DELETE Single Network Service Descriptor (Negative: Trying to delete an enabled nsdInfo) + [Documentation] The DELETE method deletes an individual NS descriptor resource. + ... An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState = + ... NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method + ... shall fail. + Log Trying to perform a DELETE nsdInfo in ENABLED operational state + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId} + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +POST Single Network Service Descriptor (Method not implemented) + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} + Integer response status 405 + Log Received 405 Method not implemented as expected + + + +PUT Single Network Service Descriptor (Method not implemented) + 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}/ns_descriptors/${nsdInfoId} + Integer response status 405 + Log Received 405 Method not implemented as expected + + diff --git a/SOL005/NSDManagement-API/IndividualPnfDescriptor.robot b/SOL005/NSDManagement-API/IndividualPnfDescriptor.robot new file mode 100644 index 0000000000000000000000000000000000000000..78f914c8e295c3deb2654e690f21549531fa9144 --- /dev/null +++ b/SOL005/NSDManagement-API/IndividualPnfDescriptor.robot @@ -0,0 +1,92 @@ +*** Settings *** +Documentation This clause defines all the resources and methods provided by the Iindividual PNF descriptor interface. \ +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/pnfDescriptors.txt # Specific nsDescriptors Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem + +*** Test Cases *** +GET Single PNF Descriptor + [Documentation] The GET method reads information about an individual PNF descriptor. + ... This method shall follow the provisions specified in the Tables 5.4.6.3.2-1 and 5.4.6.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method reads information about an individual PNF descriptor + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Validation of Content-Type : OK + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfo.schema.json ${json} + Log Validation OK + + +GET Single PNF Descriptor (Negative: Not found) + Log Trying to perform a GET on an erroneous pnfDescriptorInfoId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdInfoId} + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +PATCH Single PNF Descriptor - (Disabling a nsdInfo) + [Documentation] The PATCH method modifies the user defined data of an individual PNF descriptor resource. + ... This method shall follow the provisions specified in the Tables 5.4.6.3.4-1 and 5.4.6.3.4-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The PATCH method modifies the user defined data of an individual PNF descriptor resource. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/PnfdInfoModification.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId} ${body} + Integer response status 200 + Log Received 200 OK as expected + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfoModification.schema.json ${json} + Log Validation of PnfdInfoModification OK + + +DELETE Single PNF Descriptor + Log Trying to perform a DELETE pnfdInfo. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId} + Integer response status 204 + Log Received 204 No Content as expected + + +POST Single PNF Descriptor (Method not implemented) + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId} + Integer response status 405 + Log Received 405 Method not implemented as expected + + + +PUT Single PNF Descriptor (Method not implemented) + 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}/pnf_descriptors/${pnfdInfoId} + Integer response status 405 + Log Received 405 Method not implemented as expected + + diff --git a/SOL005/NSDManagement-API/IndividualSubscription.robot b/SOL005/NSDManagement-API/IndividualSubscription.robot new file mode 100644 index 0000000000000000000000000000000000000000..392a3716dce27b6f6cf02a2733df193066a08d0b --- /dev/null +++ b/SOL005/NSDManagement-API/IndividualSubscription.robot @@ -0,0 +1,91 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/individualSubscription.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Individual Subscription + Log Trying to get a single subscription identified by subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdmSubscription.schema.json ${json} + Log Validated NsdmSubscription schema + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a subscriptionID which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Subscription + Log Trying to perform a DELETE on a subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 204 + Log Received 204 No Content as expected + Comment Log Trying to get the deleted element + Comment Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} + Comment Set Request Header Accept ${ACCEPT_JSON} + Comment Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Comment GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Comment Response Status Code Should Equal 404 + Comment Log The subscriptionId is not present in database + +DELETE Subscription - Negative (Not Found) + Log Trying to perform a DELETE on a subscriptionId which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log The subscriptionId is not present in database + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT Subscription - (Method not implemented) + 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +POST Subscription - (Method not implemented) + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/NSDManagement-API/NSDContent.robot b/SOL005/NSDManagement-API/NSDContent.robot new file mode 100644 index 0000000000000000000000000000000000000000..b3ff9a68c856eac3364dc045cbe117e4f0e43f78 --- /dev/null +++ b/SOL005/NSDManagement-API/NSDContent.robot @@ -0,0 +1,219 @@ +*** Settings *** +Documentation This clause defines the content of the individual NS descriptor, i.e. NSD content +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/nsDescriptors.txt # Specific nsDescriptors Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem + +*** Test Cases *** +GET NSD Content + [Documentation] The GET method fetches the content of the NSD. + ... The NSD can be implemented as a single file or as a collection of multiple files. If the NSD is implemented in the form + ... of multiple files, a ZIP file embedding these files shall be returned. If the NSD is implemented as a single file, either + ... that file or a ZIP file embedding that file shall be returned. + ... + ... The selection of the format is controlled by the "Accept" HTTP header passed in the GET request: + ... + ... - If the "Accept" header contains only "text/plain" and the NSD is implemented as a single file, the file shall be + ... returned; otherwise, an error message shall be returned. + ... + ... - If the "Accept" header contains only "application/zip", the single file or the multiple files that make up the + ... NSD shall be returned embedded in a ZIP file. + ... + ... - If the "Accept" header contains both "text/plain" and "application/zip", it is up to the NFVO to choose the + ... format to return for a single-file NSD; for a multi-file NSD, a ZIP file shall be returned. + ... + ... NOTE: The structure of the NSD zip file is outside the scope of the present document. + ... + ... This method shall follow the provisions specified in the Tables 5.4.4.3.2-1 and 5.4.4.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple NS descriptors + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + + +GET NSD Content - Range + Log Trying to get a NSD Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 206 + Log Received 206 Partial Content as expected. + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Log Header Content-Range is present + Should Contain ${headers} Content-Length + Log Header Content-Length is present + + +GET NSD Content - Range NFVO No RANGE + Log Trying to get a NSD Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 200 + Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. + + +GET NSD Content - Negative Range + Log Trying to get a range of bytes of the limit of the NSD Content + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${erroneousRange}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 416 + Log Received 416 Range not satisfiable as expected. + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + + + +GET NSD Content- Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd_content + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET NSD Content - Negative (onboardingState issue) + Log Trying to get a NSD content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${onboardingStateNsdInfoId}/nsd_content + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +PUT a NSD Content - Asynchronous mode + [Documentation] The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in + ... clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be + ... uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded. + ... The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the + ... NSD. + ... + ... - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain". + ... + ... - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip". + ... + ... This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a PUT. This method upload the content of a NSD + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File ${contentFile} + PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content ${body} + Integer response status 202 + Log Received 202 Accepted as expected + ${response}= Output response body + Should Be Empty ${response} + + +PUT a NSD Content - Synchronous mode + [Documentation] The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in + ... clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be + ... uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded. + ... The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the + ... NSD. + ... + ... - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain". + ... + ... - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip". + ... + ... This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a PUT. This method upload the content of a NSD + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File ${contentFile} + PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content ${body} + Integer response status 200 + Log Received 200 OK as expected + ${response}= Output response body + Should Be Empty ${response} + + +PUT a NSD Content - Negative. Nsd in CREATING state + [Documentation] The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in + ... clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be + ... uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded. + ... The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the + ... NSD. + ... + ... - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain". + ... + ... - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip". + ... + ... This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a PUT. This method upload the content of a NSD + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File ${contentFile} + PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${creatingNsdInfoId}/nsd_content ${body} + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + + +POST a NSD Content (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 405 + Log Received 405 Method not implemented as expected + + + +PATCH a NSD Content (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE a NSD Content (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/NSDManagement-API/NSDManagementNotification.robot b/SOL005/NSDManagement-API/NSDManagementNotification.robot new file mode 100644 index 0000000000000000000000000000000000000000..3ce71af2b0a0eb4c244fff1dbd63ff4aeee9ac92 --- /dev/null +++ b/SOL005/NSDManagement-API/NSDManagementNotification.robot @@ -0,0 +1,170 @@ +*** Setting *** +Resource environment/variables.txt +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Library MockServerLibrary +Library Process +Library OperatingSystem +Library BuiltIn +Library Collections +Library String + + +*** Test Cases *** +Check Notification Endpoint + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Verify Mock Expectation ${req} + Clear Requests ${callback_endpoint} + +Post NSD Change Notification + ${json}= Get File schemas/NsdChangeNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle NSD Change Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Post NSD Deletion Notification + ${json}= Get File schemas/NsdDeletionNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle NSD Deletion Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post NSD Onboard Failure Notification + ${json}= Get File schemas/NsdOnboardingFailureNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle NSD Onboard Failure Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Post NSD Onboard Notification + ${json}= Get File schemas/NsdOnboardingNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle NSD Onboard Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post PNFD Deletion Notification + ${json}= Get File schemas/PnfdDeletionNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle PNFD Deletion Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post PNFD Onboard Failure Notification + ${json}= Get File schemas/PNFDOnboardingFailureNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle PNFD Onboard Failure Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Post PNFD Onboard Notification + ${json}= Get File schemas/OPNFDOnboardingNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle NSD Onboard Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PUT VNF Package Management Notification + Log PUT Method not implemented + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PATCH VNF Package Management Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +DELETE VNF Package Management Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/NSDescriptors.robot b/SOL005/NSDManagement-API/NSDescriptors.robot new file mode 100644 index 0000000000000000000000000000000000000000..b427aa85dfa3f34e6528d9983d99006cd674c694 --- /dev/null +++ b/SOL005/NSDManagement-API/NSDescriptors.robot @@ -0,0 +1,207 @@ +*** Settings *** +Documentation This clause defines all the resources and methods provided by the NS descriptors interface. \ +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/nsDescriptors.txt # Specific nsDescriptors Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem + +*** Test Cases *** +GET all Network Service Descriptors + [Documentation] The GET method queries information about multiple NS descriptor resources. + ... This method shall follow the provisions specified in the Tables 5.4.2.3.2-1 and 5.4.2.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple NS descriptors + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Validation of Content-Type : OK + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfos.schema.json ${json} + Log Validation OK + +GET all Network Service Descriptors - Filter + [Documentation] The GET method queries information about multiple NS descriptor resources. + ... This method shall follow the provisions specified in the Tables 5.4.2.3.2-1 and 5.4.2.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple NS descriptors using Attribute-based filtering parameters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors?${POS_FIELDS} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfos.schema.json ${json} + Log Validation OK + +GET all Network Service Descriptors - Negative (wronge filter name) + Log The GET method queries multiple NS descriptors using Attribute-based filtering parameters. Negative case, with erroneous attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors?${NEG_FIELDS} + Integer response status 400 + Log Received 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Network Service Descriptors - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Network Service Descriptors - Negative (Unauthorized: No Token) + Log Trying to perform a negative get, using no authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Network Service Descriptors (Negative: Not found) + 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}/ns_descriptors + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET all Network Service Descriptors - all_fields + [Documentation] The GET method queries information about multiple NS descriptor resources. + ... This method shall follow the provisions specified in the Tables 5.4.2.3.2-1 and 5.4.2.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple NS descriptors using Attribute-based filtering parameters "all_fields" + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors?all_fields + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfos.schema.json ${json} + Log NsdInfo schema validated + ${links}= Get Value From Json ${json} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET all Network Service Descriptors - exclude_default + Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors?exclude_default + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfos.schema.json ${json} + Log NsdInfo schema validated + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + + +GET all Network Service Descriptors - exclude_fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exlude_fields=${fields} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfos.schema.json ${json} + Log NsdInfo schema validated + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + + +POST a new Network Service Descriptors + Log Creating a new network service descriptor + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/createNsdInfoRequest.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdInfo.schema.json ${json} + Log Validation of NsdInfo OK + +PUT all Network Service Descriptors (Method not implemented) + 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}/ns_descriptors + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH all Network Service Descriptors (Method not implemented) + Log Trying to perform a PATCH. 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}/ns_descriptors + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE all Network Service Descriptors (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/NSDManagement-API/PNFDContent.robot b/SOL005/NSDManagement-API/PNFDContent.robot new file mode 100644 index 0000000000000000000000000000000000000000..ef17886748ad2964b714a6acab6417ed9686a93f --- /dev/null +++ b/SOL005/NSDManagement-API/PNFDContent.robot @@ -0,0 +1,112 @@ +*** Settings *** +Documentation This clause defines the content of the individual NS descriptor, i.e. NSD content +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/pnfDescriptors.txt # Specific nsDescriptors Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem + +*** Test Cases *** +GET PNFD Content + [Documentation] The GET method fetches the content of the PNFD.. + ... This method shall follow the provisions specified in the Tables 5.4.7.3.2-1 and 5.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries PNFD Content + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} + + +GET PNFD Content- Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdId}/pnfd_content + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET PNFD Content - Negative (onboardingState issue) + Log Trying to get a PNFD content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${onboardingStatePnfdId}/pnfd_content + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +PUT a PNFD Content + Log Trying to perform a PUT. This method upload the content of a PNFD + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File ${contentFile} + PUT ${apiRoot}/${apiName}/${apiVersion}//pnf_descriptors/${pnfdInfoId}/pnfd_content ${body} + Integer response status 204 + Log Received 204 No Content as expected + ${response}= Output response body + Should Be Empty ${response} + ${contentType}= Output response headers Content-Type + Should Be Equal text/plain ${contentType} + + + +PUT a PNFD Content - Negative. Nsd in CREATING state + Log Trying to perform a PUT. + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File ${contentFile} + PUT ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${creatingPnfdId}/pnfd_content ${body} + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + + +POST a PNFD Content (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content + Integer response status 405 + Log Received 405 Method not implemented as expected + + + +PATCH a NSDContent (Method not implemented) + Log Trying to perform a PATCH. 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}/pnf_descriptors/${pnfdInfoId}/pnfd_content + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE a NSDContent (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/NSDManagement-API/PNFDescriptors.robot b/SOL005/NSDManagement-API/PNFDescriptors.robot new file mode 100644 index 0000000000000000000000000000000000000000..e9d1b93fc08c5466e66b8a8d8879e1db1eeba111 --- /dev/null +++ b/SOL005/NSDManagement-API/PNFDescriptors.robot @@ -0,0 +1,206 @@ +*** Settings *** +Documentation This clause defines all the resources and methods provided by the PNF descriptors interface. \ +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/pnfDescriptors.txt # Specific nsDescriptors Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem + +*** Test Cases *** +GET all PNF Descriptors + [Documentation] The GET method queries information about multiple PNF descriptor resources. + ... This method shall follow the provisions specified in the Tables 5.4.5.3.2-1 and 5.4.5.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple PNF descriptors + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Validation of Content-Type : OK + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfos.schema.json ${json} + Log Validation OK + +GET all PNF Descriptors - Filter + [Documentation] The GET method queries information about multiple PNF descriptor resources. + ... This method shall follow the provisions specified in the Tables 5.4.5.3.2-1 and 5.4.5.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple PNF descriptors using Attribute-based filtering parameters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?${POS_FIELDS} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfos.schema.json ${json} + Log Validation OK + +GET all PNF Descriptors - Negative (wronge filter name) + Log The GET method queries multiple PNF descriptors using Attribute-based filtering parameters. Negative case, with erroneous attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?${NEG_FIELDS} + Integer response status 400 + Log Received 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all PNF Descriptors - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all PNF Descriptors - Negative (Unauthorized: No Token) + Log Trying to perform a negative get, using no authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all PNF Descriptors (Negative: Not found) + 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}/pnf_descriptor + Integer response status 404 + Log Received 404 Not Found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET all PNF Descriptors - all_fields + [Documentation] The GET method queries information about multiple PNF descriptor resources + ... This method shall follow the provisions specified in the Tables 5.4.5.3.2-1 and 5.4.5.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Log The GET method queries multiple PNF descriptors using Attribute-based filtering parameters "all_fields" + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?all_fields + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfos.schema.json ${json} + Log PnfdInfos schema validated + ${links}= Get Value From Json ${json} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET all PNF Descriptors - exclude_default + Log Trying to get all PNF Descriptors present in the NFVO Catalogue, using exclude_default filter. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?exclude_default + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfos.schema.json ${json} + Log PnfdInfo schema validated + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + + +GET all PNF Descriptors - exclude_fields + Log Trying to get all PNF descriptors present in the NFVO Catalogue, using filter params + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?exlude_fields=${fields} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfos.schema.json ${json} + Log PnfdInfo schema validated + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + +POST a new PNF Descriptor + Log Creating a new PNF descriptor + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/createPnfdInfoRequest.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PnfdInfo.schema.json ${json} + Log Validation of PnfdInfo OK + +PUT all PNF Descriptors (Method not implemented) + 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}/pnf_descriptors + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH all PNF Descriptors (Method not implemented) + Log Trying to perform a PATCH. 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}/pnf_descriptors + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE all PNF Descriptors (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/NSDManagement-API/Subscriptions.robot b/SOL005/NSDManagement-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..04cfa0698143f8234b218cb74859ab354c5c7274 --- /dev/null +++ b/SOL005/NSDManagement-API/Subscriptions.robot @@ -0,0 +1,143 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/subscriptions.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Subscription + [Documentation] This method shall support the URI query parameters, request and response data structures, and response codes, as + ... specified in the Tables 5.4.8.3.2-1 and 5.4.8.3.2-2. + Log Trying to get the list of subscriptions + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdmSubscriptions.schema.json ${json} + Log Validated NsdmSubscription schema + +GET Subscription - Filter + Log Trying to get the list of subscriptions using filters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdmSubscriptions.schema.json ${json} + Log Validated NsdmSubscription schema + +GET Subscription - Negative Filter + Log Trying to get the list of subscriptions using filters with wrong attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 400 + Log Received a 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a Uri which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscription + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Subscription + [Documentation] This method shall support the URI query parameters, request and response data structures, and response codes, as + ... specified in the Tables 5.4.8.3.1-1 and 5.4.8.3.1-2. + Log Trying to create a new subscription + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdmSubscription.schema.json ${json} + Log Validation of NsdmSubscription OK + +POST Subscription - DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json NsdmSubscription.schema.json ${json} + Log Validation of NsdmSubscription OK + +POST Subscription - NO DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Received 303 See Other as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response header contains Location + +PUT Subscription - (Method not implemented) + 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Subscription - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/NSDManagement-API/environment/generic.txt b/SOL005/NSDManagement-API/environment/generic.txt new file mode 100644 index 0000000000000000000000000000000000000000..89c166cbf68beb3029b15ea6d846722bc0d34cb1 --- /dev/null +++ b/SOL005/NSDManagement-API/environment/generic.txt @@ -0,0 +1,15 @@ +*** Variables *** +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${CONTENT_TYPE_JSON} application/json +${ACCEPT_JSON} application/json +${apiRoot} / +${AUTH_USAGE} 1 +${NEG_AUTHORIZATION} Bearer negativetoken +${apiVersion} v1 +${apiName} nsd +${FIELD_USAGE} 1 +${NFVO_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 +${NFVO_AUTH_USAGE} 1 diff --git a/SOL005/NSDManagement-API/environment/individualSubscription.txt b/SOL005/NSDManagement-API/environment/individualSubscription.txt new file mode 100644 index 0000000000000000000000000000000000000000..23ed0f47d08c9d255fe751a1ea46b909d80e0e49 --- /dev/null +++ b/SOL005/NSDManagement-API/environment/individualSubscription.txt @@ -0,0 +1,3 @@ +*** Variables *** +${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586 +${erroneousSubscriptionId} 442e3ee5-0499-4849-9b31-eb91ce1638f1 # Not existing ID on the subscriptions diff --git a/SOL005/NSDManagement-API/environment/nsDescriptors.txt b/SOL005/NSDManagement-API/environment/nsDescriptors.txt new file mode 100644 index 0000000000000000000000000000000000000000..d76d2edab76c5ba694411fd6d4f24c4826d9cb64 --- /dev/null +++ b/SOL005/NSDManagement-API/environment/nsDescriptors.txt @@ -0,0 +1,18 @@ +*** Variables *** +${POS_FIELDS} name=nsdOnboardingState +${NEG_FIELDS} wrongName=any_value +${nsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56 +${erroneous_nsdInfoId} erroneous_nsdInfoId +${enabledNsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56 +${fields} _links +${NFVO_FIELDS} 1 +${Etag}= an etag +${modifiedNsdInfoId} f27200b1-1d8b-48c2-9d98-a993b8ab117f +${ACCEPT_ZIP} application/zip +${CONTENT_TYPE_ZIP} application/zip +${NFVO_RANGE_OK} 1 +${range} bytes=0-1023 +${erroneousRange} bytes=100000-1000000 # Requesting a out of range number of bytes +${onboardingStateNsdInfoId} b992a851-08b1-45a8-9282-a5f7a7df04a6 +${contentFile} files/nsdContent.zip +${creatingNsdInfoId} 71241932-994a-46e2-ad6c-1740674dda44 \ No newline at end of file diff --git a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt new file mode 100644 index 0000000000000000000000000000000000000000..9a01c9f41c014f7567ed82963b07bc42d612ec89 --- /dev/null +++ b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt @@ -0,0 +1,14 @@ +*** Variables *** +${POS_FIELDS} name=pnfdOnboardingState +${NEG_FIELDS} wrongName=any_value +${pnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348 +${erroneous_pnfdInfoId} erroneous_pnfdInfoId +${enabledPnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348 +${NFVO_FIELDS} 1 +${fields} _links +${ACCEPT_PLAIN} text/plain +${CONTENT_TYPE_PLAIN} text/plain +${erroneous_pnfdId} erroneousPnfdId +${onboardingStatePnfdId} 8ed2bf1f-f6ae-4d18-b478-bfab02fd4cd2 +${contentFile} files/pnfdContent.zip +${creatingPnfdId} 2e4ce0ef-3ea8-49f9-92dd-8771866015bb \ No newline at end of file diff --git a/SOL005/NSDManagement-API/environment/subscriptions.txt b/SOL005/NSDManagement-API/environment/subscriptions.txt new file mode 100644 index 0000000000000000000000000000000000000000..63a33d5e2793dbc9a0b45208cbed87f5e5bd696a --- /dev/null +++ b/SOL005/NSDManagement-API/environment/subscriptions.txt @@ -0,0 +1,4 @@ +*** Variables *** +${filter_ok} callbackUri=http://127.0.0.1/subscription +${filter_ko} nfvId=f9f130e4-05eb-4082-a676-4c97d13a883d # Not existant filter attribute-based +${NFVO_DUPLICATION} 0 diff --git a/SOL005/NSDManagement-API/environment/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..c758145e5c52572eed2049b66bc603171bce9385 --- /dev/null +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -0,0 +1,7 @@ + +*** Variables *** +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/NsdInfoModificationDisable.json b/SOL005/NSDManagement-API/jsons/NsdInfoModificationDisable.json new file mode 100644 index 0000000000000000000000000000000000000000..f35641df7b78217c6a60dc1c6cd186666e4b533a --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/NsdInfoModificationDisable.json @@ -0,0 +1,4 @@ +{ + "nsdOperationalState": "DISABLED", + "userDefinedData": {} +} diff --git a/SOL005/NSDManagement-API/jsons/NsdInfoModificationEnable.json b/SOL005/NSDManagement-API/jsons/NsdInfoModificationEnable.json new file mode 100644 index 0000000000000000000000000000000000000000..0f7613cc888fdc59e6c12e1fa16b790af7821e45 --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/NsdInfoModificationEnable.json @@ -0,0 +1,4 @@ +{ + "nsdOperationalState": "ENABLED", + "userDefinedData": {} +} diff --git a/SOL005/NSDManagement-API/jsons/PnfdInfoModification.json b/SOL005/NSDManagement-API/jsons/PnfdInfoModification.json new file mode 100644 index 0000000000000000000000000000000000000000..4394fa5db602bbefe9c2128077e13b0543b37443 --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/PnfdInfoModification.json @@ -0,0 +1,3 @@ +{ + "userDefinedData": {} +} diff --git a/SOL005/NSDManagement-API/jsons/createNsdInfoRequest.json b/SOL005/NSDManagement-API/jsons/createNsdInfoRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..b3086d7f3326a64d3c64a5dabb51ec4d917c60c5 --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/createNsdInfoRequest.json @@ -0,0 +1,3 @@ +{ + "userDefinedData": {} +} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/createPnfdInfoRequest.json b/SOL005/NSDManagement-API/jsons/createPnfdInfoRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..b3086d7f3326a64d3c64a5dabb51ec4d917c60c5 --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/createPnfdInfoRequest.json @@ -0,0 +1,3 @@ +{ + "userDefinedData": {} +} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/notifications/NsdChangeNotification.json b/SOL005/NSDManagement-API/jsons/notifications/NsdChangeNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/NsdChangeNotification.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/notifications/NsdDeletionNotification.json b/SOL005/NSDManagement-API/jsons/notifications/NsdDeletionNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/NsdDeletionNotification.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/notifications/NsdOnBoardingFailureNotification.json b/SOL005/NSDManagement-API/jsons/notifications/NsdOnBoardingFailureNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/NsdOnBoardingFailureNotification.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/notifications/NsdOnBoardingNotification.json b/SOL005/NSDManagement-API/jsons/notifications/NsdOnBoardingNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..7266cf06dadcded77e80709ab0c287922fb6184d --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/NsdOnBoardingNotification.json @@ -0,0 +1,8 @@ +{ +"_links": "", +"id": "", +"notificationType": "", +"nsdId": "", +"nsdInfoId": "", +"timeStamp": "" +} diff --git a/SOL005/NSDManagement-API/jsons/notifications/PnfdDeletionNotification.json b/SOL005/NSDManagement-API/jsons/notifications/PnfdDeletionNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/PnfdDeletionNotification.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/notifications/PnfdOnBoardingFailureNotification.json b/SOL005/NSDManagement-API/jsons/notifications/PnfdOnBoardingFailureNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/PnfdOnBoardingFailureNotification.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/notifications/PnfdOnBoardingNotification.json b/SOL005/NSDManagement-API/jsons/notifications/PnfdOnBoardingNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/notifications/PnfdOnBoardingNotification.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/jsons/subscriptions.json b/SOL005/NSDManagement-API/jsons/subscriptions.json new file mode 100644 index 0000000000000000000000000000000000000000..ccf9f514c76e5227820801292eabe56b520dbb17 --- /dev/null +++ b/SOL005/NSDManagement-API/jsons/subscriptions.json @@ -0,0 +1,3 @@ +{ + "callbackUri": "http://127.0.0.1/subscribe" +} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/schemas/NsdInfo.schema.json b/SOL005/NSDManagement-API/schemas/NsdInfo.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..c95db345b9b8561c8fd61abe4e747396b3c194c7 --- /dev/null +++ b/SOL005/NSDManagement-API/schemas/NsdInfo.schema.json @@ -0,0 +1,85 @@ +{ + "type": "object", + "required": [ + "_links", + "id", + "nsdOnboardingState", + "nsdOperationalState", + "nsdUsageState" + ], + "properties": { + "id": { + "type": "string", + "description": "Identifier of the onboarded individual NS descriptor resource. This identifier is allocated by the NFVO." + }, + "nsdId": { + "type": "object", + "description": "This identifier, which is allocated by the NSD designer, identifies the NSD in a globally unique way. It is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdName": { + "type": "string", + "description": "Name of the onboarded NSD. This information is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdVersion": { + "type": "string", + "description": "Version of the on-boarded NSD. The NSD version is a string of variable length.This information is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdDesigner": { + "type": "string", + "description": "Designer of the on-boarded NSD. This information \nis copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdInvariantId": { + "type": "string", + "description": "This identifier, which is allocated by the NSD designer, identifies an NSD in a version independent manner. This information is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "vnfPkgIds": { + "type": "array", + "description": "Identifies the VNF package for the VNFD referenced by the on-boarded NS descriptor resource.", + "items": { + "type": "string" + } + }, + "pnfdInfoIds": { + "type": "array", + "description": "Identifies the PnfdInfo element for the PNFD referenced by the on-boarded NS descriptor resource.", + "items": { + "type": "string" + } + }, + "nestedNsdInfoIds": { + "type": "array", + "description": "Identifies the NsdInfo element for the nested NSD referenced by the on-boarded NS descriptor resource. At least one of the attributes – vnfPkgId and nestedNsdInfoId shall be present, after the NSD is on-boarded.", + "items": { + "type": "string" + } + }, + "nsdOnboardingState": { + "$ref": "#/definitions/NsdOnboardingStateType" + }, + "onboardingFailureDetails": { + "$ref": "#/definitions/ProblemDetails" + }, + "nsdOperationalState": { + "$ref": "#/definitions/NsdOperationalStateType" + }, + "nsdUsageState": { + "$ref": "#/definitions/NsdUsageStateType" + }, + "userDefinedData": { + "$ref": "#/definitions/KeyValuePairs" + }, + "_links": { + "type": "object", + "description": "Links to resources related to this resource.", + "properties": { + "self": { + "$ref": "#/definitions/Link" + }, + "nsd_content": { + "$ref": "#/definitions/Link" + } + } + } + }, + "description": "This type represents a response for the query NSD operation. It shall comply with the provisions defined in\nTable 5.5.2.2-1 of GS NFV-SOL 005." +} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/schemas/NsdInfoModification.schema.json b/SOL005/NSDManagement-API/schemas/NsdInfoModification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..4a5f736f541617ed0de8d5b50883b88a707e2d45 --- /dev/null +++ b/SOL005/NSDManagement-API/schemas/NsdInfoModification.schema.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "nsdOperationalState": { + "$ref": "#/definitions/NsdOperationalStateType" + }, + "userDefinedData": { + "type": "object", + "description": "Modifications of the \"userDefinedData\" attribute in \"NsdInfo\" data type. See note. If present, these modifications shall be applied according to the rules of JSON Merge PATCH (see IETF RFC 7396 [25]). NOTE: At least one of the attributes - nsdOperationalState and userDefinedData - shall be present." + } + }, + "description": "This type represents attribute modifications for an individual NS descriptor resource based on the \"NsdInfo\" data type. The attributes of \"NsdInfo\" that can be modified are included in the \"NsdInfoModifications\" data type.\n\nNOTE: At least one of the attributes - nsdOperationalState and userDefinedData - shall be present." +} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/schemas/NsdInfos.schema.json b/SOL005/NSDManagement-API/schemas/NsdInfos.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..3cadc448ffa140c230790163803861084ac86258 --- /dev/null +++ b/SOL005/NSDManagement-API/schemas/NsdInfos.schema.json @@ -0,0 +1,88 @@ +{ + "type": "array", + "items": { + "type": "object", + "required": [ + "_links", + "id", + "nsdOnboardingState", + "nsdOperationalState", + "nsdUsageState" + ], + "properties": { + "id": { + "type": "string", + "description": "Identifier of the onboarded individual NS descriptor resource. This identifier is allocated by the NFVO." + }, + "nsdId": { + "type": "object", + "description": "This identifier, which is allocated by the NSD designer, identifies the NSD in a globally unique way. It is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdName": { + "type": "string", + "description": "Name of the onboarded NSD. This information is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdVersion": { + "type": "string", + "description": "Version of the on-boarded NSD. The NSD version is a string of variable length.This information is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdDesigner": { + "type": "string", + "description": "Designer of the on-boarded NSD. This information \nis copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "nsdInvariantId": { + "type": "string", + "description": "This identifier, which is allocated by the NSD designer, identifies an NSD in a version independent manner. This information is copied from the NSD content and shall be present after the NSD content is on-boarded." + }, + "vnfPkgIds": { + "type": "array", + "description": "Identifies the VNF package for the VNFD referenced by the on-boarded NS descriptor resource.", + "items": { + "type": "string" + } + }, + "pnfdInfoIds": { + "type": "array", + "description": "Identifies the PnfdInfo element for the PNFD referenced by the on-boarded NS descriptor resource.", + "items": { + "type": "string" + } + }, + "nestedNsdInfoIds": { + "type": "array", + "description": "Identifies the NsdInfo element for the nested NSD referenced by the on-boarded NS descriptor resource. At least one of the attributes – vnfPkgId and nestedNsdInfoId shall be present, after the NSD is on-boarded.", + "items": { + "type": "string" + } + }, + "nsdOnboardingState": { + "$ref": "#/definitions/NsdOnboardingStateType" + }, + "onboardingFailureDetails": { + "$ref": "#/definitions/ProblemDetails" + }, + "nsdOperationalState": { + "$ref": "#/definitions/NsdOperationalStateType" + }, + "nsdUsageState": { + "$ref": "#/definitions/NsdUsageStateType" + }, + "userDefinedData": { + "$ref": "#/definitions/KeyValuePairs" + }, + "_links": { + "type": "object", + "description": "Links to resources related to this resource.", + "properties": { + "self": { + "$ref": "#/definitions/Link" + }, + "nsd_content": { + "$ref": "#/definitions/Link" + } + } + } + }, + "description": "This type represents a response for the query NSD operation. It shall comply with the provisions defined in\nTable 5.5.2.2-1 of GS NFV-SOL 005." + } +} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/schemas/ProblemDetails.schema.json b/SOL005/NSDManagement-API/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..2af3ef9b3f8c0e1dc6bfa39a818ba45e63ca223c --- /dev/null +++ b/SOL005/NSDManagement-API/schemas/ProblemDetails.schema.json @@ -0,0 +1 @@ +{ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", "type": "object", "required": [ "status", "detail" ], "properties": { "type": { "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", "type": "string", "format": "URI" }, "title": { "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n", "type": "string" }, "status": { "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n", "type": "integer" }, "detail": { "description": "A human-readable explanation specific to this occurrence of the problem.\n", "type": "string" }, "instance": { "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", "type": "string", "format": "URI" } }} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/IndividualSubscription.robot b/SOL005/VNFPackageManagement-API/IndividualSubscription.robot new file mode 100644 index 0000000000000000000000000000000000000000..1a14bd04f7dd260beba1724a9cdde5e77fe2e814 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/IndividualSubscription.robot @@ -0,0 +1,91 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/individualSubscription.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Individual Subscription + Log Trying to get a single subscription identified by subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscription.schema.json ${json} + Log Validated PkgmSubscription schema + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a subscriptionID which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Subscription + Log Trying to perform a DELETE on a subscriptionId + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 204 + Log Received 204 No Content as expected + Comment Log Trying to get the deleted element + Comment Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} + Comment Set Request Header Accept ${ACCEPT_JSON} + Comment Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Comment GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Comment Response Status Code Should Equal 404 + Comment Log The subscriptionId is not present in database + +DELETE Subscription - Negative (Not Found) + Log Trying to perform a DELETE on a subscriptionId which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log The subscriptionId is not present in database + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +PUT Subscription - (Method not implemented) + 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +POST Subscription - (Method not implemented) + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPackageManagement-API/IndividualVNFPackage.robot b/SOL005/VNFPackageManagement-API/IndividualVNFPackage.robot new file mode 100644 index 0000000000000000000000000000000000000000..853cf6532986c9519563cb5618c530befad14803 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/IndividualVNFPackage.robot @@ -0,0 +1,113 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/individualVnfPackage.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Individual VNF Package + Log Trying to get a VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate response + ${vnfPkgInfo}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfo}''') json + Validate Json vnfPkgInfo.schema.json ${json} + Log Validation OK + +GET Individual VNF Package - Negative (Not Found) + Log Trying to perform a negative get, using wrong authorization bearer + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPackageId} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +PATCH Individual VNF Package + Log Trying to perform a PATCH. This method updates the information of a VNF package. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Load JSON From File jsons/VnfPkgInfoModifications.json + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} ${body} + Integer response status 200 + Log Received 200 OK as expected + Log Trying to validate VnfPkgInfoModification + ${response}= Output response body + ${json}= evaluate json.loads('''${response}''') json + Validate Json VnfPkgInfoModification.schema.json ${json} + Log Validation OK + + +PATCH Individual VNF Package - Negative (Conflict on the state of the resource) + Log Trying to perform a PATCH, disabling a package already disabled + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Load JSON From File jsons/VnfPkgInfoModificationsDisabled.json + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${disabledVnfPackageId} ${body} + Integer response status 409 + Log Received 409 Conflict as expected + Log Trying to validate ProblemDetails + ${response}= Output response body + ${json}= evaluate json.loads('''${response}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +DELETE Individual VNF Package + [Documentation] This method shall follow the provisions specified in the Tables 9.4.3.3.5-1 and 9.4.3.3.5-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a DELETE. This method deletes an individual VNF package resource. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${disabledVnfPackageId} + Integer response status 204 + Log Received 204 No Content as expected + + + +DELETE Individual VNF Package - Negative (Conflict on the state of the resource) + [Documentation] This method shall follow the provisions specified in the Tables 9.4.3.3.5-1 and 9.4.3.3.5-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a DELETE trying to delete a resource which operational status is ENABLED. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 409 + Log Received 409 Conflict as expected + Log Trying to validate ProblemDetails + ${response}= Output response body + ${json}= evaluate json.loads('''${response}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +POST Individual VNF Package - (Method not implemented) + 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}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT Individual VNF Package - (Method not implemented) + 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}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected + + diff --git a/SOL005/VNFPackageManagement-API/Notifications.robot b/SOL005/VNFPackageManagement-API/Notifications.robot new file mode 100644 index 0000000000000000000000000000000000000000..420c3c6106c80c55d745c98e6207cb30a313d1e1 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/Notifications.robot @@ -0,0 +1,116 @@ +*** Setting *** +Resource environment/variables.txt +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Library MockServerLibrary +Library Process +Library OperatingSystem +Library BuiltIn +Library Collections +Library String + + +*** Test Cases *** +Check Notification Endpoint + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Verify Mock Expectation ${req} + Clear Requests ${callback_endpoint} + +Post VNF Package Onboarding Notification + ${json}= Get File schemas/PackageOnboardingNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle VNF Package Onboarding Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post VNF Package Onboarding Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle VNF Package Onboarding Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Post VNF Package Change Notification + ${json}= Get File schema/PackageChangeNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Package Change Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post Package Change Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Package Change Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PUT VNF Package Management Notification + Log PUT Method not implemented + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PATCH VNF Package Management Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +DELETE VNF Package Management Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/Subscriptions.robot b/SOL005/VNFPackageManagement-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..d74b799c20445b11a9b2a340ff11b82ec5e3a4be --- /dev/null +++ b/SOL005/VNFPackageManagement-API/Subscriptions.robot @@ -0,0 +1,139 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/subscriptions.txt +Library OperatingSystem +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Subscription + Log Trying to get the list of subscriptions + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscriptions.schema.json ${json} + Log Validated PkgmSubscription schema + +GET Subscription - Filter + Log Trying to get the list of subscriptions using filters + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscriptions.schema.json ${json} + Log Validated PkgmSubscription schema + +GET Subscription - Negative Filter + Log Trying to get the list of subscriptions using filters with wrong attribute name + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 400 + Log Received a 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET Subscription - Negative (Not Found) + Log Trying to perform a request on a Uri which doesn't exist + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscription + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Subscription + Log Trying to create a new subscription + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscription.schema.json ${json} + Log Validation of PkgmSubscription OK + +POST Subscription - DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 + Log Received 201 Created as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PkgmSubscription.schema.json ${json} + Log Validation of PkgmSubscription OK + +POST Subscription - NO DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${body}= Get File json/subscriptions.json + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 + Log Received 303 See Other as expected + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response header contains Location + +PUT Subscription - (Method not implemented) + 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (Method not implemented) + Log Trying to perform a PATCH. 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Subscription - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot b/SOL005/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot new file mode 100644 index 0000000000000000000000000000000000000000..fe149c08a9b5c2fb34fc9d89defc4fa2338bf273 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/VNFDInIndividualVNFPackage.robot @@ -0,0 +1,114 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/vnfdInIndividualVnfPackage.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET VNFD in Individual VNF Package (PLAIN) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} + +GET VNFD in Individual VNF Package (ZIP) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + +GET VNFD in Individual VNF Package (PLAIN-ZIP) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd + Integer response status 200 + ${contentType}= Output response headers Content-Type + Run Keyword If ${NFVO_PLAIN} == 0 Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + Run Keyword If ${NFVO_PLAIN} == 1 Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} + +GET VNFD in Individual VNF Package - Negative (PLAIN/ZIP) + Log Trying to get a negative case performing a get on a VNFD from a given VNF Package present in the NFVO Catalogue. Accept will be text/plain but VNFD is composed my multiple files. + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd + Integer response status 406 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNFD in Individual VNF Package - Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/vnfd + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNFD in Individual VNF Package - Negative (onboardingState issue) + Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/vnfd + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNFD in Individual VNF Package (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPackageManagement-API/VNFPackageArtifacts.robot b/SOL005/VNFPackageManagement-API/VNFPackageArtifacts.robot new file mode 100644 index 0000000000000000000000000000000000000000..e30759f7fabcfd3eb23febfb8c023707cd159a26 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/VNFPackageArtifacts.robot @@ -0,0 +1,109 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/vnfPackageArtifacts.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET VNF Package Artifact + Log Trying to get a VNF Package Artifact + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_OCTET} + +GET VNF Package Artifact - Range + Log Trying to get an Artifact using RANGE Header and using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 206 + Log Received 206 Partial Content as expected. + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Should Contain ${headers} Content-Length + +GET VNF Package Artifact - NFVO No RANGE + Log Trying to get an Artifact using RANGE Header and using an NFVO that cannot handle it + Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 200 + Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. + +GET VNF Package Artifact - Negative Range + Log Trying to get a range of bytes of the limit of the VNF Package + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 416 + Log Received 416 Range not satisfiable as expected. + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Artifact- Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Artifact - Negative (onboardingState issue) + Log Trying to get a VNF Package artifact present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath} + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST VNF Package Artifact - (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT VNF Package Artifact - (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH VNF Package Artifact - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNF Package Artifact - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath} + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPackageManagement-API/VNFPackageContent.robot b/SOL005/VNFPackageManagement-API/VNFPackageContent.robot new file mode 100644 index 0000000000000000000000000000000000000000..7a523f1b705bfa805ffc4a1502469aebaaa15f74 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/VNFPackageContent.robot @@ -0,0 +1,144 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/vnfPackageContent.txt +Library JSONLibrary +Library OperatingSystem +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET VNF Package Content + Log Trying to get a VNF Package Content + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + +GET VNF Package Content - Range + Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content + Integer response status 206 + Log Received 206 Partial Content as expected. + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Log Header Content-Range is present + Should Contain ${headers} Content-Length + Log Header Content-Length is present + +GET VNF Package Content - Range NFVO No RANGE + Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content + Integer response status 200 + Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. + +GET VNF Package Content - Negative Range + Log Trying to get a range of bytes of the limit of the VNF Package + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${erroneousRange}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content + Integer response status 416 + Log Received 416 Range not satisfiable as expected. + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Content - Negative (Not Found) + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_content + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET VNF Package Content - Negative (onboardingState issue) + Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_content + Integer response status 409 + Log Received 409 Conflict as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +PUT VNF Package Content + Log Trying to perform a PUT. This method uploads the content of a VNF package. + Set Headers {"Contet-Type": "${CONTENT_TYPE_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${content}= Get Binary File files/vnfPackage.zip + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content ${content} + Integer response status 202 + Log Received 202 Accepted as expected + Log Verification of body. Should be empty + ${body}= Output response body + Should Be Empty ${body} + Log Verified empty body OK + + +PUT VNF Package Content - Negative (Conflict on onboarding status not in CREATED) + Log Trying to perform a PUT. This method uploads the content of a VNF package. + Set Headers {"Contet-Type": "${CONTENT_TYPE_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${content}= Get Binary File files/vnfPackage.zip + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${creatingVnfPackageId}/package_content ${content} + Integer response status 409 + Log Received 409 Conflict as expected + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +POST VNF Package Content - (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected + + +PATCH VNF Package Content - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNF Package Content - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPackageManagement-API/VNFPackageContentViaURI.robot b/SOL005/VNFPackageManagement-API/VNFPackageContentViaURI.robot new file mode 100644 index 0000000000000000000000000000000000000000..7789899615ac23859a3fe177c132865ccb73a9da --- /dev/null +++ b/SOL005/VNFPackageManagement-API/VNFPackageContentViaURI.robot @@ -0,0 +1,70 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/vnfPackageContent.txt +Library JSONLibrary +Library OperatingSystem +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +POST VNF Package Content + [Documentation] This method shall follow the provisions specified in the Tables 9.4.6.3.1-1 and 9.4.6.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a POST. The POST method provides the information for the NFVO to get the content of a VNF package. + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File jsons/UploadVnfPkgFromUriRequest.json + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content/upload_from_uri ${body} + Integer response status 202 + Log Received 202 Accepted as expected + ${response}= Output response body + Should Be Empty ${response} + + +POST VNF Package Content - Negative (VNF Package not in CREATED operational state) + [Documentation] This method shall follow the provisions specified in the Tables 9.4.6.3.1-1 and 9.4.6.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a POST. The POST method provides the information for the NFVO to get the content of a VNF package. + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get Binary File jsons/UploadVnfPkgFromUriRequest.json + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${creatingVnfPackageId}/package_content/upload_from_uri ${body} + Integer response status 409 + Log Received 409 Conflict as expected + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + + +GET VNF Package Content - (Method not implemented) + Log Trying to perform a GET. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content/upload_from_uri + Integer response status 405 + Log Received 405 Method not implemented as expected + + +PUT VNF Package Content - (Method not implemented) + Log Trying to perform a PUT. This method should not be implemented + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content/upload_from_uri + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH VNF Package Content - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content/upload_from_uri + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE VNF Package Content - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content/upload_from_uri + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPackageManagement-API/VNFPackages.robot b/SOL005/VNFPackageManagement-API/VNFPackages.robot new file mode 100644 index 0000000000000000000000000000000000000000..f058f86af140fbe2e0701d61882dfac9a1880c47 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/VNFPackages.robot @@ -0,0 +1,248 @@ +*** Settings *** +Resource environment/vnfPackages.txt # VNF Packages specific parameters +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET all Packages + [Documentation] This method shall follow the provisions specified in the Tables 9.4.2.3.1-1 and 9.4.2.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to get all VNF Packages present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + +GET all Packages - Filter + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${POS_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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + +GET all Packages - Negative (wronge filter name) + Log Trying to perform a negative get, filtering by the inexistent field 'nfvId' + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${NEG_FIELDS} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Packages - Negative (Unauthorized: Wrong Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Packages - Negative (Unauthorized: No Token) + Log Trying to perform a negative get, using wrong authorization bearer + Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 401 + Log Received 401 Unauthorized as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Packages - all_fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Trying to validate response + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + Log Trying to validate softwareImages schema + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Validate Json softwareImage.schema.json ${softwareImages[0]} + Log Validation for softwareImage schema OK + Log Trying to validate additionalArtifacts schema + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} + Log Validation for additionalArtifacts schema OK + ${links}= Get Value From Json ${json} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET all Packages - exclude_default + Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_default + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Trying to validate response + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation OK + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + Log Checking missing information for _links element + ${links}= Get Value From Json ${json} $.._links + Should Be Empty ${links} + Log _links element is missing as excepted + +GET all Packages - fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo + Validate Json vnfPkgsInfo.schema.json ${json} + Log Validation for vnfPkgInfo OK + Log Trying to validate softwareImages schema + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Validate Json softwareImage.schema.json ${softwareImages[0]} + Log Validation for softwareImage schema OK + Log Trying to validate additionalArtifacts schema + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} + Log Validation for additionalArtifacts schema OK + +GET all Packages - exclude_fields + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exlude_fields=${fields} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfos}''') json + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${json} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + +GET all PACKAGE (Negative: Not found) + 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}/vnf_package + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST all VNF PACKAGE + [Documentation] This method shall follow the provisions specified in the Tables 9.4.2.3.1-1 and 9.4.2.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + Log Trying to perform a POST to create a new individual VNF package resource + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Load JSON From File jsons/CreateVnfPkgInfoRequest.json + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages ${body} + Integer response status 201 + Log Received 201 Created as expected + Log Trying to get Location from the header + ${location}= Output response headers Location + Should Not Be Empty ${location} + Log Validation of Location headers OK + Log Validation of the vnfPkgInfo schema + ${vnfPkgInfo}= Output response body + Log Trying to validate response + ${json}= evaluate json.loads('''${vnfPkgInfo}''') json + Validate Json vnfPkgInfo.schema.json ${json} + +PUT all PACKAGE (Method not implemented) + 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}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH all PACKAGE (Method not implemented) + Log Trying to perform a PATCH. 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}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE all PACKAGE (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API/environment/generic.txt b/SOL005/VNFPackageManagement-API/environment/generic.txt similarity index 91% rename from SOL003/VNFPackageManagement-API/environment/generic.txt rename to SOL005/VNFPackageManagement-API/environment/generic.txt index 9f4cf281afb06dda2faeec8b19c015c9980d118e..db080ad3f1b7dcc420c1ce673dd46c953bc4f035 100644 --- a/SOL003/VNFPackageManagement-API/environment/generic.txt +++ b/SOL005/VNFPackageManagement-API/environment/generic.txt @@ -1,18 +1,20 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 -${CONTENT_TYPE_JSON} application/json -${ACCEPT_JSON} application/json -${apiRoot} / -${AUTH_USAGE} 1 -${NEG_AUTHORIZATION} Bearer negativetoken -${apiVersion} v1 -${apiName} vnfpkgm -${FIELD_USAGE} 1 -${NFVO_PLAIN} 1 -${NFVO_FIELDS} 1 +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${VNFM_SCHEMA} https +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${CONTENT_TYPE_JSON} application/json +${ACCEPT_JSON} application/json +${apiRoot} / +${AUTH_USAGE} 1 +${NEG_AUTHORIZATION} Bearer negativetoken +${apiVersion} v1 +${apiName} vnfpkgm +${FIELD_USAGE} 1 +${NFVO_PLAIN} 1 +${NFVO_FIELDS} 1 +${vnfPackageId} 788106a2-d692-44f3-a86d-384f0ce35e42 + diff --git a/SOL005/VNFPackageManagement-API/environment/individualSubscription.txt b/SOL005/VNFPackageManagement-API/environment/individualSubscription.txt new file mode 100644 index 0000000000000000000000000000000000000000..23ed0f47d08c9d255fe751a1ea46b909d80e0e49 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/individualSubscription.txt @@ -0,0 +1,3 @@ +*** Variables *** +${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586 +${erroneousSubscriptionId} 442e3ee5-0499-4849-9b31-eb91ce1638f1 # Not existing ID on the subscriptions diff --git a/SOL005/VNFPackageManagement-API/environment/individualVnfPackage.txt b/SOL005/VNFPackageManagement-API/environment/individualVnfPackage.txt new file mode 100644 index 0000000000000000000000000000000000000000..a2655eac1e0b5d1340243d317c20076177b8de27 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/individualVnfPackage.txt @@ -0,0 +1,4 @@ +*** Variables *** +${vnfPackageId} 4bbca710-c00e-11e8-b568-0800200c9a66 +${erroneousVnfPackageId} erroneousVnfPackageId # Given ID for vnfPkg not present in database +${disabledVnfPackageId} 87a2c9d3-00ea-4032-8c67-a5106d001868 diff --git a/SOL005/VNFPackageManagement-API/environment/subscriptions.txt b/SOL005/VNFPackageManagement-API/environment/subscriptions.txt new file mode 100644 index 0000000000000000000000000000000000000000..63a33d5e2793dbc9a0b45208cbed87f5e5bd696a --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/subscriptions.txt @@ -0,0 +1,4 @@ +*** Variables *** +${filter_ok} callbackUri=http://127.0.0.1/subscription +${filter_ko} nfvId=f9f130e4-05eb-4082-a676-4c97d13a883d # Not existant filter attribute-based +${NFVO_DUPLICATION} 0 diff --git a/SOL005/VNFPackageManagement-API/environment/variables.txt b/SOL005/VNFPackageManagement-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..c758145e5c52572eed2049b66bc603171bce9385 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -0,0 +1,7 @@ + +*** Variables *** +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt b/SOL005/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt new file mode 100644 index 0000000000000000000000000000000000000000..57893512c979f0be4360059bcaace019c4fe1de6 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/vnfPackageArtifacts.txt @@ -0,0 +1,11 @@ +*** Variables *** +${ACCEPT_ZIP} application/zip +${CONTENT_TYPE_ZIP} application/zip +${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO +${erroneousVnfPkgId} erroneousPkgId +${vnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 +${erroneousRange} bytes=100000-1000000 # Requesting a out of range number of bytes +${onboardingStateVnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 # The VNF Package is in CREATED onboardingState +${range} bytes=0-1023 +${artifactPath} artifactPath +${CONTENT_TYPE_OCTET} application/octet-stream diff --git a/SOL005/VNFPackageManagement-API/environment/vnfPackageContent.txt b/SOL005/VNFPackageManagement-API/environment/vnfPackageContent.txt new file mode 100644 index 0000000000000000000000000000000000000000..fb6bb20d5b42fd11cdb8f7edb990fdd818260be0 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/vnfPackageContent.txt @@ -0,0 +1,10 @@ +*** Variables *** +${ACCEPT_ZIP} application/zip +${CONTENT_TYPE_ZIP} application/zip +${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO +${erroneousVnfPkgId} erroneousPkgId +${vnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 +${erroneousRange} bytes=100000-1000000 # Requesting a out of range number of bytes +${onboardingStateVnfPkgId} f9f130e4-05eb-4082-a676-4c97d13a883d # The VNF Package is in CREATED onboardingState +${range} bytes=0-1023 +${creatingVnfPackageId} d246ccdd-71aa-402f-b256-6a80ee54be3d diff --git a/SOL005/VNFPackageManagement-API/environment/vnfPackages.txt b/SOL005/VNFPackageManagement-API/environment/vnfPackages.txt new file mode 100644 index 0000000000000000000000000000000000000000..ec8ef4fcb9f350e6f2696165a94cc61a75f3b206 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/vnfPackages.txt @@ -0,0 +1,5 @@ +*** Variables *** +${POS_FIELDS} vnfdId=41fdd38a-3d4c-465c-83e0-f80e014425f8 ,vnfProvider=NXW # Positive case, suing compiant fields name for filtering get request +${NEG_FIELDS} nfvId=41fdd38a-3d4c-465c-83e0-f80e014425f8 # Negative case, using wrong name of field +${CAN_FILTER} 1 # NFVO in able to use filters when retrieving VNF Packages +${fields} softwareImages,additionalArtifacts diff --git a/SOL005/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt b/SOL005/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt new file mode 100644 index 0000000000000000000000000000000000000000..519a2794c895f3b11a61e4e202a90d4c4a0ca72f --- /dev/null +++ b/SOL005/VNFPackageManagement-API/environment/vnfdInIndividualVnfPackage.txt @@ -0,0 +1,11 @@ +*** Variables *** +${ACCEPT_PLAIN} text/plain +${ACCEPT_ZIP} application/zip +${CONTENT_TYPE_PLAIN} text/plain +${CONTENT_TYPE_ZIP} application/zip +${NFVO_VNFD_PLAIN} 1 +${NFVO_VNFD_ZIP} 0 +${vnfPkgPlainVNFD} c26ad7fb-072b-48c4-a663-7d71646d9e98 # The VNF Pakcage contains a VNFD which is a Single Plain File +${vnfPkgZipVNFD} f5b220d4-6177-4ebb-a554-a43311e16075 # The VNF Package contains a VNFD composed by multiple files +${erroneousVnfPkgId} erroneousPkgId +${onboardingStateVnfPkgId} 788106a2-d692-44f3-a86d-384f0ce35e42 # The VNF Package is in CREATED onboardingState diff --git a/SOL005/VNFPackageManagement-API/jsons/CreateVnfPkgInfoRequest.json b/SOL005/VNFPackageManagement-API/jsons/CreateVnfPkgInfoRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..87845130d948be72f8a555f69621c222129a3857 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/CreateVnfPkgInfoRequest.json @@ -0,0 +1,3 @@ +{ + "userDefinedData": {} +} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/PkgmSubscription.json b/SOL005/VNFPackageManagement-API/jsons/PkgmSubscription.json new file mode 100644 index 0000000000000000000000000000000000000000..c01e92b484e9305f89fbd1a54db3d69ea514695c --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/PkgmSubscription.json @@ -0,0 +1,414 @@ +[ + { + "id": "ABCDEFGHIJKL", + "callbackUri": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "_links": { + "self": { + "href": "ABCDEFGHIJKLMNOPQR" + } + }, + "filter": { + "notificationTypes": [ + "VnfPackageChangeNotification" + ], + "vnfProductsFromProviders": [ + { + "vnfProvider": "ABCDEFGHIJKLMNOPQRSTUVW", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGHIJKLMNOPQRSTUVWX", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQ", + "ABCDE" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + ] + } + ] + }, + { + "vnfProductName": "ABCDEFGHIJKLM", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMN", + "vnfdVersions": [ + "ABCDEF", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "vnfdVersions": [ + "ABCDEFGHIJKLMNO", + "ABCDEFGH", + "ABCDEF" + ] + }, + { + "vnfSoftwareVersion": "ABCD", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXY", + "ABCDEFGHIJ", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRST", + "vnfdVersions": [ + "ABCDEFG", + "ABCDEFGHIJKLMNOPQRSTU" + ] + } + ] + } + ] + }, + { + "vnfProvider": "ABCDEF", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGH", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRST", + "vnfdVersions": [ + "ABCDE", + "ABCDE", + "ABCDEFGHIJKLMNOPQR" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWX", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOP" + ] + } + ] + }, + { + "vnfProductName": "ABCDE", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNO", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJ", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRS" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJK", + "vnfdVersions": [ + "ABCD" + ] + }, + { + "vnfSoftwareVersion": "ABCD", + "vnfdVersions": [ + "ABCDEFGHIJKL", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + ] + } + ] + }, + { + "vnfProductName": "ABCD", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRST", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQ", + "ABCDEFGHIJKL" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXY", + "vnfdVersions": [ + "ABCDEF", + "ABCDEFGHIJKLMNOPQRST" + ] + }, + { + "vnfSoftwareVersion": "ABCDEF", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKLMNOPQR", + "ABCDEFGHIJKLMNOP" + ] + } + ] + } + ] + } + ], + "vnfdId": [ + "ABCDEFGHIJKLMNOPQRS", + "ABCDEFGHIJKLMNO", + "ABCDEFGHIJKLM", + "ABCDEFGHIJK" + ], + "vnfPkgId": [ + "ABCDEFGH", + "ABCDEFGHIJKLMNOPQ", + "ABCDE", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + ], + "operationalState": "DISABLED", + "usageState": {} + } + }, + { + "id": "ABCDE", + "callbackUri": "ABCDEFGHIJKLM", + "_links": { + "self": { + "href": "ABCDEFGHIJKLMNOPQRSTU" + } + }, + "filter": { + "notificationTypes": [ + "VnfPackageOnboardingNotification", + "VnfPackageOnboardingNotification", + "VnfPackageOnboardingNotification" + ], + "vnfProductsFromProviders": [ + { + "vnfProvider": "ABCDEFGH", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGHIJKLMNOPQRSTUV", + "versions": [ + { + "vnfSoftwareVersion": "ABCD", + "vnfdVersions": [ + "ABCDEFGHIJKLMN", + "ABCDEFGHIJKLMNOPQRSTUVW", + "ABCDE", + "ABCDEFGHIJKLMNOPQRS" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRS" + ] + } + ] + }, + { + "vnfProductName": "ABCDEFGHIJKLMN", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOP", + "vnfdVersions": [ + "ABCDEFGHIJ", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQR" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMN", + "vnfdVersions": [ + "ABCDEFGHIJKLMNO", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "ABCDEFGHIJKLMNOPQRSTUVW" + ] + }, + { + "vnfSoftwareVersion": "ABCDEF", + "vnfdVersions": [ + "ABCDEFGHIJKLM", + "ABCDE", + "ABCDEFGHIJKLMNOPQRSTUVWXYZA" + ] + } + ] + } + ] + }, + { + "vnfProvider": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGHIJKLMNOPQ", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXY", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQ", + "ABCDE" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMN", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + ] + } + ] + }, + { + "vnfProductName": "ABCDEFGHIJKLMNOP", + "versions": [ + { + "vnfSoftwareVersion": "ABCD", + "vnfdVersions": [ + "ABCDEFGH", + "ABCDEFGHIJKLMN", + "ABCDEFGHIJKLMNOP" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLM", + "vnfdVersions": [ + "ABCDEFGHIJKLM", + "ABCDEFGH" + ] + } + ] + } + ] + } + ], + "vnfdId": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKLM", + "ABCDEFGHIJKLMNOPQRS", + "ABCDEFGHIJKL" + ], + "vnfPkgId": [ + "ABCDEFGHIJKLMNOPQRSTUVWXY" + ], + "operationalState": "DISABLED", + "usageState": {} + } + }, + { + "id": "ABCDEF", + "callbackUri": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "_links": { + "self": { + "href": "ABCDEFGHIJKLMNOPQ" + } + }, + "filter": { + "notificationTypes": [ + "VnfPackageChangeNotification", + "VnfPackageOnboardingNotification", + "VnfPackageChangeNotification", + "VnfPackageOnboardingNotification" + ], + "vnfProductsFromProviders": [ + { + "vnfProvider": "ABCDEFGHIJKL", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGHIJK", + "versions": [ + { + "vnfSoftwareVersion": "ABCDE", + "vnfdVersions": [ + "ABCDEFGHI", + "ABCDEFGHIJKLMNOPQRS", + "ABCDEFGHIJKLMNOPQR" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWX", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFG", + "ABCDEFGHIJKLMNOPQRSTUVW", + "ABCDEFGHIJKLMNOPQRSTUVWXY" + ] + } + ] + } + ] + }, + { + "vnfProvider": "ABCDEFGHI", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGHIJ", + "versions": [ + { + "vnfSoftwareVersion": "ABCDEFGHIJKL", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKL", + "ABCDEFGHIJKLMNOPQR" + ] + }, + { + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQ", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKLMNOPQRSTU", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKLMN" + ] + } + ] + } + ] + }, + { + "vnfProvider": "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "vnfProducts": [ + { + "vnfProductName": "ABCDEFGH", + "versions": [ + { + "vnfSoftwareVersion": "ABCDE", + "vnfdVersions": [ + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "ABCDEFGHIJKLMNOPQRS", + "ABCDEFGHIJKLMNOPQRST" + ] + } + ] + } + ] + } + ], + "vnfdId": [ + "ABCDEFGHIJKLMNOP", + "ABCDEFGHIJKLMNOPQRSTUVWXYZA" + ], + "vnfPkgId": [ + "ABCDEFGHIJKLMNOPQRSTUVW", + "ABCDEFGHIJKLMNOPQ", + "ABCDEFGHIJKLMN" + ], + "operationalState": "ENABLED", + "usageState": [ + 773, + [ + {}, + [ + false, + true + ], + null, + null + ] + ] + } + } +] \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json b/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..f76054e5fa6e0350cc2cafcff459bff2a88daab4 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json @@ -0,0 +1,3 @@ +{ +"addressInformation": "http://localhost/content.zip" +} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/VnfPkgInfoModifications.json b/SOL005/VNFPackageManagement-API/jsons/VnfPkgInfoModifications.json new file mode 100644 index 0000000000000000000000000000000000000000..68757b0d3d63aa869b7e09d9d4d3761e29cafc88 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/VnfPkgInfoModifications.json @@ -0,0 +1,4 @@ +{ + "userDefinedData":{}, + "operationalState": "ENABLED" +} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/VnfPkgInfoModificationsDisabled.json b/SOL005/VNFPackageManagement-API/jsons/VnfPkgInfoModificationsDisabled.json new file mode 100644 index 0000000000000000000000000000000000000000..74e8fefff5ddd7eac3f9fffdaf41f167a5ca55a1 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/VnfPkgInfoModificationsDisabled.json @@ -0,0 +1,4 @@ +{ + "userDefinedData":{}, + "operationalState": "DISABLED" +} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/subscriptions.json b/SOL005/VNFPackageManagement-API/jsons/subscriptions.json new file mode 100644 index 0000000000000000000000000000000000000000..d0dd3eef2fe24f66b653a095d29c96e73396b71e --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/subscriptions.json @@ -0,0 +1,6 @@ +{ + "callbackUri": "http://127.0.0.1/subscribe", + "filter": { + "vnfPkgId": "788106a2-d692-44f3-a86d-384f0ce35e42" + } +} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/vnfPkgInfos.json b/SOL005/VNFPackageManagement-API/jsons/vnfPkgInfos.json new file mode 100644 index 0000000000000000000000000000000000000000..6edb798574dfecb44fc884debed874576c1569ec --- /dev/null +++ b/SOL005/VNFPackageManagement-API/jsons/vnfPkgInfos.json @@ -0,0 +1,313 @@ +[ + { + "id": "ABCDEFGHIJKL", + "operationalState": "ENABLED", + "usageState": {}, + "_links": { + "self": { + "href": "ABCDEFGHIJKLMNOPQR" + }, + "packageContent": { + "href": "ABCDEFGHI" + }, + "vnfd": { + "href": "ABCDEFGHIJKLMNOPQRSTUVWXYZA" + } + }, + "vnfdId": "ABCD", + "vnfProvider": "ABCDEFGHIJKLMNOPQRS", + "vnfProductName": "ABCDEFGHIJKLMNOPQRS", + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWX", + "vnfdVersion": "ABCDEFGHIJK", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "hash": "ABCDEFGHIJKLMN" + }, + "softwareImages": [ + { + "id": "ABCDEFGHIJKLMNO", + "name": "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "provider": "ABCDE", + "version": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "checksum": { + "algorithm": "ABCDEFGHIJKLM", + "hash": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + }, + "containerFormat": "AMI", + "diskFormat": "QCOW2", + "createdAt": "ABCDEFGHIJKLMNOP", + "minDisk": -14, + "minRam": 836, + "size": 698, + "imagePath": "ABCDEFGHIJKLMNOPQRSTUVWX", + "userMetadata": {} + }, + { + "id": "ABCDEFGHIJKLMNOPQRSTUV", + "name": "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "provider": "ABCDEFGHIJK", + "version": "ABCD", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOP", + "hash": "ABCDEFGHIJKLMNOP" + }, + "containerFormat": "AMI", + "diskFormat": "VHDX", + "createdAt": "ABCDEFGHIJKLMNOPQRSTUVW", + "minDisk": 82, + "minRam": 460, + "size": 51, + "imagePath": "ABCDEFGHI", + "userMetadata": {} + }, + { + "id": "ABCDEFGHIJK", + "name": "ABCDEFGHIJKLMNOPQRST", + "provider": "ABCDEFGHIJKLMN", + "version": "ABCDEFGHI", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRST", + "hash": "ABCDEFGHIJKLMNOPQRSTUVWX" + }, + "containerFormat": "AKI", + "diskFormat": "VMDK", + "createdAt": "ABCDEFGHIJKLMNOPQRS", + "minDisk": 821, + "minRam": 358, + "size": 589, + "imagePath": "ABCDEFGHIJ", + "userMetadata": {} + } + ], + "additionalArtifacts": [ + { + "artifactPath": "ABCDEFG", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQ", + "hash": "ABCDEFGHIJKLMNO" + }, + "metadata": {} + }, + { + "artifactPath": "ABCDEFGHIJ", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTU", + "hash": "ABCDEFGHIJKLMNO" + }, + "metadata": {} + }, + { + "artifactPath": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "checksum": { + "algorithm": "ABCD", + "hash": "ABCDEFGHIJKLMNOPQ" + }, + "metadata": {} + } + ], + "onboardingState": "CREATED", + "userDefinedData": {} + }, + { + "id": "ABCDEFGHIJKLMNOPQRS", + "operationalState": "DISABLED", + "usageState": 215, + "_links": { + "self": { + "href": "ABCDEFGHIJKLMNOPQRSTU" + }, + "packageContent": { + "href": "ABCDEFGHIJKLMNO" + }, + "vnfd": { + "href": "ABCDEF" + } + }, + "vnfdId": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "vnfProvider": "ABCDEFGHIJKLMNOPQRST", + "vnfProductName": "ABCDEFGHIJKLMNOPQRST", + "vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZAB", + "vnfdVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "checksum": { + "algorithm": "ABCDEFGHIJKLM", + "hash": "ABCDEFGHIJKLMNOPQRSTUVWXYZAB" + }, + "softwareImages": [ + { + "id": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "name": "ABCDEFGHIJKLMNOPQRSTU", + "provider": "ABCD", + "version": "ABCDEFGHIJKLMNOP", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNO", + "hash": "ABCDEFGHIJKLM" + }, + "containerFormat": "DOCKER", + "diskFormat": "QCOW2", + "createdAt": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "minDisk": -98, + "minRam": 204, + "size": 587, + "imagePath": "ABCDEF", + "userMetadata": {} + }, + { + "id": "ABCDE", + "name": "ABCDEFG", + "provider": "ABCDEFGH", + "version": "ABCDEFGHIJKLMNOPQRSTU", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUV", + "hash": "ABCDEFGHIJKLMNOPQRSTUVW" + }, + "containerFormat": "DOCKER", + "diskFormat": "AKI", + "createdAt": "ABCDEFGHIJKLMNOP", + "minDisk": 87, + "minRam": 216, + "size": 262, + "imagePath": "ABCDEFGHIJK", + "userMetadata": {} + }, + { + "id": "ABCD", + "name": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "provider": "ABCDEFGHIJKLMN", + "version": "ABCDEFGHIJKLMNOPQRSTUVW", + "checksum": { + "algorithm": "ABCDEFG", + "hash": "ABCDEFGHIJKLMNOPQRST" + }, + "containerFormat": "AKI", + "diskFormat": "QCOW2", + "createdAt": "ABCDEFGHIJK", + "minDisk": 821, + "minRam": 335, + "size": 698, + "imagePath": "ABCDEFGHIJKLMNOPQRST", + "userMetadata": {} + }, + { + "id": "ABCDEFG", + "name": "ABCDEFGHIJKLMNOPQRSTUVW", + "provider": "ABCDEFGHIJKLMNOPQR", + "version": "ABCDEFGHIJKLMNOPQRS", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUVW", + "hash": "ABCDEFGHIJ" + }, + "containerFormat": "DOCKER", + "diskFormat": "QCOW2", + "createdAt": "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "minDisk": 709, + "minRam": 243, + "size": 351, + "imagePath": "ABCDEFG", + "userMetadata": {} + } + ], + "additionalArtifacts": [ + { + "artifactPath": "ABCDEFGHIJKLMNOPQRSTUVWXYZA", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC", + "hash": "ABCDEFGHIJKLMN" + }, + "metadata": {} + }, + { + "artifactPath": "ABCDEFGHIJKLMNOPQRSTU", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUV", + "hash": "ABCDEFGHIJKLM" + }, + "metadata": {} + } + ], + "onboardingState": "PROCESSING", + "userDefinedData": {} + }, + { + "id": "ABCDE", + "operationalState": "ENABLED", + "usageState": 712, + "_links": { + "self": { + "href": "ABCDEFGHIJKLMNOPQRSTUVWX" + }, + "packageContent": { + "href": "ABCDEFGHIJKLMNOPQRSTUVWXYZA" + }, + "vnfd": { + "href": "ABCDEFGHIJKLMNOPQRS" + } + }, + "vnfdId": "ABCDE", + "vnfProvider": "ABCD", + "vnfProductName": "ABCDEFGHIJKLMNOPQRSTUV", + "vnfSoftwareVersion": "ABCDEFGH", + "vnfdVersion": "ABCDEFGHIJKLMN", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQR", + "hash": "ABCDEFGHIJKLM" + }, + "softwareImages": [ + { + "id": "ABCDEFGHIJKLM", + "name": "ABCDEFGHIJKLM", + "provider": "ABCDEFGHIJKLMNOPQRSTUVWXYZAB", + "version": "ABCDEFGHIJKLM", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNO", + "hash": "ABCDEFGHIJKLMNOPQRSTUVWXYZAB" + }, + "containerFormat": "OVA", + "diskFormat": "AKI", + "createdAt": "ABCDEFGHIJKLMNOPQRSTUVWXY", + "minDisk": 803, + "minRam": 888, + "size": 479, + "imagePath": "ABCDEFGH", + "userMetadata": {} + }, + { + "id": "ABCD", + "name": "ABCDEFGH", + "provider": "ABCDEFGHIJKL", + "version": "ABCDEFGHIJKL", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUV", + "hash": "ABCDEFGH" + }, + "containerFormat": "OVA", + "diskFormat": "AKI", + "createdAt": "ABCDEF", + "minDisk": 816, + "minRam": 366, + "size": 806, + "imagePath": "ABCDEFGHI", + "userMetadata": {} + } + ], + "additionalArtifacts": [ + { + "artifactPath": "ABCDEFGHIJKLMNOPQR", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUVWX", + "hash": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC" + }, + "metadata": {} + }, + { + "artifactPath": "ABCDEFGHIJKLMNOPQRSTUVW", + "checksum": { + "algorithm": "ABCDEFGHIJKLMNOPQRSTUVW", + "hash": "ABCDEFGHIJKLMNOPQRSTUVWXY" + }, + "metadata": {} + } + ], + "onboardingState": "CREATED", + "userDefinedData": {} + } +] \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json b/SOL005/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..5cf4045fa21b0955b8579801e4ab4e02e234047a --- /dev/null +++ b/SOL005/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json @@ -0,0 +1,97 @@ +{ + "description": "This type represents a VNF package management notification, which informs the receiver of a change of the status in an on-boarded VNF package. Only changes in the \"operationalState\" attribute of an on-boarded VNF package and the deletion NF package will be reported. Changes in the \"usageState\" and \"onboardingState\" attributes are not reported. The notification shall be triggered by the NFVO when there is a change in the status of an onboarded VNF package, as follows: * The \"operationalState\" attribute of a VNF package has changed, and the\n \"onboardingState\" attribute of the package has the value \"ONBOARDED\"\n (i.e. the package has been onboarded previously).\n* The on-boarded VNF package has been deleted.\n", + "type": "object", + "required": [ + "id", + "notificationType", + "timeStamp", + "vnfPkgId", + "vnfdId", + "changeType", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "notificationType": { + "description": "Discriminator for the different notification types. Shall be set to \"VnfPackageChangeNotification\" for this notification type.\n", + "type": "string", + "enum": [ + "VnfPackageChangeNotification" + ] + }, + "subscriptionId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "timeStamp": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "vnfPkgId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "vnfdId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "changeType": { + "description": "- OP_STATE_CHANGE: The \"operationalState\" attribute has been changed. - PKG_DELETE: The VNF package has been deleted.\n", + "type": "string", + "enum": [ + "OP_STATE_CHANGE", + "PKG_DELETE" + ] + }, + "operationalState": { + "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for\n instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for\n further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n", + "type": "string", + "enum": [ + "ENABLED", + "DISABLED" + ] + }, + "_links": { + "description": "This type represents the links to resources that a VNF package management notification can contain.\n", + "type": "object", + "required": [ + "vnfPackage", + "subscription" + ], + "properties": { + "vnfPackage": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "subscription": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json b/SOL005/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..903f0bf44cf71f37dadf14ac873ff028bf971a38 --- /dev/null +++ b/SOL005/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json @@ -0,0 +1,80 @@ +{ + "description": "This type represents a VNF package management notification, which informs the receiver that the onboarding process of a VNF package is complete and the package is ready for use. The notification shall be triggered by the NFVO when the \"onboardingState\" attribute of a new VNF package has changed to \"ONBOARDED\".", + "type": "object", + "required": [ + "id", + "notificationType", + "timeStamp", + "vnfPkgId", + "vnfdId", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "notificationType": { + "description": "Discriminator for the different notification types. Shall be set to \"VnfPackageOnboardingNotification\" for this notification type.\n", + "type": "string", + "enum": [ + "VnfPackageOnboardingNotification" + ] + }, + "subscriptionId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "timeStamp": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "vnfPkgId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "vnfdId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "_links": { + "description": "This type represents the links to resources that a VNF package management notification can contain.\n", + "type": "object", + "required": [ + "vnfPackage", + "subscription" + ], + "properties": { + "vnfPackage": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "subscription": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/IndividualPmJob.robot b/SOL005/VNFPerformanceManagement-API/IndividualPmJob.robot new file mode 100644 index 0000000000000000000000000000000000000000..00c0445d72dd581032f40f16948df16c88186e06 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/IndividualPmJob.robot @@ -0,0 +1,76 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library JSONLibrary +Resource environment/IndividualPmJob.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Individual PM 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJob.schema.json ${json} + Log Validation OK + +GET Individual PM Job - Negative (Not Found) + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Individual PM Job + Log Trying to delete an existing PM Job + 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 + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Individual PM Job - (Method not implemented) + Log Trying to perform a POST (method should not be implemented) + 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 + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + 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 + 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 diff --git a/SOL005/VNFPerformanceManagement-API/IndividualReport.robot b/SOL005/VNFPerformanceManagement-API/IndividualReport.robot new file mode 100644 index 0000000000000000000000000000000000000000..38e9da21127a866ca770f10171bfd1e1bf0c3a4c --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/IndividualReport.robot @@ -0,0 +1,61 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Resource environment/reports.txt +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} + +*** Test Cases *** +GET Report on Single PM Job + [Documentation] The client can use this resource to read the performance report. + ... The URI of this report can be obtained from a PerformanceInformationAvailableNotification + ... (see clause 7.5.2.5) or from the representation of the "Individual PM job" resource + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PerformanceReport.schema.json ${json} + +GET Report on Single PM Job - Negative (Not Found) + [Documentation] The client can use this resource to read the performance report. + ... The URI of this report can be obtained from a PerformanceInformationAvailableNotification + ... (see clause 7.5.2.5) or from the representation of the "Individual PM job" resource + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Reports - (Method not implemented) + 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 + +PUT Reports - (Method not implemented) + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + 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) + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Reports - (Method not implemented) + 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 diff --git a/SOL005/VNFPerformanceManagement-API/IndividualSubscription.robot b/SOL005/VNFPerformanceManagement-API/IndividualSubscription.robot new file mode 100644 index 0000000000000000000000000000000000000000..2c6d9faed7da257305e8f43f27f730183f5074a5 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/IndividualSubscription.robot @@ -0,0 +1,82 @@ +*** Settings *** +Documentation This resource represents an individual subscription for notifications about performance management related events. +... The client can use this resource to read and to terminate a subscription to notifications related to NS performance +... management. +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem +Library JSONLibrary +Resource environment/individualSubscription.txt + +*** Test Cases *** +GET Individual Subscription + [Documentation] The client can use this method for reading an individual subscription about Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.8.3.2-1 and 6.4.8.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscription.schema.json ${json} + Log Validated PmSubscription schema + +GET Individual Subscription - Negative (Not Found) + [Documentation] The client can use this method for reading an individual subscription about Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the tables 6.4.8.3.2-1 and 6.4.8.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + Integer response status 404 + Log Received a 404 Not found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validated ProblemDetails schema + +POST Individual Subscription - (Method not implemented) + [Documentation] This method is not supported. When this method is requested on this resource, the NFVO 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}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PUT Individual Subscription - (Method not implemented) + [Documentation] This method is not supported. When this method is requested on this resource, the NFVO 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}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Individual Subscription - (Method not implemented) + [Documentation] This method is not supported. When this method is requested on this resource, the NFVO 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}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Individual Subscription + [Documentation] This method terminates an individual subscription. + ... This method shall follow the provisions specified in the tables 6.4.8.3.5-1 and 6.4.8.3.5-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 204 + Log Received a 204 No Content as expected + ${body}= Output response body + Should Be Empty ${body} + Log Body of the response is empty diff --git a/SOL005/VNFPerformanceManagement-API/IndividualThreshold.robot b/SOL005/VNFPerformanceManagement-API/IndividualThreshold.robot new file mode 100644 index 0000000000000000000000000000000000000000..717d143d6a5bbb4228201f9173de4aaf3228b375 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/IndividualThreshold.robot @@ -0,0 +1,70 @@ +*** Settings *** +Documentation This resource represents an individual threshold. +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem +Resource environment/individualThresholds.txt + +*** Test Cases *** +GET Individual Threshold + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with thresholds schema + Validate Json Threshold.schema.json ${json} + +GET Individual Threshold - Negative (Not Found) + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +DELETE Individual Threshold + 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) + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with ProblemDetails schema + Validate Json ProblemDetails.schema.json ${json} + +POST Individual Threshold - (Method not implemented) + 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 + +PUT Individual Threshold - (Method not implemented) + 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 + +PATCH Individual Threshold - (Method not implemented) + 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 diff --git a/SOL005/VNFPerformanceManagement-API/Notifications.robot b/SOL005/VNFPerformanceManagement-API/Notifications.robot new file mode 100644 index 0000000000000000000000000000000000000000..711bca03f7850e5fbec1525b8f17e3b7f2da57e0 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/Notifications.robot @@ -0,0 +1,117 @@ +*** Setting *** +Resource environment/notifications.txt +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Library MockServerLibrary +Library Process +Library OperatingSystem +Library BuiltIn +Library Collections +Library String + + +*** Test Cases *** +Check Notification Endpoint + &{req}= Create Mock Request Matcher GET ${callback_endpoint} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Verify Mock Expectation ${req} + Clear Requests ${callback_endpoint} + +Post Performance Information Available Notification + ${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Performance Information Available Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post Performance Information Available Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Performance Information Available Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + +Post Threshold Crossed Notification + ${json}= Get File schema/ThresholdCrossedNotification.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handle Threshold Crossed Notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +Post Threshold Crossed Notification Negative 404 + ${json}= Get File schemas/ProblemDetails.schema.json + ${BODY}= evaluate json.loads('''${json}''') json + Log Creating mock request and response to handleThreshold Crossed Notification to handle 404 error + &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PUT Performance Notification + Log PUT Method not implemented + &{req}= Create Mock Request Matcher PUT ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +PATCH Performance Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +DELETE Performance Notification + Log PATCH Method not implemented + &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} + &{rsp}= Create Mock Response status_code=405 + Create Mock Expectation ${req} ${rsp} + Sleep ${sleep_interval} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/PMJobs.robot b/SOL005/VNFPerformanceManagement-API/PMJobs.robot new file mode 100644 index 0000000000000000000000000000000000000000..9269c1d7606de6f7cf9919f49201dc4b485f3aee --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/PMJobs.robot @@ -0,0 +1,202 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library JSONLibrary +Library OperatingSystem +Resource environment/pmJobs.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library MockServerLibrary + +*** Test Cases *** +GET all Pm 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Checking that reports element is missing + ${reports}= Get Value From Json ${json} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +GET all Pm Jobs - 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + +GET all Pm Jobs - all_fields + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${json} $..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 ${json} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + Log Validating _links schema + ${links}= Get Value From Json ${json} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET all Pm Jobs - exclude_default + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Checking that reports element is missing + ${reports}= Get Value From Json ${json} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +GET all Pm Jobs - fields + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${json} $..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 ${json} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + +GET all Pm Jobs - exclude_fields + 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJobs.schema.json ${json} + Log Validation OK + Log Checking that reports element is missing + ${reports}= Get Value From Json ${json} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + Log Checking that criteria element is missing + ${criteria}= Get Value From Json ${json} $..criteria + Should Be Empty ${criteria} + Log Criteria element is empty as expected + +GET all Pm Jobs - Negative (wronge filter name) + 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 headers Content-Type + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +GET all Pm Jobs (Negative: Not found) + 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 headers Content-Type + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST all PM Jobs - Create new PM 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 + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJob.schema.json ${json} + Log Validation OK + +PUT all PM Jobs - (Method not implemented) + 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 + +PATCH all Pm Jobs - (Method not implemented) + Log Trying to perform a PATCH. 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 + +DELETE all Pm Jobs - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + 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 diff --git a/SOL005/VNFPerformanceManagement-API/Subscriptions.robot b/SOL005/VNFPerformanceManagement-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..52622658eacb040962cbdd872fe6f29f2da5447c --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/Subscriptions.robot @@ -0,0 +1,184 @@ +*** Settings *** +Documentation This resource represents subscriptions. The client can use this resource to subscribe to notifications related to VNF +... performance management and to query its subscriptions. +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Library OperatingSystem +Library JSONLibrary +Resource environment/subscriptions.txt + +*** Test Cases *** +GET Subscription + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the Tables 7.4.7.3.2-1 and 7.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscriptions.schema.json ${json} + Log Validated PmSubscription schema + +GET Subscription - Filter + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the Tables 7.4.7.3.2-1 and 7.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscriptions.schema.json ${json} + Log Validated PmSubscription schema + +GET Subscription - Negative Filter (Erroneous filter) + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the Tables 7.4.7.3.2-1 and 7.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ko} + Integer response status 400 + Log Received a 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validated ProblemDetails schema + +GET Subscription - Negative (Not Found) + [Documentation] The client can use this method to query the list of active subscriptions to Performance management notifications + ... subscribed by the client. + ... This method shall follow the provisions specified in the Tables 7.4.7.3.2-1 and 7.4.7.3.2-2 for URI query parameters, + ... request and response data structures, and response codes. + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscription + Integer response status 404 + Log Received a 404 Not found as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validated ProblemDetails schema + +POST Subscription + [Documentation] The POST method creates a new subscription + ... This method shall follow the provisions specified in the Tables 7.4.7.3.1-1 and 7.4.7.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance + ... degradation and will provide duplicates of notifications to the OSS, and might make sense only in very rare use cases. + ... Consequently, the NFVO may either allow creating a subscription resource if another subscription resource with the + ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide + ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing + ... the existing subscription resource with the same filter and callbackUri). + Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body_request}= Get File jsons/subscriptions.json + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + Integer response status 201 + Log Received a 201 Created as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscription.schema.json ${json} + Log Validated PmSubscription schema + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +POST Subscription - DUPLICATION + [Documentation] The POST method creates a new subscription + ... This method shall follow the provisions specified in the Tables 7.4.7.3.1-1 and 7.4.7.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance + ... degradation and will provide duplicates of notifications to the OSS, and might make sense only in very rare use cases. + ... Consequently, the NFVO may either allow creating a subscription resource if another subscription resource with the + ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide + ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing + ... the existing subscription resource with the same filter and callbackUri). + Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test + Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body_request}= Get File jsons/subscriptions.json + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + Integer response status 303 + Log Received a 303 See other as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + Should Be Empty ${result} + Log Body is empty + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +POST Subscription - NO DUPLICATION + [Documentation] The POST method creates a new subscription + ... This method shall follow the provisions specified in the Tables 7.4.7.3.1-1 and 7.4.7.3.1-2 for URI query parameters, + ... request and response data structures, and response codes. + ... Creation of two subscription resources with the same callbackURI and the same filter can result in performance + ... degradation and will provide duplicates of notifications to the OSS, and might make sense only in very rare use cases. + ... Consequently, the NFVO may either allow creating a subscription resource if another subscription resource with the + ... same filter and callbackUri already exists (in which case it shall return the "201 Created" response code), or may decide + ... to not create a duplicate subscription resource (in which case it shall return a "303 See Other" response code referencing + ... the existing subscription resource with the same filter and callbackUri). + Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test + Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body_request}= Get File jsons/subscriptions.json + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + Integer response status 201 + Log Received a 201 Created as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmSubscription.schema.json ${json} + Log Validated PmSubscription schema + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +PUT Subscription - (Method not implemented) + [Documentation] This method is not supported. When this method is requested on this resource, the NFVO 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}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +PATCH Subscription - (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}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected + +DELETE Subscription - (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}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 + Log Received 405 Method not implemented as expected diff --git a/SOL005/VNFPerformanceManagement-API/Thresholds.robot b/SOL005/VNFPerformanceManagement-API/Thresholds.robot new file mode 100644 index 0000000000000000000000000000000000000000..71a8066976b2801dc9b9fd1d95841c0838ffc78d --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/Thresholds.robot @@ -0,0 +1,91 @@ +*** Settings *** +Documentation This resource represents thresholds. The client can use this resource to create and query thresholds. +Library JSONSchemaLibrary schemas/ +Resource environment/generic.txt # Generic Parameters +Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} +Resource environment/thresholds.txt +Library OperatingSystem + +*** Test Cases *** +GET Thresholds + [Documentation] T=This resource represents thresholds. + ... The client can use this resource to create and query thresholds. + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with thresholds schema + Validate Json Thresholds.schema.json ${json} + +GET Thresholds - Filter + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with Threshold schema + Validate Json Thresholds.schema.json ${json} + +GET Thresholds - NEGATIVE Filter + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with ProblemDetails schema + Validate Json ProblemDetails.schema.json ${json} + +GET Thresholds - Negative (Not Found) + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 + ${json}= evaluate json.loads('''${problemDetails}''') json + Log Trying to validate ProblemDetails + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK + +POST Reports + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${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 + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with thresholds schema + Validate Json Threshold.schema.json ${json} + Log Trying to validate the Location header + ${headers}= Output response headers + Should Contain ${headers} Location + +PUT Reports - (Method not implemented) + 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 + +PATCH Reports - (Method not implemented) + 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 + +DELETE Reports - (Method not implemented) + 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 diff --git a/SOL005/VNFPerformanceManagement-API/environment/IndividualPmJob.txt b/SOL005/VNFPerformanceManagement-API/environment/IndividualPmJob.txt new file mode 100644 index 0000000000000000000000000000000000000000..a7823e6bdc74dcb53733685df04b18221ca94825 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/IndividualPmJob.txt @@ -0,0 +1,3 @@ +*** Variables *** +${pmJobId} 29f4ff6a-be91-4ec8-856e-fcf1e2479e4e +${erroneousPmJobId} erroneousPmJobId diff --git a/SOL003/VNFPerformanceManagement-API/environment/generic.txt b/SOL005/VNFPerformanceManagement-API/environment/generic.txt similarity index 96% rename from SOL003/VNFPerformanceManagement-API/environment/generic.txt rename to SOL005/VNFPerformanceManagement-API/environment/generic.txt index 9500d28156988e46ac963353a1acebaeb05d48af..66638f2fef4b15eebd046edaa1230a9af0f818dd 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/generic.txt +++ b/SOL005/VNFPerformanceManagement-API/environment/generic.txt @@ -1,19 +1,21 @@ -*** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 -${CONTENT_TYPE_JSON} application/json -${ACCEPT_JSON} application/json -${apiRoot} / -${AUTH_USAGE} 1 -${NEG_AUTHORIZATION} Bearer negativetoken -${apiVersion} v1 -${apiName} vnfpm -${FIELD_USAGE} 1 -${VNFM_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 -${VNFM_AUTH_USAGE} 1 -${VNFM_DUPLICATION} 1 +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${VNFM_SCHEMA} https +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${CONTENT_TYPE_JSON} application/json +${ACCEPT_JSON} application/json +${apiRoot} / +${AUTH_USAGE} 1 +${NEG_AUTHORIZATION} Bearer negativetoken +${apiVersion} v1 +${apiName} vnfpm +${FIELD_USAGE} 1 +${VNFM_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 +${VNFM_AUTH_USAGE} 1 +${VNFM_DUPLICATION} 1 +${NFVO_DUPLICATION} 1 + diff --git a/SOL005/VNFPerformanceManagement-API/environment/individualSubscription.txt b/SOL005/VNFPerformanceManagement-API/environment/individualSubscription.txt new file mode 100644 index 0000000000000000000000000000000000000000..f5aa4ba97ae98059b6818f2979637edd03dc0aaf --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/individualSubscription.txt @@ -0,0 +1,3 @@ +*** Variables *** +${subscriptionId} 17563e75-0e14-4bd7-94b4-6bbb869c79aa +${erroneousSubscriptionId} erroneousSubscriptionId diff --git a/SOL005/VNFPerformanceManagement-API/environment/individualThresholds.txt b/SOL005/VNFPerformanceManagement-API/environment/individualThresholds.txt new file mode 100644 index 0000000000000000000000000000000000000000..59056904c4a8e6cd41f3f8fa494030b97e6c4ed1 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/individualThresholds.txt @@ -0,0 +1,3 @@ +*** Variables *** +${thresholdId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a +${erroneousThresholdId} erroneousThresholdId diff --git a/SOL005/VNFPerformanceManagement-API/environment/notifications.txt b/SOL005/VNFPerformanceManagement-API/environment/notifications.txt new file mode 100644 index 0000000000000000000000000000000000000000..12a19817c09edfcaefe04a105a62e1a95995bd3a --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/notifications.txt @@ -0,0 +1,6 @@ +*** Variables *** +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s diff --git a/SOL005/VNFPerformanceManagement-API/environment/pmJobs.txt b/SOL005/VNFPerformanceManagement-API/environment/pmJobs.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee57a30913f39f012ca6687895264a8e75e27eb7 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/pmJobs.txt @@ -0,0 +1,4 @@ +*** Variables *** +${POS_FILTER} objectInstanceIds=1f50d68b-82e8-4deb-bd40-c934d4d1ac0a +${NEG_FILTER} criteriaPmJob=erroneousAttributeName +${fields} criteria,objectInstanceIds diff --git a/SOL005/VNFPerformanceManagement-API/environment/reports.txt b/SOL005/VNFPerformanceManagement-API/environment/reports.txt new file mode 100644 index 0000000000000000000000000000000000000000..7edfcc5cee327d26b1565e7d4a753a5731c12858 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/reports.txt @@ -0,0 +1,4 @@ +*** Variables *** +${pmJobId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a +${reportId} 0fb4c875-e07f-46ca-a9dd-13907667a568 +${erroneousReportId} erroneousReportId diff --git a/SOL005/VNFPerformanceManagement-API/environment/subscriptions.txt b/SOL005/VNFPerformanceManagement-API/environment/subscriptions.txt new file mode 100644 index 0000000000000000000000000000000000000000..fec8c84b57f2f27c991fda4ae7b5b640f7159289 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/subscriptions.txt @@ -0,0 +1,3 @@ +*** Variables *** +${filter_ok} callbackUri=http://localhost/subscriptions +${filter_ko} erroneousFilter=erroneous diff --git a/SOL005/VNFPerformanceManagement-API/environment/thresholds.txt b/SOL005/VNFPerformanceManagement-API/environment/thresholds.txt new file mode 100644 index 0000000000000000000000000000000000000000..49461a0953bcdd310d7a8ddabc78efea1b4d946f --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/environment/thresholds.txt @@ -0,0 +1,3 @@ +*** Variables *** +${FILTER_OK} objectInstanceId=1f50d68b-82e8-4deb-bd40-c934d4d1ac0a +${FILTER_KO} criterias=erroneousFilter diff --git a/SOL005/VNFPerformanceManagement-API/jsons/CreatePmJobRequest.json b/SOL005/VNFPerformanceManagement-API/jsons/CreatePmJobRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..1872a3bc9bc8ea93a54f0da4ab665f0564c727e1 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/jsons/CreatePmJobRequest.json @@ -0,0 +1,10 @@ +{ + "objectInstanceIds" : ["1f50d68b-82e8-4deb-bd40-c934d4d1ac0a"], + "criteria" : { + "performanceMetric": [], + "performanceMetricGroup": [], + "collectionPeriod": 10, + "reportingPeriod": 30, + + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/jsons/CreateThresholdRequest.json b/SOL005/VNFPerformanceManagement-API/jsons/CreateThresholdRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..1e58c2bac513f36d37597e8f11bbe06d68b664cc --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/jsons/CreateThresholdRequest.json @@ -0,0 +1,12 @@ +{ + "objectInstanceIds" : "1f50d68b-82e8-4deb-bd40-c934d4d1ac0a", + "criteria" : { + "performanceMetric": "cpu_util", + "thresholdType": "SIMPLE", + "simpleThresholdDetails": { + "thresholdValue": 10, + "hysteresis": 50 + } + + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/jsons/PerformanceInformationAvailableNotification.json b/SOL005/VNFPerformanceManagement-API/jsons/PerformanceInformationAvailableNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..cbe45fa78eb1068c0153b95e2ac7a74b90231019 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/jsons/PerformanceInformationAvailableNotification.json @@ -0,0 +1,13 @@ +{ + "id": "id", + "notificationType" : "PerformanceInformationAvailableNotification", + "subscriptionId ": "subscriptionId", + "timeStamp": "2012-04-21T18:25:43-05:00", + "objectInstanceId": "vnfID", + "_links": { + "subscription": "link to subscription", + "pmJob" : "link to PMJob", + "performanceReport": "link to PerformanceReport" + } + +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/jsons/ThresholdCrossedNotification.json b/SOL005/VNFPerformanceManagement-API/jsons/ThresholdCrossedNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..23ee9e24cda8498a1a4a9fa4f3cd283c9378c1ee --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/jsons/ThresholdCrossedNotification.json @@ -0,0 +1,16 @@ +{ + "id": "id", + "notificationType" : "ThresholdCrossedNotification", + "subscriptionId ": "subscriptionId", + "timeStamp": "2012-04-21T18:25:43-05:00", + "thresholdId": "thresholdId", + "crossingDirection": "UP", + "objectInstanceId": "vnfID", + "performanceMetric": "performanceMetric", + "performanceValue": 7 + "_links": { + "subscription": "link to subscription", + "threshold": "link to threshold" + } + +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/jsons/subscriptions.json b/SOL005/VNFPerformanceManagement-API/jsons/subscriptions.json new file mode 100644 index 0000000000000000000000000000000000000000..3fcc4e59bcbcc09b0e5355a1557d439378f1520b --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/jsons/subscriptions.json @@ -0,0 +1,6 @@ +{ + "callbackUri": "http://127.0.0.1/subscribe", + "filter": { + "notificationTypes": ["ThresholdCrossedNotification"] + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/PerformanceInformationAvailableNotification.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/PerformanceInformationAvailableNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..04ae7ead49cbd6f5840c13492612774825d0fb24 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/PerformanceInformationAvailableNotification.schema.json @@ -0,0 +1,105 @@ +{ + "description": "This notification informs the receiver that performance information is available. The timing of sending this notification is determined by the capability of the producing entity to evaluate the threshold crossing condition. The notification shall be triggered by the VNFM when new performance information collected by a PM job is available.\n", + "type": "object", + "required": [ + "id", + "notificationType", + "subscriptionId", + "timeStamp", + "objectInstanceId", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "notificationType": { + "description": "Discriminator for the different notification types. Shall be set to \"PerformanceInformationAvailableNotification\" for this notification type.\n", + "type": "string", + "enum": [ + "PerformanceInformationAvailableNotification" + ] + }, + "subscriptionId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "timeStamp": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "objectInstanceId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "_links": { + "description": "Links to resources related to this notification.\n", + "type": "object", + "required": [ + "subscription", + "pmJob", + "performanceReport" + ], + "properties": { + "subscription": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "objectInstance": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "pmJob": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "performanceReport": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } + } \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/PerformanceReport.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/PerformanceReport.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..c0a9c444eb6cf2ac6e2a8b8800cccc857683a336 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/PerformanceReport.schema.json @@ -0,0 +1 @@ +{ "description": "This type defines the format of a performance report provided by the VNFM to the NFVO as a result of collecting performance information as part of a PM job.\n", "type": "object", "properties": { "entries": { "description": "List of performance information entries. Each performance report entry is for a given metric of a given object (i.e. VNF instance), but can include multiple collected values.\n", "type": "array", "items": { "type": "object", "required": [ "objectType", "objectInstanceId", "performanceMetric", "performanceValue" ], "properties": { "objectType": { "description": "Defines the object type for which performance information is reported (i.e. VNF type). The string value shall be set to the vnfdId of the VNF instance to which the performance information relates.\n", "type": "string" }, "objectInstanceId": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" }, "performanceMetric": { "description": "Name of the metric collected.\n", "type": "string" }, "performanceValues": { "description": "List of performance values with associated timestamp.\n", "type": "array", "items": { "type": "object", "required": [ "timeStamp", "performanceValue" ], "properties": { "timeStamp": { "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", "type": "string", "format": "date-time" }, "value": { "description": "Value of the metric collected. The type of the \"value\" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures / Objects)) is assumed to be defined in the external measurement specification (see ETSI GS NFV-IFA 027).\n", "type": "object" } } } } } } } }} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/PmJob.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/PmJob.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..65121412dcdc18bd63c0b3ddf837a3da8073a8d7 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/PmJob.schema.json @@ -0,0 +1 @@ +{ "description": "This type represents a PM job.\n", "type": "object", "required": [ "id", "objectInstanceIds", "criteria" ], "properties": { "id": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" }, "objectInstanceIds": { "description": "Identifiers of the VNF instances for which performance information is collected.\n", "type": "array", "items": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" } }, "criteria": { "description": "Criteria of the collection of performance information.\n", "type": "object", "required": [ "collectionPeriod", "reportingPeriod" ], "properties": { "performanceMetric": { "description": "This defines the types of performance metrics for the specified object instances, as specified in ETSI GS NFV-IFA 027). At least one of the two attributes (performance metric or group) shall be present.\n", "type": "array", "items": { "type": "string" } }, "performanceMetricGroup": { "description": "Group of performance metrics. A metric group is a pre-defined list of metrics, known to the producer that it can decompose to individual metrics. At least one of the two attributes (performance metric or group) shall be present.\n", "type": "array", "items": { "type": "string" } }, "collectionPeriod": { "description": "Specifies the periodicity at which the producer will collect performance information. The unit shall be seconds. At the end of each reportingPeriod, the producer will inform the consumer about availability of the performance data collected for each completed collection period during this reportingPeriod. The reportingPeriod should be equal to or a multiple of the collectionPeriod. In the latter case, the performance data for the collection periods within one reporting period are reported together.\n", "type": "integer" }, "reportingPeriod": { "description": "Specifies the periodicity at which the producer will report to the consumer. about performance information. The unit shall be seconds. At the end of each reportingPeriod, the producer will inform the consumer about availability of the performance data collected for each completed collection period during this reportingPeriod. The reportingPeriod should be equal to or a multiple of the collectionPeriod. In the latter case, the performance data for the collection periods within one reporting period are reported together.\n", "type": "integer" }, "reportingBoundary": { "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", "type": "string", "format": "date-time" } } }, "reports": { "description": "Information about available reports collected by this PM job.\n", "type": "object", "required": [ "href", "readyTime", "_links" ], "properties": { "href": { "description": "The Uri where the report can be obtained.\n", "type": "string", "format": "url" }, "readyTime": { "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", "type": "string", "format": "date-time" }, "expiryTime": { "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", "type": "string", "format": "date-time" }, "fileSize": { "description": "The size of the report file in bytes, if known.\n", "type": "integer" }, "_links": { "description": "Links for this resource.\n", "type": "object", "required": [ "self" ], "properties": { "self": { "description": "This type represents a link to a resource.\n", "type": "object", "required": [ "href" ], "properties": { "href": { "description": "URI of the referenced resource.\n", "type": "string", "format": "url" } } }, "objects": { "description": "Links to resources representing the VNF instances for which performance information is collected. Shall be present if the VNF instance information is accessible as a resource.\n", "type": "array", "items": { "description": "This type represents a link to a resource.\n", "type": "object", "required": [ "href" ], "properties": { "href": { "description": "URI of the referenced resource.\n", "type": "string", "format": "url" } } } } } } } } }} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/PmJobs.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/PmJobs.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..654acdcf1f41f72b24464e32472a944bbf422120 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/PmJobs.schema.json @@ -0,0 +1,134 @@ +{ + "type": "array", + "items": { + "description": "This type represents a PM job.\n", + "type": "object", + "required": [ + "id", + "objectInstanceIds", + "criteria" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "objectInstanceIds": { + "description": "Identifiers of the VNF instances for which performance information is collected.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "criteria": { + "description": "Criteria of the collection of performance information.\n", + "type": "object", + "required": [ + "collectionPeriod", + "reportingPeriod" + ], + "properties": { + "performanceMetric": { + "description": "This defines the types of performance metrics for the specified object instances, as specified in ETSI GS NFV-IFA 027). At least one of the two attributes (performance metric or group) shall be present.\n", + "type": "array", + "items": { + "type": "string" + } + }, + "performanceMetricGroup": { + "description": "Group of performance metrics. A metric group is a pre-defined list of metrics, known to the producer that it can decompose to individual metrics. At least one of the two attributes (performance metric or group) shall be present.\n", + "type": "array", + "items": { + "type": "string" + } + }, + "collectionPeriod": { + "description": "Specifies the periodicity at which the producer will collect performance information. The unit shall be seconds. At the end of each reportingPeriod, the producer will inform the consumer about availability of the performance data collected for each completed collection period during this reportingPeriod. The reportingPeriod should be equal to or a multiple of the collectionPeriod. In the latter case, the performance data for the collection periods within one reporting period are reported together.\n", + "type": "integer" + }, + "reportingPeriod": { + "description": "Specifies the periodicity at which the producer will report to the consumer. about performance information. The unit shall be seconds. At the end of each reportingPeriod, the producer will inform the consumer about availability of the performance data collected for each completed collection period during this reportingPeriod. The reportingPeriod should be equal to or a multiple of the collectionPeriod. In the latter case, the performance data for the collection periods within one reporting period are reported together.\n", + "type": "integer" + }, + "reportingBoundary": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + } + } + }, + "reports": { + "description": "Information about available reports collected by this PM job.\n", + "type": "object", + "required": [ + "href", + "readyTime", + "_links" + ], + "properties": { + "href": { + "description": "The Uri where the report can be obtained.\n", + "type": "string", + "format": "url" + }, + "readyTime": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "expiryTime": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "fileSize": { + "description": "The size of the report file in bytes, if known.\n", + "type": "integer" + }, + "_links": { + "description": "Links for this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "objects": { + "description": "Links to resources representing the VNF instances for which performance information is collected. Shall be present if the VNF instance information is accessible as a resource.\n", + "type": "array", + "items": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/PmSubscription.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/PmSubscription.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..c9ad051300e0cec9e32546538ee611baba45e53e --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/PmSubscription.schema.json @@ -0,0 +1,142 @@ +{ + "description": "This type represents a subscription.\n", + "type": "object", + "required": [ + "id", + "callbackUri", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "filter": { + "description": "This type represents a filter that can be used to subscribe for notifications related to performance management events.\n", + "type": "object", + "properties": { + "vnfInstanceSubscriptionFilter": { + "description": "This type represents subscription filter criteria to match VNF instances.\n", + "type": "object", + "properties": { + "vnfdIds": { + "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "vnfProductsFromProviders": { + "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "type": "object", + "required": [ + "vnfProvider" + ], + "properties": { + "vnfProvider": { + "description": "Name of the VNF provider to match.\n", + "type": "string" + }, + "vnfProducts": { + "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n", + "type": "array", + "items": { + "type": "object", + "required": [ + "vnfProductName" + ], + "properties": { + "vnfProductName": { + "description": "Name of the VNF product to match.\n", + "type": "string" + }, + "versions": { + "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n", + "type": "array", + "items": { + "type": "object", + "required": [ + "vnfSoftwareVersion" + ], + "properties": { + "vnfSoftwareVersion": { + "description": "A version.\n", + "type": "string" + }, + "vnfdVersions": { + "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n", + "type": "array", + "items": { + "description": "A version.\n", + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "vnfInstanceIds": { + "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "vnfInstanceNames": { + "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "notificationTypes": { + "description": "Match particular notification types. Permitted values: * ThresholdCrossedNotification * PerformanceInformationAvailableNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n", + "type": "string", + "enum": [ + "ThresholdCrossedNotification", + "PerformanceInformationAvailableNotification" + ] + } + } + }, + "callbackUri": { + "description": "The URI of the endpoint to send the notification to.\n", + "type": "string", + "format": "url" + }, + "_links": { + "description": "Links to resources related to this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/PmSubscriptions.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/PmSubscriptions.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..fefb142da9f905120ff32246f73e6b88062978d5 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/PmSubscriptions.schema.json @@ -0,0 +1 @@ +{ "type": "array", "items": { "description": "This type represents a subscription.\n", "type": "object", "required": [ "id", "callbackUri", "_links" ], "properties": { "id": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" }, "filter": { "description": "This type represents a filter that can be used to subscribe for notifications related to performance management events.\n", "type": "object", "properties": { "vnfInstanceSubscriptionFilter": { "description": "This type represents subscription filter criteria to match VNF instances.\n", "type": "object", "properties": { "vnfdIds": { "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" } }, "vnfProductsFromProviders": { "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "type": "object", "required": [ "vnfProvider" ], "properties": { "vnfProvider": { "description": "Name of the VNF provider to match.\n", "type": "string" }, "vnfProducts": { "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n", "type": "array", "items": { "type": "object", "required": [ "vnfProductName" ], "properties": { "vnfProductName": { "description": "Name of the VNF product to match.\n", "type": "string" }, "versions": { "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n", "type": "array", "items": { "type": "object", "required": [ "vnfSoftwareVersion" ], "properties": { "vnfSoftwareVersion": { "description": "A version.\n", "type": "string" }, "vnfdVersions": { "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n", "type": "array", "items": { "description": "A version.\n", "type": "string" } } } } } } } } } } }, "vnfInstanceIds": { "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" } }, "vnfInstanceNames": { "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "type": "string" } } } }, "notificationTypes": { "description": "Match particular notification types. Permitted values: * ThresholdCrossedNotification * PerformanceInformationAvailableNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n", "type": "string", "enum": [ "ThresholdCrossedNotification", "PerformanceInformationAvailableNotification" ] } } }, "callbackUri": { "description": "The URI of the endpoint to send the notification to.\n", "type": "string", "format": "url" }, "_links": { "description": "Links to resources related to this resource.\n", "type": "object", "required": [ "self" ], "properties": { "self": { "description": "This type represents a link to a resource.\n", "type": "object", "required": [ "href" ], "properties": { "href": { "description": "URI of the referenced resource.\n", "type": "string", "format": "url" } } } } } } }} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/ProblemDetails.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..2af3ef9b3f8c0e1dc6bfa39a818ba45e63ca223c --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/ProblemDetails.schema.json @@ -0,0 +1 @@ +{ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", "type": "object", "required": [ "status", "detail" ], "properties": { "type": { "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", "type": "string", "format": "URI" }, "title": { "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n", "type": "string" }, "status": { "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n", "type": "integer" }, "detail": { "description": "A human-readable explanation specific to this occurrence of the problem.\n", "type": "string" }, "instance": { "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", "type": "string", "format": "URI" } }} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/Subscriptions.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/Subscriptions.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..fefb142da9f905120ff32246f73e6b88062978d5 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/Subscriptions.schema.json @@ -0,0 +1 @@ +{ "type": "array", "items": { "description": "This type represents a subscription.\n", "type": "object", "required": [ "id", "callbackUri", "_links" ], "properties": { "id": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" }, "filter": { "description": "This type represents a filter that can be used to subscribe for notifications related to performance management events.\n", "type": "object", "properties": { "vnfInstanceSubscriptionFilter": { "description": "This type represents subscription filter criteria to match VNF instances.\n", "type": "object", "properties": { "vnfdIds": { "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" } }, "vnfProductsFromProviders": { "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "type": "object", "required": [ "vnfProvider" ], "properties": { "vnfProvider": { "description": "Name of the VNF provider to match.\n", "type": "string" }, "vnfProducts": { "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n", "type": "array", "items": { "type": "object", "required": [ "vnfProductName" ], "properties": { "vnfProductName": { "description": "Name of the VNF product to match.\n", "type": "string" }, "versions": { "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n", "type": "array", "items": { "type": "object", "required": [ "vnfSoftwareVersion" ], "properties": { "vnfSoftwareVersion": { "description": "A version.\n", "type": "string" }, "vnfdVersions": { "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n", "type": "array", "items": { "description": "A version.\n", "type": "string" } } } } } } } } } } }, "vnfInstanceIds": { "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "description": "An identifier with the intention of being globally unique.\n", "type": "string" } }, "vnfInstanceNames": { "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n", "type": "array", "items": { "type": "string" } } } }, "notificationTypes": { "description": "Match particular notification types. Permitted values: * ThresholdCrossedNotification * PerformanceInformationAvailableNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n", "type": "string", "enum": [ "ThresholdCrossedNotification", "PerformanceInformationAvailableNotification" ] } } }, "callbackUri": { "description": "The URI of the endpoint to send the notification to.\n", "type": "string", "format": "url" }, "_links": { "description": "Links to resources related to this resource.\n", "type": "object", "required": [ "self" ], "properties": { "self": { "description": "This type represents a link to a resource.\n", "type": "object", "required": [ "href" ], "properties": { "href": { "description": "URI of the referenced resource.\n", "type": "string", "format": "url" } } } } } } }} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/Threshold.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/Threshold.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..d3138727464e922b3a29c7a564406a68e16c869d --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/Threshold.schema.json @@ -0,0 +1,85 @@ +{ + "description": "This type represents a threshold.\n", + "type": "object", + "required": [ + "id", + "objectInstanceId", + "criteria", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "objectInstanceId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "criteria": { + "description": "This type represents criteria that define a threshold.\n", + "type": "object", + "required": [ + "performanceMetric", + "thresholdType" + ], + "properties": { + "performanceMetric": { + "description": "Defines the performance metric associated with the threshold, as specified in ETSI GS NFV-IFA 027).\n", + "type": "string" + }, + "thresholdType": { + "description": "Type of threshold. This attribute determines which other attributes are present in the data structure. Permitted values: * SIMPLE: Single-valued static threshold In the present document, simple thresholds are defined. The definition of additional threshold types is left for future specification.\n", + "type": "string", + "enum": [ + "SIMPLE" + ] + }, + "simpleThresholdDetails": { + "description": "Details of a simple threshold. Shall be present if thresholdType=\"SIMPLE\".\n", + "type": "object", + "required": [ + "thresholdValue", + "hysteresis" + ], + "properties": { + "thresholdValue": { + "description": "The threshold value. Shall be represented as a floating point number.\n", + "type": "integer" + }, + "hysteresis": { + "description": "The hysteresis of the threshold. Shall be represented as a non-negative floating point number. A notification with crossing direction \"UP\" will be generated if the measured value reaches or exceeds \"thresholdValue\" + \"hysteresis\". A notification with crossing direction \"DOWN\" will be generated if the measured value reaches or undercuts \"thresholdValue\" - \"hysteresis\". The hysteresis is defined to prevent storms of threshold crossing notifications. When processing a request to create a threshold, implementations should enforce a suitable minimum value for this attribute (e.g. override the value or reject the request).\n", + "type": "integer" + } + } + } + } + }, + "_links": { + "description": "Links for this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "object": { + "description": "Link to a resource representing the VNF instance for which performance information is collected. Shall be present if the VNF instance information is accessible as a resource.\n" + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/ThresholdCrossedNotification.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/ThresholdCrossedNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..e5cec2303f1bcfcfdb9df5affc9fc0767cd8a2c8 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/ThresholdCrossedNotification.schema.json @@ -0,0 +1,113 @@ +{ + "description": "This type represents a notification that is sent when a threshold has been crossed. The notification shall be triggered by the VNFM when a threshold has been crossed.\n", + "type": "object", + "required": [ + "id", + "notificationType", + "subscriptionId", + "timeStamp", + "thresholdId", + "crossingDirection", + "objectInstanceId", + "performanceMetric", + "performanceValue", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "notificationType": { + "description": "Discriminator for the different notification types. Shall be set to \"ThresholdCrossedNotification\" for this notification type.\n", + "type": "string", + "enum": [ + "ThresholdCrossedNotification" + ] + }, + "subscriptionId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "timeStamp": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "thresholdId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "crossingDirection": { + "type": "string", + "enum": [ + "UP", + "DOWN" + ] + }, + "objectInstanceId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "performanceMetric": { + "description": "Performance metric associated with the threshold.\n", + "type": "string" + }, + "performanceValue": { + "description": "Value of the metric that resulted in threshold crossing. The type of the \"performanceValue\" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures / Objects)) is assumed to be defined in the external measurement specification (see ETSI GS NFV-IFA 027).\n", + "type": "object" + }, + "_links": { + "description": "Links to resources related to this notification.\n", + "type": "object", + "required": [ + "subscription", + "threshold" + ], + "properties": { + "subscription": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "objectInstance": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "threshold": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } + } + } \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/Thresholds.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/Thresholds.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..42ba2c0b089f920bf2a6dbfd87791b1fbefecd7f --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/Thresholds.schema.json @@ -0,0 +1,88 @@ +{ + "type": "array", + "items": { + "description": "This type represents a threshold.\n", + "type": "object", + "required": [ + "id", + "objectInstanceId", + "criteria", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "objectInstanceId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "criteria": { + "description": "This type represents criteria that define a threshold.\n", + "type": "object", + "required": [ + "performanceMetric", + "thresholdType" + ], + "properties": { + "performanceMetric": { + "description": "Defines the performance metric associated with the threshold, as specified in ETSI GS NFV-IFA 027).\n", + "type": "string" + }, + "thresholdType": { + "description": "Type of threshold. This attribute determines which other attributes are present in the data structure. Permitted values: * SIMPLE: Single-valued static threshold In the present document, simple thresholds are defined. The definition of additional threshold types is left for future specification.\n", + "type": "string", + "enum": [ + "SIMPLE" + ] + }, + "simpleThresholdDetails": { + "description": "Details of a simple threshold. Shall be present if thresholdType=\"SIMPLE\".\n", + "type": "object", + "required": [ + "thresholdValue", + "hysteresis" + ], + "properties": { + "thresholdValue": { + "description": "The threshold value. Shall be represented as a floating point number.\n", + "type": "integer" + }, + "hysteresis": { + "description": "The hysteresis of the threshold. Shall be represented as a non-negative floating point number. A notification with crossing direction \"UP\" will be generated if the measured value reaches or exceeds \"thresholdValue\" + \"hysteresis\". A notification with crossing direction \"DOWN\" will be generated if the measured value reaches or undercuts \"thresholdValue\" - \"hysteresis\". The hysteresis is defined to prevent storms of threshold crossing notifications. When processing a request to create a threshold, implementations should enforce a suitable minimum value for this attribute (e.g. override the value or reject the request).\n", + "type": "integer" + } + } + } + } + }, + "_links": { + "description": "Links for this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "object": { + "description": "Link to a resource representing the VNF instance for which performance information is collected. Shall be present if the VNF instance information is accessible as a resource.\n" + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/criteria.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/criteria.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..319d15f53d4d49980a3c4c451bc82efd983abf36 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/criteria.schema.json @@ -0,0 +1,34 @@ +{ + "description": "Criteria of the collection of performance information.\n", + "type": "object", + "required": ["collectionPeriod", "reportingPeriod"], + "properties": { + "performanceMetric": { + "description": "This defines the types of performance metrics for the specified object instances, as specified in ETSI GS NFV-IFA 027). At least one of the two attributes (performance metric or group) shall be present.\n", + "type": "array", + "items": { + "type": "string" + } + }, + "performanceMetricGroup": { + "description": "Group of performance metrics. A metric group is a pre-defined list of metrics, known to the producer that it can decompose to individual metrics. At least one of the two attributes (performance metric or group) shall be present.\n", + "type": "array", + "items": { + "type": "string" + } + }, + "collectionPeriod": { + "description": "Specifies the periodicity at which the producer will collect performance information. The unit shall be seconds. At the end of each reportingPeriod, the producer will inform the consumer about availability of the performance data collected for each completed collection period during this reportingPeriod. The reportingPeriod should be equal to or a multiple of the collectionPeriod. In the latter case, the performance data for the collection periods within one reporting period are reported together.\n", + "type": "integer" + }, + "reportingPeriod": { + "description": "Specifies the periodicity at which the producer will report to the consumer. about performance information. The unit shall be seconds. At the end of each reportingPeriod, the producer will inform the consumer about availability of the performance data collected for each completed collection period during this reportingPeriod. The reportingPeriod should be equal to or a multiple of the collectionPeriod. In the latter case, the performance data for the collection periods within one reporting period are reported together.\n", + "type": "integer" + }, + "reportingBoundary": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/links.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/links.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..ef262a8c875b5c00bf32d4fd6f279cc4d5965bc9 --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/links.schema.json @@ -0,0 +1,35 @@ +{ + "description": "Links for this resource.\n", + "type": "object", + "required": ["self"], + "properties": { + "self": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": ["href"], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + }, + "objects": { + "description": "Links to resources representing the VNF instances for which performance information is collected. Shall be present if the VNF instance information is accessible as a resource.\n", + "type": "array", + "items": { + "description": "This type represents a link to a resource.\n", + "type": "object", + "required": ["href"], + "properties": { + "href": { + "description": "URI of the referenced resource.\n", + "type": "string", + "format": "url" + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL005/VNFPerformanceManagement-API/schemas/reports.schema.json b/SOL005/VNFPerformanceManagement-API/schemas/reports.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..834ded68723d9a72b3be565e72b71d5ef650e0cc --- /dev/null +++ b/SOL005/VNFPerformanceManagement-API/schemas/reports.schema.json @@ -0,0 +1,26 @@ +{ + "description": "Information about available reports collected by this PM job.\n", + "type": "object", + "required": ["href", "readyTime"], + "properties": { + "href": { + "description": "The Uri where the report can be obtained.\n", + "type": "string", + "format": "url" + }, + "readyTime": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "expiryTime": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "fileSize": { + "description": "The size of the report file in bytes, if known.\n", + "type": "integer" + } + } +} \ No newline at end of file diff --git a/bin/mockserver-netty-5.3.0-jar-with-dependencies.jar b/bin/mockserver-netty-5.5.0-jar-with-dependencies.jar similarity index 72% rename from bin/mockserver-netty-5.3.0-jar-with-dependencies.jar rename to bin/mockserver-netty-5.5.0-jar-with-dependencies.jar index dee8db17f5c80d380af706c6559d040200764fe9..454a14ad613b90be678ca9906c4a84aba9d5c2d7 100644 Binary files a/bin/mockserver-netty-5.3.0-jar-with-dependencies.jar and b/bin/mockserver-netty-5.5.0-jar-with-dependencies.jar differ diff --git a/extensions/__old__mockserverlibrary.patch b/extensions/__old__mockserverlibrary.patch new file mode 100644 index 0000000000000000000000000000000000000000..117fee00e3e41c88421fb2cbedd114fd8697378d --- /dev/null +++ b/extensions/__old__mockserverlibrary.patch @@ -0,0 +1,75 @@ +diff --git a/src/MockServerLibrary/library.py b/src/MockServerLibrary/library.py +index a9e6227..7208e61 100644 +--- a/src/MockServerLibrary/library.py ++++ b/src/MockServerLibrary/library.py +@@ -68,6 +68,31 @@ class MockServerLibrary(object): + + return req + ++ def create_mock_request_matcher_schema(self, method, path, body_type='JSON_SCHEMA', body=None): ++ """Creates a mock request matcher to be used by mockserver. ++ ++ Returns the request matcher in a dictionary format. ++ ++ `method` is the HTTP method of the mocked endpoint ++ ++ `path` is the url of the mocked endpoint, e.g. /api ++ ++ `body_type` is the type of the request body, e.g. JSON ++ ++ `body` is a dictionary of the json attribute(s) to match ++ ++ `exact` is a boolean value which specifies whether the body should match fully (=true), ++ or if only specified fields should match (=false) ++ """ ++ req = {} ++ req['method'] = method ++ req['path'] = path ++ ++ req['body'] = {'type': body_type, 'jsonSchema': json.dumps(body)} ++ ++ return req ++ ++ + def create_mock_response(self, status_code, headers=None, body_type='JSON', body=None): + """Creates a mock response to be used by mockserver. + +@@ -97,6 +122,37 @@ class MockServerLibrary(object): + + return rsp + ++ ++ def create_mock_response_schema(self, status_code, headers=None, body_type='JSON_SCHEMA', body=None): ++ """Creates a mock response to be used by mockserver. ++ ++ Returns the response in a dictionary format. ++ ++ `status_code` is the HTTP status code of the response ++ ++ `headers` is a dictionary of headers to be added to the response ++ ++ `body_type` is the type of the response body, e.g. JSON ++ ++ `body` is a dictonary of JSON attribute(s) to be added to the response body ++ """ ++ rsp = {} ++ rsp['statusCode'] = int(status_code) ++ ++ if headers: ++ rsp['headers'] = [] ++ ++ for key, value in headers.items(): ++ header = {'name': key, 'values': value.split(",")} ++ rsp['headers'].append(header) ++ logger.debug("Add header - header: {}".format(header)) ++ ++ if body_type is 'JSON_SCHEMA' and body: ++ rsp['body'] = json.dumps(body) ++ ++ return rsp ++ ++ + def create_mock_expectation(self, request, response, count=1, unlimited=True): + """Creates a mock expectation to be used by mockserver. + + diff --git a/extensions/jsonlibrary.patch b/extensions/jsonlibrary.patch new file mode 100644 index 0000000000000000000000000000000000000000..39d454a3d184ba70a3ddb3cf7130d3ebf7b0ab09 --- /dev/null +++ b/extensions/jsonlibrary.patch @@ -0,0 +1,59 @@ +diff --git a/JSONLibrary/JSONLibraryKeywords.py b/JSONLibrary/JSONLibraryKeywords.py +index 6ceb6e1..20bfd45 100644 +--- a/JSONLibrary/JSONLibraryKeywords.py ++++ b/JSONLibrary/JSONLibraryKeywords.py +@@ -1,7 +1,13 @@ + # -*- coding: utf-8 -*- + from robot.api import logger + from robot.api.deco import keyword +-from version import VERSION ++#from version import VERSION ++try: ++ from version import VERSION ++except: ++ from JSONLibrary.version import VERSION ++ ++ + import os.path + import json + from jsonpath_rw import Index, Fields +diff --git a/JSONLibrary/__init__.py b/JSONLibrary/__init__.py +index efc756e..79ad728 100644 +--- a/JSONLibrary/__init__.py ++++ b/JSONLibrary/__init__.py +@@ -1,6 +1,12 @@ + # -*- coding: utf-8 -*- +-from JSONLibraryKeywords import JSONLibraryKeywords +-from version import VERSION ++# from JSONLibraryKeywords import JSONLibraryKeywords ++# from version import VERSION ++try: ++ from JSONLibraryKeywords import JSONLibraryKeywords ++ from version import VERSION ++except: ++ from JSONLibrary.JSONLibraryKeywords import JSONLibraryKeywords ++ from JSONLibrary.version import VERSION + + __author__ = 'Traitanit Huangsri' + __email__ = 'traitanit.hua@gmail.com' +diff --git a/setup.py b/setup.py +index 744e6f5..5082364 100644 +--- a/setup.py ++++ b/setup.py +@@ -2,7 +2,15 @@ + # -*- coding: utf-8 -*- + + from setuptools import setup +-from JSONLibrary.version import VERSION ++# from JSONLibrary.version import VERSION ++ ++ ++# importing this has the unwanted side-effect of importing ++# other required packages that may not be installed yet ++# resulting in an error ++#from JSONLibrary.version import VERSION ++ ++VERSION = '0.2' + + requirements = [ + 'tox', diff --git a/extensions/mockserverlibrary.patch b/extensions/mockserverlibrary.patch index 117fee00e3e41c88421fb2cbedd114fd8697378d..8097a9d0dd924a57b59d40d73513c806415979bf 100644 --- a/extensions/mockserverlibrary.patch +++ b/extensions/mockserverlibrary.patch @@ -1,75 +1,59 @@ diff --git a/src/MockServerLibrary/library.py b/src/MockServerLibrary/library.py -index a9e6227..7208e61 100644 +index a9e6227..7ba1eed 100644 --- a/src/MockServerLibrary/library.py +++ b/src/MockServerLibrary/library.py -@@ -68,6 +68,31 @@ class MockServerLibrary(object): - - return req - -+ def create_mock_request_matcher_schema(self, method, path, body_type='JSON_SCHEMA', body=None): -+ """Creates a mock request matcher to be used by mockserver. -+ -+ Returns the request matcher in a dictionary format. +@@ -66,6 +66,9 @@ class MockServerLibrary(object): + match_type = 'STRICT' if exact else 'ONLY_MATCHING_FIELDS' + req['body'] = {'type': body_type, 'json': json.dumps(body), 'matchType': match_type} + ++ if body_type is 'JSON_SCHEMA' and body: ++ req['body'] = {'type': body_type, 'json': json.dumps(body)} + -+ `method` is the HTTP method of the mocked endpoint + return req + + def create_mock_response(self, status_code, headers=None, body_type='JSON', body=None): +@@ -97,6 +100,42 @@ class MockServerLibrary(object): + + return rsp + ++ def create_mock_http_forward(self, path, delay=1, unit='SECONDS'): ++ """Creates a mock http override forward to be used by mockserver. + -+ `path` is the url of the mocked endpoint, e.g. /api ++ Returns the http forward in a dictionary format. + -+ `body_type` is the type of the request body, e.g. JSON ++ `path` is the new url where to forward the request + -+ `body` is a dictionary of the json attribute(s) to match ++ `delay` is the delay of the forward action + -+ `exact` is a boolean value which specifies whether the body should match fully (=true), -+ or if only specified fields should match (=false) ++ `unit` is the unit of the delay time (default "SECONDS") + """ -+ req = {} -+ req['method'] = method -+ req['path'] = path ++ fwd = {} ++ fwd['httpRequest'] = {'path': path} ++ fwd['delay'] = {'timeUnit': unit, 'value': delay} + -+ req['body'] = {'type': body_type, 'jsonSchema': json.dumps(body)} ++ return fwd + -+ return req -+ -+ - def create_mock_response(self, status_code, headers=None, body_type='JSON', body=None): - """Creates a mock response to be used by mockserver. - -@@ -97,6 +122,37 @@ class MockServerLibrary(object): - - return rsp - -+ -+ def create_mock_response_schema(self, status_code, headers=None, body_type='JSON_SCHEMA', body=None): -+ """Creates a mock response to be used by mockserver. -+ -+ Returns the response in a dictionary format. ++ def create_mock_expectation_with_http_forward(self, request, forward, count=1, unlimited=True): ++ """Creates a mock expectation with request and forward action to be used by mockserver. + -+ `status_code` is the HTTP status code of the response ++ `request` is a mock request matcher in a dictionary format. + -+ `headers` is a dictionary of headers to be added to the response ++ `forward` is a mock forward in a dictionary format. + -+ `body_type` is the type of the response body, e.g. JSON ++ `count` is the number of expected requests + -+ `body` is a dictonary of JSON attribute(s) to be added to the response body ++ `unlimited` is a boolean value which, if enabled, allows unspecified number of ++ requests to reply to + """ -+ rsp = {} -+ rsp['statusCode'] = int(status_code) -+ -+ if headers: -+ rsp['headers'] = [] -+ -+ for key, value in headers.items(): -+ header = {'name': key, 'values': value.split(",")} -+ rsp['headers'].append(header) -+ logger.debug("Add header - header: {}".format(header)) -+ -+ if body_type is 'JSON_SCHEMA' and body: -+ rsp['body'] = json.dumps(body) -+ -+ return rsp ++ data = {} ++ data['httpRequest'] = request ++ data['httpOverrideForwardedRequest'] = forward ++ data['times'] = {'remainingTimes': int(count), 'unlimited': unlimited} + ++ self.create_mock_expectation_with_data(data) + def create_mock_expectation(self, request, response, count=1, unlimited=True): """Creates a mock expectation to be used by mockserver. - + +