diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot index 3f81fd02a30f66c269679d5ad13c886f4afc09f1..5ee7b53287c6d88203ab958ab2901f3298955b5e 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/IndividualSubscription.robot @@ -15,7 +15,7 @@ Create new Virtualised Resources Quota Available Notification individual subscri ... Test title: Create new Virtualised Resources Quota Available Notification individual subscription - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create a new Virtualised Resources Quota Available Notification individual subscription instance on VNF ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 11.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -27,7 +27,7 @@ Get Information about an individual subscription ... Test title: Get Information about an individual subscription ... Test objective: The objective is to read an individual Virtualised Resources Quota Available Notification subscription subscribed by the client and perform a JSON schema and content validation of the returned individual subscription data structure ... Pre-conditions: The subscription with the given id exists - ... Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -40,7 +40,7 @@ PUT an individual subscription - Method not implemented ... Test title: PUT an individual subscription - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to update a existing Virtualised Resources Quota Available Notification individual subscription instance on VNF ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 11.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -52,7 +52,7 @@ PATCH an individual subscription - Method not implemented ... Test title: PATCH an individual subscription - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to modify a existing Virtualised Resources Quota Available Notification individual subscription instance on VNF ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 11.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -64,7 +64,7 @@ DELETE an individual subscription ... Test title: DELETE an individual subscription ... Test objective: The objective is to test that Delete method is allowed to remove a existing Virtualised Resources Quota Available Notification individual subscription instance on VNF ... Pre-conditions: The subscription with the given id exists - ... Reference: Clause 11.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -77,10 +77,36 @@ Get Information about an individual subscription - Not Found ... Test title: Get Information about an individual subscription - Not Found ... Test objective: The objective is to test that the retrieval of an individual Virtualised Resources Quota Available Notification subscription subscribed by the client fils when resource is not present ... Pre-conditions: The subscription with the given id does not exists - ... Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Get Virtualised Resources Quota Available Notification individual subscription Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +Get Information about an individual subscription with permitted authorization scope + [Documentation] Test ID: 7.3.7.2.7 + ... Test title: Get Information about an individual subscription with permitted authorization scope + ... Test objective: The objective is to read an individual Virtualised Resources Quota Available Notification subscription subscribed by the client and perform a JSON schema and content validation of the returned individual subscription data structure with permitted authorization scope + ... Pre-conditions: The subscription with the given id exists + ... Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Get Virtualised Resources Quota Available Notification individual subscription with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VrQuotaAvailSubscription + +Get Information about an individual subscription with not permitted authorization scope + [Documentation] Test ID: 7.3.7.2.8 + ... Test title: Get Information about an individual subscription with not permitted authorization scope + ... Test objective: The objective is to read an individual Virtualised Resources Quota Available Notification subscription subscribed by the client and perform a JSON schema and content validation of the returned individual subscription data structure with not permitted authorization scope + ... Pre-conditions: The subscription with the given id exists + ... Reference: Clause 11.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Get Virtualised Resources Quota Available Notification individual subscription with not permitted authorization scope + Check HTTP Response Status Code Is 403 Check HTTP Response Body Json Schema Is ProblemDetails \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot index 1b072bbf9e8571cb6ec2fa64bb57c1ff2138fbbb..6e7b4dc206989d1b9e25854a5964d34006f4b312 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/NotificationEndpoint.robot @@ -13,7 +13,7 @@ Vr Quota Availibility Notification ... Test title: Vr Quota Availibility Notification ... Test objective: The objective is to test that Vr Quota Availibility Notification is delivered with success to the notification consumer ... Pre-conditions: The VNF has subscribed to the Vr Quota Availibility resource - ... Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Notifications.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Notifications.robot index b405cca894a14ebb3b0b19d6d6d735a8c3ac4d41..a9468e3772695ba6653bac3bcb9b85e260bc3fc1 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Notifications.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Notifications.robot @@ -13,7 +13,7 @@ Virtualised Resource Quota Available Notification ... Test title: Virtualised Resource Quota Available Notification ... Test objective: The objective is to test the dispatch of Virtualised Resource Quota Available Notification, 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 Virtualised Resource Quota Available Notification is available in the VNFM. - ... Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot index c8c47165135b46f8d06377c1dcc316fbc966cacd..3ba5185ccfe03a7a9f6216fa348fd1f8cdafdf70 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/Subscriptions.robot @@ -15,7 +15,7 @@ Create new Virtualised Resources Quota Available Notification subscription ... Test title: Create new Virtualised Resources Quota Available Notification subscription ... Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned subscription data structure ... Pre-conditions: no subscription with the same filter and callback Uri exists - ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -29,7 +29,7 @@ Create new Virtualised Resources Quota Available Notification subscription - DUP ... Test title: Create new Virtualised Resources Quota Available Notification subscription - DUPLICATION ... Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned duplicated subscription data structure ... Pre-conditions: subscription with the same filter and callback Uri exists - ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: the VNFM allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists ... Post-Conditions: none @@ -43,7 +43,7 @@ Create new Virtualised Resources Quota Available Notification subscription - NO- ... Test title: Create new Virtualised Resources Quota Available Notification subscription - NO-DUPLICATION ... Test objective: The objective is to create a nduplicated Virtualised Resources Quota Available Notification subscription and verify that the VNF does not allow duplication ... Pre-conditions: subscription with the same filter and callback Uri exists - ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: the VNFM decides to not create a duplicate subscription resource ... Post-Conditions: none @@ -56,7 +56,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions ... Test title: GET Virtualised Resources Quota Available Notification Subscriptions ... Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions and perform a JSON schema and content validation of the returned subscriptions data structure ... Pre-conditions: none - ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -69,7 +69,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions with attrib ... Test title: GET Virtualised Resources Quota Available Notification Subscriptions with attribute-based Filter ... Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions and perform a JSON schema and content validation of the returned subscriptions data structure, and verify that the retrieved information matches the issued attribute-based filters ... Pre-conditions: none - ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -82,7 +82,7 @@ GET Virtualised Resources Quota Available Notification subscriptions - Bad Reque ... Test title: GET Virtualised Resources Quota Available Notification subscriptions - Bad Request Invalid attribute-based filtering parameters ... Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions with invalid attribute-based filtering parameters, and verify that problem details are returned ... Pre-conditions: none - ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -95,7 +95,7 @@ PUT Virtualised Resources Quota Available Notification subscriptions - Method no ... Test title: PUT Virtualised Resources Quota Available Notification subscriptions - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to update existing Virtualised Resources Quota Available Notification subscriptions instance on VNF ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 11.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -107,7 +107,7 @@ PATCH Virtualised Resources Quota Available Notification subscriptions - Method ... Test title: PATCH Virtualised Resources Quota Available Notification subscriptions - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to modify Virtualised Resources Quota Available Notification subscriptions instance on VNF ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 11.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -119,7 +119,7 @@ DELETE Virtualised Resources Quota Available Notification subscriptions - Method ... Test title: DELETE Virtualised Resources Quota Available Notification subscriptions - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to delete Virtualised Resources Quota Available Notification subscriptions instance on VNF ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 11.4.2.3.5 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -131,7 +131,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions as Paged Re ... Test title: GET Virtualised Resources Quota Available Notification Subscriptions as Paged Response ... Test objective: The objective is to retrieve the list of active Virtualised Resources Quota Available Notification subscriptions as a Paged Response. ... Pre-conditions: none - ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports response paging for the subscription resources ... Post-Conditions: none @@ -144,7 +144,7 @@ GET Virtualised Resources Quota Available Notification Subscriptions as Paged Re ... Test title: GET Virtualised Resources Quota Available Notification Subscriptions as Paged Response with nextpage_opauque_marker parameter ... Test objective: The objective is to query the list of active Virtualised Resources Quota Available Notification subscriptions as a Paged Response and retrieve the next page using the nextpage_opaque_marker parameter ... Pre-conditions: A request for retrieving the list of active Virtualised Resources Quota Available Notification subscriptions as a paged response has been successfully issued (Test ID 7.3.7.1.10) - ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: The VNFM supports response paging for the subscription resources ... Post-Conditions: none @@ -156,7 +156,7 @@ GET Virtualised Resources Quota Available Notification subscriptions - Bad Reque ... Test title: GET Virtualised Resources Quota Available Notification subscriptions - Bad Request Response too Big ... Test objective: The objective is to test that the retrieval of active Virtualised Resources Quota Available Notification subscriptions list fails because response is too big, and verify that problem details are returned ... Pre-conditions: none - ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -169,10 +169,37 @@ Create new Virtualised Resources Quota Available Notification Subscription - Unp ... Test title: Create new Virtualised Resources Quota Available Notification Subscription - Unprocessable Content ... Test objective: The objective is to test that content type of the message content is supported and the message content of a request contains syntactically correct data but the data cannot be processed. ... re-conditions: none - ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.4.1 + ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Send Post request for new Virtualised Resources Quota Available Notification subscription Check HTTP Response Status Code Is 422 Check HTTP Response Body Json Schema Is ProblemDetails + +Create new Virtualised Resources Quota Available Notification subscription with permitted authorization scope + [Documentation] Test ID: 7.3.7.1.13 + ... Test title: Create new Virtualised Resources Quota Available Notification subscription with permitted authorization scope + ... Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned subscription data structure with permitted authorization scope + ... Pre-conditions: no subscription with the same filter and callback Uri exists + ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Send Post request for new Virtualised Resources Quota Available Notification subscription with permitted authorization scope + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is VrQuotaAvailSubscription + +Create new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope + [Documentation] Test ID: 7.3.7.1.14 + ... Test title: Create new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope + ... Test objective: The objective is to create a new Virtualised Resources Quota Available Notification subscription and perform a JSON schema and content validation of the returned subscription data structure with not permitted authorization scope + ... Pre-conditions: no subscription with the same filter and callback Uri exists + ... Reference: Clause 11.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Send Post request for new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot index be74e412eff15c26edeac5177c751db0f49564d4..929c8c0097b8d36404f23862b4e610438077dcdb 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot @@ -82,7 +82,27 @@ Get Virtualised Resources Quota Available Notification individual subscription Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} - + +Get Virtualised Resources Quota Available Notification individual subscription with permitted authorization scope + log Trying to get information about an individual subscription with permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + ${scopeValue}= Create Dictionary scopeValue=${VRQAN_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key=${OAUTH_KEY} algorithm=${OAUTH_ENCRYPTION_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get Virtualised Resources Quota Available Notification individual subscription with not permitted authorization scope + log Trying to get information about an individual subscription with not permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + ${scopeValue}= Create Dictionary scopeValue=${VRQAN_NOT_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key=${OAUTH_KEY} algorithm=${OAUTH_ENCRYPTION_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + Delete Virtualised Resources Quota Available Notification individual subscription log Try to delete an individual subscription Set Headers {"Accept":"${ACCEPT}"} @@ -146,6 +166,46 @@ Send Post request for new Virtualised Resources Quota Available Notification sub Set Global Variable ${response} ${outputResponse} Verify Mock Expectation ${notification_request} Clear Requests ${callback_endpoint} + +Send Post request for new Virtualised Resources Quota Available Notification subscription with permitted authorization scope + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions with permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scopeValue}= Create Dictionary scopeValue=${VRQAN_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key=${OAUTH_KEY} algorithm=${OAUTH_ENCRYPTION_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${template}= Get File jsons/vrQuotaAvailSubscriptionRequest.json + ${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_subscribe=${callback_subscribe} + Log Creating mock request and response to handle GET operation on notification endpoint + &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} + &{notification_response}= Create Mock Response status_code=204 + Log Issue the subscription request + Create Mock Expectation ${notification_request} ${notification_response} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + +Send Post request for new Virtualised Resources Quota Available Notification subscription with not permitted authorization scope + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions with not permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scopeValue}= Create Dictionary scopeValue=${VRQAN_NOT_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key=${OAUTH_KEY} algorithm=${OAUTH_ENCRYPTION_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${template}= Get File jsons/vrQuotaAvailSubscriptionRequest.json + ${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_subscribe=${callback_subscribe} + Log Creating mock request and response to handle GET operation on notification endpoint + &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} + &{notification_response}= Create Mock Response status_code=204 + Log Issue the subscription request + Create Mock Expectation ${notification_request} ${notification_response} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} GET Virtualised Resources Quota Available Notification Subscriptions Log Get the list of active subscriptions @@ -218,6 +278,9 @@ Check HTTP Response Header Contain Link ${linkHeaderUri}= Get Regexp Matches ${linkURL} (?<=\<)(.*?)(?=\>) ${length}= Get Length ${linkHeaderUri} Should Be Equal As Integers ${length} 0 - Set Global Variable ${nextPageUri} ${linkHeaderUri[0]} + Set Global Variable ${nextPageUri} ${linkHeaderUri[0]} - \ No newline at end of file +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} \ No newline at end of file diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt index 98902db86aa6673575b137b6836862711e59a53c..738742a729b9b7d367ceb6266dd8dc76183fa165 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/environment/variables.txt @@ -2,8 +2,14 @@ ${NFVO_HOST} localhost # Hostname of the NFVO ${NFVO_PORT} 8081 # Listening port of the NFVO ${NFVO_SCHEMA} https +${OAUTH_ENCRYPTION_ALGORITHM} HS256 +${OAUTH_KEY} ${AUTHORIZATION_HEADER} Authorization ${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 + +${VRQAN_PERMITTED_SCOPE} vrqan:v1:all +${VRQAN_NOT_PERMITTED_SCOPE} vrqan:v1:all:invalid + ${CONTENT_TYPE} application/json ${AUTH_USAGE} 1 ${ACCEPT} application/json