diff --git a/SOL011/NSInstanceUsageNotification-API/ApiVersion.robot b/SOL011/NSInstanceUsageNotification-API/ApiVersion.robot new file mode 100644 index 0000000000000000000000000000000000000000..35b99e089299337598d74075e6a2b5dbaf046bc9 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/ApiVersion.robot @@ -0,0 +1,213 @@ +*** Settings *** + +Resource environment/variables.txt + +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST API Version - Method not implemented + [Documentation] Test ID: 9.3.4.5.1 + ... Test title: POST API version - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version + [Documentation] Test ID: 9.3.4.5.2 + ... Test title: GET API Version + ... Test objective: The objective is to test that GET method successfully return ApiVersionInformation + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version - Method not implemented + [Documentation] Test ID: 9.3.4.5.3 + ... Test title: PUT API Version - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version - Method not implemented + [Documentation] Test ID: 9.3.4.5.4 + ... Test title: PATCH API Version - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version - Method not implemented + [Documentation] Test ID: 9.3.4.5.5 + ... Test title: DELETE API Version - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +POST API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.4.5.6 + ... Test title: POST API version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version with apiMajorVerion + [Documentation] Test ID: 9.3.4.5.7 + ... Test title: GET API Version with apiMajorVerion + ... Test objective: The objective is to test that GET method successfully return ApiVersionInformation + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.4.5.8 + ... Test title: PUT API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.4.5.9 + ... Test title: PATCH API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.4.5.10 + ... Test title: DELETE API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +*** Keywords *** +POST API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/IndividualSubscription.robot b/SOL011/NSInstanceUsageNotification-API/IndividualSubscription.robot new file mode 100644 index 0000000000000000000000000000000000000000..5f8fa000becc15716272f6b138cb0a18b3599624 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/IndividualSubscription.robot @@ -0,0 +1,83 @@ +*** Settings *** +Resource environment/variables.txt +Resource NSInstanceUsageNotificationKeywords.robot +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST Individual Subscription - Method not implemented + [Documentation] Test ID: 9.3.4.2.1 + ... Test title: POST Individual Subscription - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 8.5.4.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST Individual Subscription + Check HTTP Response Status Code Is 405 + +GET Information about an individual subscription - Successful + [Documentation] Test ID: 9.3.4.2.2 + ... Test title: GET Information about an individual subscription - Successful + ... Test objective: The objective is to test the retrieval of NS instance usage notification subscription and perform a JSON schema validation of the returned subscription data structure + ... Pre-conditions: An NS instance is instantiated. At least one NS instance usage notification subscription is available in the NFVO. + ... Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual subscription + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscription + +PUT an individual subscription - Method not implemented + [Documentation] Test ID: 9.3.4.2.3 + ... Test title: PUT an individual subscription - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 8.5.4.3.3 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT Individual Subscription + Check HTTP Response Status Code Is 405 + +PATCH an individual subscription - Method not implemented + [Documentation] Test ID: 9.3.4.2.4 + ... Test title: PATCH an individual subscription - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 8.5.4.3.4 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH Individual Subscription + Check HTTP Response Status Code Is 405 + +DELETE an individual subscription + [Documentation] Test ID: 9.3.4.2.5 + ... Test title: DELETE an individual subscription + ... Test objective: The objective is to test that DELETE method deletes an individual subscription + ... Pre-conditions: At least one instance usage notification subscription is available in the NFVO + ... Reference: Clause 8.5.4.3.5 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: The NS instance usage notification subscription is not available anymore on NFVO + DELETE Individual Subscription + Check HTTP Response Status Code Is 204 + Check Postcondition Individual Subscription is Deleted + +GET Information about an individual subscription - NOT FOUND + [Documentation] Test ID: 9.3.4.2.6 + ... Test title: GET Information about an individual subscription - NOT FOUND + ... Test objective: The objective is to test that the retrieval of individual NS instance usage notification subscription fails when using an invalid resource identifier. + ... Pre-conditions: An NS instance is instantiated. At least one NS instance usage notification subscription is available in the NFVO. + ... Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual subscription + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/NSInstanceUsageNotificationKeywords.robot b/SOL011/NSInstanceUsageNotification-API/NSInstanceUsageNotificationKeywords.robot new file mode 100644 index 0000000000000000000000000000000000000000..dd61944508300ffba05861441ca4999557f5f02b --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/NSInstanceUsageNotificationKeywords.robot @@ -0,0 +1,262 @@ +*** Settings *** +Resource environment/variables.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library String + +*** Keywords *** +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${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 Header Contains Resource URI + ${uri}= Get Value From Json ${response['headers']} $..Location + Should Not Be Empty ${uri} + Log URI is present + +Check subscription existence + 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 + +Check HTTP Response Header Contains Link + ${linkURL}= Get Value From Json ${response['headers']} $..Link + Should Not Be Empty ${linkURL} + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + +POST subscriptions + 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 jsons/NsInstanceUsageSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST subscriptions 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}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/NsInstanceUsageSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST subscriptions NO DUPLICATION + Log Trying to create a subscription with an already created content + Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/NsInstanceUsageSubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +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 + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get subscriptions with all_fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?all_fields + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions with exclude_default attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions with fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions with exclude_fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET subscriptions with 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get subscriptions - invalid filter + 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT subscriptions + 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 + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH subscriptions + 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 + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE subscriptions + 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 + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST Individual Subscription + 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT Individual Subscription + 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH Individual Subscription + 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Individual subscription + log Trying 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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Validate Json response body subscription.schema.json + Set Global Variable ${callbackResp} response body callbackUri + +POST NS Instance Usage Notification + log Trying to perform a POST to deliver notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/NSInstanceUsageNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get subscriptions with exclude_default and fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields}&exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check Postcondition Individual Subscription is Deleted + Log Check Postcondition Subscription is deleted + GET individual Subscription + Check HTTP Response Status Code Is 404 + +Check Postcondition Subscription Is Set + Log Check Postcondition subscription exist + Log Trying to get the subscription + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 200 + +Check Postcondition Subscription Resource Returned in Location Header Is Available + Log Going to check postcondition + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${response['headers']['Location']} + 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 + Validate Json NsdmSubscription.schema.json ${result} + Log Validated NsdmSubscription schema + ${body}= Get File jsons/subscriptions.json + ${subscription}= evaluate json.loads('''${body}''') json + Should Be Equal ${result['callbackUri']} ${subscription['callbackUri']} + Log Validated Issued subscription is same as original + +Check Postcondition Subscriptions Exist + Log Checking that subscriptions exists + Get Subscriptions \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/NotificationConsumer.robot b/SOL011/NSInstanceUsageNotification-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..00985877f88796147667d05655a8af6d56968828 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/NotificationConsumer.robot @@ -0,0 +1,21 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt +Resource NSInstanceUsageNotificationKeywords.robot +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Suite Setup Check resource existence and get CallbackUri + +*** Test Cases *** +NS Instance Usage Notification + [Documentation] Test ID: 9.3.4.4.1 + ... Test title: NS Instance Usage Notification + ... Test objective: The objective is to test that NS Instance Usage Notification is delivered with success to the notification consumer + ... Pre-conditions: A subscription for instance usage notification is available in the NFVO. + ... Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST NS Instance Usage Notification + Check HTTP Response Status Code Is 204 \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/NotificationEndpoint.robot b/SOL011/NSInstanceUsageNotification-API/NotificationEndpoint.robot new file mode 100644 index 0000000000000000000000000000000000000000..311997a7d5161842c3fd455ffc024eb76021ffab --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/NotificationEndpoint.robot @@ -0,0 +1,112 @@ +*** Settings *** +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Resource environment/variables.txt +Library MockServerLibrary +Library Process +Library OperatingSystem +Library Collections + +*** Test Cases *** +NS Instance Usage START Notification + [Documentation] Test ID: 9.3.4.3.1 + ... Test title: NS Instance Usage START Notification + ... Test objective: The objective is to test the dispatch of NS Instance Usage Start Notification when the usage of an NS instance is started, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system. + ... Pre-conditions: A subscription for NS instance usage notification is available in the NFVO. + ... Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger a change in NS instance usage START (external action) + Check NS Instance Usage Start Notification Http POST Request Body Json Schema Is NsInstanceUsageNotification + Check NS Instance Usage Start Notification Http POST Request Body notificationType attribute Is NsInstanceUsageNotification + Check NS Instance Usage Start Notification Http POST Request Body notificationStatus attribute Is START + +NS Instance Usage END Notification + [Documentation] Test ID: 9.3.4.3.2 + ... Test title: NS Instance Usage END Notification + ... Test objective: The objective is to test the dispatch of NS Instance Usage End Notification when the usage of an NS instance is ended, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system. + ... Pre-conditions: A subscription for NS instance usage notification is available in the NFVO. + ... Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger a change in NS instance usage END (external action) + Check NS Instance Usage End Notification Http POST Request Body Json Schema Is NsInstanceUsageNotification + Check NS Instance Usage End Notification Http POST Request Body notificationType attribute Is NsInstanceUsageNotification + Check NS Instance Usage End Notification Http POST Request Body notificationStatus attribute Is END + +*** Keywords *** +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} + +Trigger a change in NS instance usage START (external action) + #do nothing + Log do nothing + +Trigger a change in NS instance usage END (external action) + #do nothing + Log do nothing + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} + +Configure Notification NS Instance Usage Start Handler + [Arguments] ${endpoint} ${type} ${status} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} changeType ${status} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{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 NS Instance Usage End Handler + [Arguments] ${endpoint} ${type} ${status} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} changeType ${status} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{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} + +Check NS Instance Usage Start Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check NS Instance Usage Start Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification NS Instance Usage Start Handler ${callback_endpoint_fwd} ${type} START + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check NS Instance Usage Start Notification Http POST Request Body notificationStatus attribute Is + [Arguments] ${type} + #do nothing + Log do nothing + +Check NS Instance Usage End Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check NS Instance Usage End Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification NS Instance Usage End Handler ${callback_endpoint_fwd} ${type} START + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check NS Instance Usage End Notification Http POST Request Body notificationStatus attribute Is + [Arguments] ${type} + #do nothing + Log do nothing \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/Subscriptions.robot b/SOL011/NSInstanceUsageNotification-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..efde683fa76707e8bc364670e44e5656aa83c93b --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/Subscriptions.robot @@ -0,0 +1,222 @@ +*** Settings *** +Resource environment/variables.txt +Resource NSInstanceUsageNotificationKeywords.robot +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST Create a new subscription + [Documentation] Test ID: 9.3.4.1.1 + ... Test title: POST Create a new subscription + ... Test objective: The objective is to test that POST method creates a subscription + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: Subscription is created in the NFVO + POST subscriptions + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is subscription + Check HTTP Response Header Contains Resource URI + Check Postcondition Subscription Is Set + +POST Create a new Subscription - DUPLICATION + [Documentation] Test ID: 9.3.4.1.2 + ... Test title: POST Create a new subscription - DUPLICATION + ... Test objective: The objective is to test that POST method creates a duplicate subscription + ... Pre-conditions: A subscription shall already exist + ... Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: Duplication supported by NFVO-C + ... Post-Conditions: Duplicate subscription is created in the NFVO + POST subscriptions DUPLICATION + Check Subscription Existence + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is subscription + Check Postcondition Subscription Resource Returned in Location Header Is Available + +POST Create a new Subscription - NO-DUPLICATION + [Documentation] Test ID: 9.3.4.1.3 + ... Test title: POST Create a new subscription - NO-DUPLICATION + ... Test objective: The objective is to test that POST method cannot create a duplicate subscription + ... Pre-conditions: A subscription shall already exist + ... Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: Duplication NOT supported by NFVO-C + ... Post-Conditions: Duplicate subscription is not created in the NFVO + POST subscriptions NO DUPLICATION + Check Subscription Existence + Check HTTP Response Status Code Is 303 + Check HTTP Response Header Contains Location + Check Postcondition Subscription Is Set + +GET Subscriptions + [Documentation] Test ID: 9.3.4.1.4 + ... Test title: GET Subscriptions + ... Test objective: The objective is to test that GET method retrieves the list of existing subscriptions + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Subscriptions + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET Subscription - Filter + [Documentation] Test ID: 9.3.4.1.5 + ... Test title: GET Subscription - Filter + ... Test objective: The objective is GET the list of active subscriptions using a filter + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Subscriptions with filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 9.3.4.1.6 + ... Test title: GET subscriptions - Bad Request Invalid attribute-based filtering parameters + ... Test objective: The objective is GET the list of active subscriptions using an invalid filter + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions - invalid filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET subscriptions - Bad Request Response too Big + [Documentation] Test ID: 9.3.4.1.7 + ... Test title: GET subscriptions - Bad Request Response too Big + ... Test objective: The objective is test that the retrieval of active subscriptions list fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response. + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Subscriptions + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET subscriptions with "all_fields" attribute selector + [Documentation] Test ID: 9.3.4.1.8 + ... Test title: GET subscriptions with "all_fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "all_fields" attribute selector + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions with "exclude_default" attribute selector + [Documentation] Test ID: 9.3.4.1.9 + ... Test title: GET subscriptions with "exclude_default" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default"s attribute selector + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions with "fields" attribute selector + [Documentation] Test ID: 9.3.4.1.10 + ... Test title: GET subscriptions with "fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "fields" attribute selector + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions with "exclude_fields" attribute selector + [Documentation] Test ID: 9.3.4.1.11 + ... Test title: GET subscriptions with "exclude_fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "exclude_fields" attribute selector + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET Subscriptions as Paged Response + [Documentation] Test ID: 9.3.4.1.12 + ... Test title: GET Subscriptions as Paged Response + ... Test objective: The objective is to test that GET method retrieve the list of existing subscriptions as paged response. + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Subscriptions + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains Link + +PUT subscriptions - Method not implemented + [Documentation] Test ID: 9.3.4.1.13 + ... Test title: PUT subscriptions - Method not implemented + ... Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.3 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT subscriptions + Check HTTP Response Status Code Is 405 + +PATCH subscriptions - Method not implemented + [Documentation] Test ID: 9.3.4.1.14 + ... Test title: PATCH subscriptions - Method not implemented + ... Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.4 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH subscriptions + Check HTTP Response Status Code Is 405 + +DELETE subscriptions - Method not implemented + [Documentation] Test ID: 9.3.4.1.15 + ... Test title: DELETE subscriptions - Method not implemented + ... Test objective: The objective is to test that DELETE method cannot delete a NS instance usage subscription + ... Pre-conditions: none + ... Reference: Clause 8.5.3.3.5 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: Subscriptions are not deleted + DELETE subscriptions + Check HTTP Response Status Code Is 405 + Check Postcondition Subscriptions Exist + +GET subscriptions with "exclude_default" and "fields" attribute selector + [Documentation] Test ID: 9.3.4.1.16 + ... Test title: GET subscriptions with "exclude_default" and "fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default" and "fields" attribute selector + ... Pre-conditions: + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with exclude_default and fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/environment/variables.txt b/SOL011/NSInstanceUsageNotification-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..b9ab0f0f18995b8806e00ff9cc34ab6104273955 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/environment/variables.txt @@ -0,0 +1,58 @@ +*** 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 +${CONTENT_TYPE_JSON} application/json +${ACCEPT} application/json +${AUTH_USAGE} 1 +${ACCEPT_JSON} application/json +${apiRoot} / +${apiName} nsiun +${apiVersion} v1 + +${SYNC_MODE} 1 + +${response} {} + +${NFVO_DUPLICATION} 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 +${fields} criteria,objectInstanceIds +${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${notification_ep} notification +${VrQuotaAvailNotification} {} + +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s +${total_polling_time} 2 min +${polling_interval} 10 sec + +${notification_request} [] +${notification_response} [] + +${callbackResp} 127.0.0.1 + +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar diff --git a/SOL011/NSInstanceUsageNotification-API/jsons/NsInstanceUsageNotification.json b/SOL011/NSInstanceUsageNotification-API/jsons/NsInstanceUsageNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..984f3ddd99c1b0f10552cce1f72ede1a8c2a479b --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/jsons/NsInstanceUsageNotification.json @@ -0,0 +1,9 @@ +{{ + "id": "", + "notificationType": "NSInstanceUsageNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "nsInstanceId": "", + "status": "START", + "_links": "" +}} \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/jsons/NsInstanceUsageSubscriptionRequest.json b/SOL011/NSInstanceUsageNotification-API/jsons/NsInstanceUsageSubscriptionRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..b9203519e5f90b3f7761cc9b0fcfecca16931e26 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/jsons/NsInstanceUsageSubscriptionRequest.json @@ -0,0 +1,10 @@ +{ + "filter": { + "nsInstanceUsageNotificationFilter": { + "nsInstanceId": "6fc3539c-e602-4afa-8e13-962fb5a7d81f", + "status": "START" + } + }, + "callbackUri": "http://127.0.0.1/subscribe", + "authentication": "" +} \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/schemas/NsInstanceUsageNotification.schema.json b/SOL011/NSInstanceUsageNotification-API/schemas/NsInstanceUsageNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..4e4df8609f9746e03a3cd09cbf4795eb5da40d61 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/schemas/NsInstanceUsageNotification.schema.json @@ -0,0 +1,43 @@ +{ + "description": "This type represents an NS instance usage notification, which indicates the start or end of usage of an NS instance as a part of a composite NS managed by the NFVO-C. It shall comply with the provisions defined in table 8.6.2.4-1.", + "type": "object", + "required": [ + "id", + "notificationType", + "subscriptionId", + "timeStamp", + "nsInstanceId", + "status", + "_links" + ], + "properties": { + "id": { + "description": "Identifier of this notification. If a notification is sent multiple times due to multiple subscriptions, the \"id\" attribute of all these notifications shall have the same value.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "notificationType": { + "description": "Discriminator for the different notification types. Shall be set to \"NsInstanceUsageNotification\" for this notification type.", + "type": "string" + }, + "subscriptionId": { + "description": "Identifier of the subscription that this notification relates to.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "timeStamp": { + "description": "Date and time of the generation of the notification.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/DateTime" + }, + "nsInstanceId": { + "description": "Identifier of the NS instance affected.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "status": { + "description": "Indicates whether this notification reports about the start of the usage of an NS instance or about the end of the usage of an NS instance.", + "$ref": "#/components/schemas/NsInstanceUsageStatusType" + }, + "_links": { + "description": "Links to resources related to this notification.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/NotificationLink" + } + } +} \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/schemas/ProblemDetails.schema.json b/SOL011/NSInstanceUsageNotification-API/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/schemas/ProblemDetails.schema.json @@ -0,0 +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" + ] +} \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/schemas/subscription.schema.json b/SOL011/NSInstanceUsageNotification-API/schemas/subscription.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..a4154156af765f3e4c492c780545b2012a0c624c --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/schemas/subscription.schema.json @@ -0,0 +1,36 @@ +{ + "description": "This type represents a subscription related to notifications about NS instance usage. It shall comply with the provisions defined in table 8.6.2.3-1.", + "type": "object", + "required": [ + "id", + "callbackUri", + "_links" + ], + "properties": { + "id": { + "description": "Identifier that identifies the subscription.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "filter": { + "description": "Filter settings for this subscription, to define the subset of all notifications this subscription relates to. A particular notification is sent to the subscriber if the filter matches, or if there is no filter.", + "$ref": "#/components/schemas/NsInstanceUsageNotificationsFilter" + }, + "callbackUri": { + "description": "The URI of the endpoint to send the notification to.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Uri" + }, + "_links": { + "description": "Links to resources related to this resource.", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "URI of this resource.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Link" + } + } + } + } +} \ No newline at end of file diff --git a/SOL011/NSInstanceUsageNotification-API/schemas/subscriptions.schema.json b/SOL011/NSInstanceUsageNotification-API/schemas/subscriptions.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..010b50b29ae00e95b73b36c6d9f9b472c2a83bcb --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/schemas/subscriptions.schema.json @@ -0,0 +1,39 @@ +{ + "type": "array", + "items": { + "description": "This type represents a subscription related to notifications about NS instance usage. It shall comply with the provisions defined in table 8.6.2.3-1.", + "type": "object", + "required": [ + "id", + "callbackUri", + "_links" + ], + "properties": { + "id": { + "description": "Identifier that identifies the subscription.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "filter": { + "description": "Filter settings for this subscription, to define the subset of all notifications this subscription relates to. A particular notification is sent to the subscriber if the filter matches, or if there is no filter.", + "$ref": "#/components/schemas/NsInstanceUsageNotificationsFilter" + }, + "callbackUri": { + "description": "The URI of the endpoint to send the notification to.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Uri" + }, + "_links": { + "description": "Links to resources related to this resource.", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "URI of this resource.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Link" + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/ApiVersion.robot b/SOL011/NSLifecycleOperationGranting-API/ApiVersion.robot new file mode 100644 index 0000000000000000000000000000000000000000..501c850e3247ed8e7b3759564f67c12f36093a95 --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/ApiVersion.robot @@ -0,0 +1,213 @@ +*** Settings *** + +Resource environment/variables.txt + +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library DependencyLibrary +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST API Version - Method not implemented + [Documentation] Test ID: 9.3.3.3.1 + ... Test title: POST API version - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version + [Documentation] Test ID: 9.3.3.3.2 + ... Test title: GET API Version + ... Test objective: The objective is to test that GET method successfully return ApiVersionInformation + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version - Method not implemented + [Documentation] Test ID: 9.3.3.3.3 + ... Test title: PUT API Version - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version - Method not implemented + [Documentation] Test ID: 9.3.3.3.4 + ... Test title: PATCH API Version - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version - Method not implemented + [Documentation] Test ID: 9.3.3.3.5 + ... Test title: DELETE API Version - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +POST API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.3.3.6 + ... Test title: POST API version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version with apiMajorVerion + [Documentation] Test ID: 9.3.3.3.7 + ... Test title: GET API Version with apiMajorVerion + ... Test objective: The objective is to test that GET method successfully return ApiVersionInformation + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.3.3.8 + ... Test title: PUT API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.3.3.9 + ... Test title: PATCH API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 9.3.3.3.10 + ... Test title: DELETE API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +*** Keywords *** +POST API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Post ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Put ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Patch ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Delete ${apiRoot}/${apiName}/v1/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/Grants.robot b/SOL011/NSLifecycleOperationGranting-API/Grants.robot new file mode 100644 index 0000000000000000000000000000000000000000..55efdec901ff684cf41cfec7c02ffc834dac2d1b --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/Grants.robot @@ -0,0 +1,85 @@ +*** Settings *** +Resource environment/variables.txt +Resource NSLCOperationGrantingKeywords.robot +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Requests a grant for a particular NS lifecycle operation + [Documentation] Test ID: 9.3.3.1.1 + ... Test title: Requests a grant for a particular NS lifecycle operation + ... Test objective: The objective is to request a grant for a particular NS lifecycle operation and perform a JSON schema validation on the returned grant data structure + ... Pre-conditions: + ... Reference: Clause 7.5.3.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The NFVO can decide immediately what to respond to a grant request + ... Post-Conditions: The grant information is available to the NFVO. + Send Post Request for Grant + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is Grant + Check HTTP Response Header Contains Location + Check Postcondition Grant Is Set + +Requests a grant for a particular NS lifecycle operation - Forbidden + [Documentation] Test ID: 9.3.3.1.2 + ... Test title: Requests a grant for a particular NS lifecycle operation - Forbidden + ... Test objective: The objective is to request a grant for a particular NS lifecycle operation and the grant is rejected + ... Pre-conditions: none + ... Reference: Clause 7.5.3.3.1 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send Request for a new Grant Forbiden Operation + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET Grants - Method not implemented + [Documentation] Test ID: 9.3.3.1.3 + ... Test title: GET Grants - Method not implemented + ... Test objective: The objective is to test that GET method is not allowed for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get Grants + Check HTTP Response Status Code Is 405 + +PUT Grants - Method not implemented + [Documentation] Test ID: 9.3.3.1.4 + ... Test title: PUT Grants - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.3.3.3 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Put Grants + Check HTTP Response Status Code Is 405 + +PATCH Grants - Method not implemented + [Documentation] Test ID: 9.3.3.1.5 + ... Test title: PATCH Grants - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.3.3.4 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Patch Grants + Check HTTP Response Status Code Is 405 + +DELETE Grants - Method not implemented + [Documentation] Test ID: 9.3.3.1.6 + ... Test title: DELETE Grants - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.3.3.5 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: Resources are not deleted + Delete Grants + Check HTTP Response Status Code Is 405 + Check Postcondition Grants Exist \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/IndividualGrant.robot b/SOL011/NSLifecycleOperationGranting-API/IndividualGrant.robot new file mode 100644 index 0000000000000000000000000000000000000000..3b05958c4a452bebf5964309ea41bd2e7c5d1d6d --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/IndividualGrant.robot @@ -0,0 +1,85 @@ +*** Settings *** +Resource environment/variables.txt +Resource NSLCOperationGrantingKeywords.robot +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +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. + +*** Test Cases *** +POST Individual Grant - Method not implemented + [Documentation] Test ID: 9.3.3.2.1 + ... Test title: POST Individual Grant - Method not implemented + ... Test objective: The objective is to test that POST method is not allowed for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.4.3.1 - ETSI GS NFV-SOL 011 [1] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Post individual Grant + Check HTTP Response Status Code Is 405 + +GET an individual grant - Successful + [Documentation] Test ID: 9.3.3.2.2 + ... Test title: GET an individual grant - Successful + ... Test objective: The objective is to retrieve a grant for a particular NS Lifecycle Operation. + ... Pre-conditions: The grant information is available to the NFVO + ... Reference: Clause 7.5.4.3.2 - ETSI GS NFV-SOL 011 [1] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Get individual grant + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Grant + +PUT an individual grant - Method not implemented + [Documentation] Test ID: 9.3.3.2.3 + ... Test title: PUT an individual grant - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.4.3.3 - ETSI GS NFV-SOL 011 [1] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT individual Grant + Check HTTP Response Status Code Is 405 + +PATCH an individual grant - Method not implemented + [Documentation] Test ID: 9.3.3.2.4 + ... Test title: PATCH an individual grant - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.4.3.4 - ETSI GS NFV-SOL 011 [1] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Patch individual Grant + Check HTTP Response Status Code Is 405 + +DELETE an individual grant - Method not implemented + [Documentation] Test ID: 9.3.3.2.5 + ... Test title: DELETE an individual grant - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed to for Lifecycle operation granting + ... Pre-conditions: none + ... Reference: Clause 7.5.4.3.5 - ETSI GS NFV-SOL 011 [1] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Delete individual Grant + Check HTTP Response Status Code Is 405 + +GET an individual grant - NOT FOUND + [Documentation] Test ID: 9.3.3.2.6 + ... Test title: GET an individual grant - NOT FOUND + ... Test objective: The objective is to test that the retrieval of individual grant for a particular Lifecycle operation fails when using an invalid resource identifier + ... Pre-conditions: The grant information is available to the NFVO + ... Reference: Clause 7.5.4.3.2 - ETSI GS NFV-SOL 011 [1] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: Invalid resource identifier is used + ... Post-Conditions: none + Get individual grant + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/NSLCOperationGrantingKeywords.robot b/SOL011/NSLifecycleOperationGranting-API/NSLCOperationGrantingKeywords.robot new file mode 100644 index 0000000000000000000000000000000000000000..9d29ab9d9dc8108e9785de6ffa33c642e7111b44 --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/NSLCOperationGrantingKeywords.robot @@ -0,0 +1,142 @@ +*** Settings *** +Resource environment/variables.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Keywords *** +Send Post Request for Grant + Log Request a new Grant for an NS LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + ${body}= Get File jsons/grantNSLifecycleOperationRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Send Request for a new Grant Forbiden Operation + Log Request a new Grant for a NS 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 jsons/grantRejected.json + Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${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 Resource URI existence + ${uri}= Get Value From Json ${response['headers']} $..Location + Should Not Be Empty ${uri} + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + +Get Grants + 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 + ${body}= Output response + Set Suite Variable ${response} ${body} + +Put Grants + 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 + ${body}= Output response + Set Suite Variable ${response} ${body} + +Patch Grants + 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 + ${body}= Output response + Set Suite Variable ${response} ${body} + + +Delete Grants + 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 + ${body}= Output response + Set Suite Variable ${response} ${body} + +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 + +Get individual grant + 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} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Post individual Grant + log Trying to create an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Put individual Grant + Log Trying to update an individual grant. 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} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Patch individual Grant + Log Trying to update an individual grant. 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/${grantId} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Delete individual Grant + Log Trying to delete an individual grant. 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} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Check Postcondition Grants Exist + Log Checking that grants exists + Get Grants + +Check Postcondition Grant Is Set + Log Check Postcondition subscription exist + Log Trying to get the subscription + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/grants/${response['body']['id']} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 200 \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt b/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69f12ee20d695ca539fc9042cebdcec0281a32b --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt @@ -0,0 +1,42 @@ +*** 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} nslcog +${apiVersion} v1 + +${SYNC_MODE} 1 + + +${response} + + + +${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/SOL011/NSLifecycleOperationGranting-API/jsons/grantNSLifecycleOperationRequest.json b/SOL011/NSLifecycleOperationGranting-API/jsons/grantNSLifecycleOperationRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..df3d7bb4dd5b76ed6b4cac374db9c5846fc3f73a --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/jsons/grantNSLifecycleOperationRequest.json @@ -0,0 +1,6 @@ +{ + "nsInstanceId": "", + "nsdId": "", + "nsLcmOpOccId": "", + "lifecycleOperation": "SCALE" +} \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/jsons/grantRejected.json b/SOL011/NSLifecycleOperationGranting-API/jsons/grantRejected.json new file mode 100644 index 0000000000000000000000000000000000000000..df3d7bb4dd5b76ed6b4cac374db9c5846fc3f73a --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/jsons/grantRejected.json @@ -0,0 +1,6 @@ +{ + "nsInstanceId": "", + "nsdId": "", + "nsLcmOpOccId": "", + "lifecycleOperation": "SCALE" +} \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/schemas/Grant.schema.json b/SOL011/NSLifecycleOperationGranting-API/schemas/Grant.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..021c90e68451828818bd778674cf7f9e28c63b9d --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/schemas/Grant.schema.json @@ -0,0 +1,51 @@ +{ + "description": "This type represents a grant. It shall comply with the provisions defined in table 7.6.2.3-1.", + "type": "object", + "required": [ + "id", + "nsInstanceId", + "nsLcmOpOccId", + "_links" + ], + "properties": { + "id": { + "description": "Identifier of the grant.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "nsInstanceId": { + "description": "Identifier of the NS instance which this grant request relates to.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "nsLcmOpOccId": { + "description": "Identifier of the NS lifecycle management operation occurrence associated to the GrantRequest.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Identifier" + }, + "additionalParams": { + "description": "Additional parameters passed by NFVO-N, specific to the NS and the lifecycle management operation.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/KeyValuePairs" + }, + "_links": { + "description": "Links to resources related to this resource.", + "type": "object", + "required": [ + "self", + "nsLcmOpOcc", + "nsInstance" + ], + "properties": { + "self": { + "description": "URI of this resource", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Link" + }, + "nsLcmOpOcc": { + "description": "Related NS lifecycle management operation occurrence", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Link" + }, + "nsInstance": { + "description": "Related NS instance.", + "$ref": "../components/SOL011_schemas.yaml#/components/schemas/Link" + } + } + } + } +} \ No newline at end of file diff --git a/SOL011/NSLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json b/SOL011/NSLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 --- /dev/null +++ b/SOL011/NSLifecycleOperationGranting-API/schemas/ProblemDetails.schema.json @@ -0,0 +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" + ] +} \ No newline at end of file diff --git a/indexes/sol_011_index.csv b/indexes/sol_011_index.csv new file mode 100644 index 0000000000000000000000000000000000000000..c9cc67aeaa16ddef5f3a2789224e8a762ab3ec87 --- /dev/null +++ b/indexes/sol_011_index.csv @@ -0,0 +1,11 @@ +9, Or-Or Reference Point, SOL011 +9.3.3,NS Lifecycle Operation Granting interface +9.3.3.1,Grants Endpoint, Grants.robot +9.3.3.2,Individual Grant Endpoint, IndividualGrant.robot +9.3.3.3,API Version Endpoint, ApiVersion.robot +9.3.4,NS Instance Usage Notification interface +9.3.4.1,Subscriptions Endpoint, Subscriptions.robot +9.3.4.2,Individual Subscription Endpoint, IndividualSubscription.robot +9.3.4.3,Notifications Endpoint, NotificationEndpoint.robot +9.3.4.4,Notification Consumer Endpoint, NotificationConsumer.robot +9.3.4.5,API Version Endpoint, ApiVersion.robot