diff --git a/SOL011/NSInstanceUsageNotification-API/Subscriptions.robot b/SOL011/NSInstanceUsageNotification-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..09442ac4bcc39f5c230c6076b7b8f59fa11f0019 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-API/Subscriptions.robot @@ -0,0 +1,358 @@ +*** Settings *** +Resource environment/variables.txt +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 Resource URI + +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 + Check Subscription Existence + POST subscriptions DUPLICATION + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is subscription + +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 + Check Subscription Existence + POST subscriptions NO DUPLICATION + Check HTTP Response Status Code Is 303 + Check HTTP Response Header Contains Location + +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: + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: + ... Post-Conditions: + 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: + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: + ... Post-Conditions: + 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: + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: + ... Post-Conditions: + 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: + ... Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [6] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: + ... Post-Conditions: + 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 LINK in Header + +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: Subscription is not deleted + DELETE subscriptions + Check HTTP Response Status Code Is 405 + +*** 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 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 + #more robust functionaity needed + +#Check URI is Of Existing Resource +# ${uri}= Get Value From Json ${response['headers']} $..Location +# Should Be Equal As Strings ${uri} ${} + +Check LINK in Header + ${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} \ 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..fc5a4bc11bee36e5120cc8f6832dbf3ee2807255 --- /dev/null +++ b/SOL011/NSInstanceUsageNotification-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 +${ACCEPT_JSON} application/json +${apiRoot} / +${apiName} nsiun +${apiVersion} v1 + +${SYNC_MODE} 1 + + +${response} + +${NFVO_DUPLICATION} + +${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} {} 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/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/Grants.robot b/SOL011/NSLifecycleOperationGranting-API/Grants.robot index 172edd6dd20bf55720b768bb83958976bdf2ac42..4ef0f91eb478d02c47721ffedd0c1bab6abbcad0 100644 --- a/SOL011/NSLifecycleOperationGranting-API/Grants.robot +++ b/SOL011/NSLifecycleOperationGranting-API/Grants.robot @@ -18,7 +18,8 @@ Requests a grant for a particular NS lifecycle operation Send Post Request for Grant Check HTTP Response Status Code Is 201 Check HTTP Response Body Json Schema Is Grant - Check Operation Occurrence Id existence + Check HTTP Response Header Contains Location + Check Resource URI existence Requests a grant for a particular NS lifecycle operation - Forbidden [Documentation] Test ID: 9.3.3.1.2 @@ -109,15 +110,15 @@ Check HTTP Response Status Code Is Should Be Equal As Strings ${response['status']} ${expected_status} Log Status code validated -Check Operation Occurrence Id existence - ${occId}= Get Value From Json ${response['headers']} $..Location - Should Not Be Empty ${occId} - 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 diff --git a/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt b/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt index 1895ddcb8a951d167e6c25034e26375751a70479..e69f12ee20d695ca539fc9042cebdcec0281a32b 100644 --- a/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt +++ b/SOL011/NSLifecycleOperationGranting-API/environment/variables.txt @@ -9,13 +9,11 @@ ${AUTH_USAGE} 1 ${grantId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d ${apiRoot} / -${apiName} grant +${apiName} nslcog ${apiVersion} v1 ${SYNC_MODE} 1 -${grantId} - ${response}