diff --git a/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot b/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot index a9fb107ae11347862923e936c879ad1034ce0ad1..169db08418313f3a555e4d3e1eb2bf8e68d8f30d 100644 --- a/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot +++ b/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot @@ -13,7 +13,7 @@ Request a cancellation of an ongoing coordination action ... Test title: Request a cancellation of an ongoing coordination action ... Test objective: The objective is to test the request for the cancellation of an ongoing coordination task ... Pre-conditions: An ongoing coordination action is available - ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -26,7 +26,7 @@ Request a cancellation of a finished coordination action ... Test title: Request a cancellation of a finished coordination action ... Test objective: The objective is to test the request for the cancellation of a finished coordination action ... Pre-conditions: A finished coordination action is available - ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -40,7 +40,7 @@ Request a cancellation of an ongoing coordination action without authentication ... Test title: Request a cancellation of an ongoing coordination action without authentication ... Test objective: The objective is to test the failure of the request for a cancellation of a coordination task when no authentication is used ... Pre-conditions: none - ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -53,7 +53,7 @@ GET information about a cancellation of an ongoing coordination action - method ... Test title: GET information about a cancellation of an ongoing coordination action - method not implemented ... Test objective: The objective is to test that the GET method is not allowed to retrieve cancellation details of an ongoing coordination action ... Pre-conditions: A cancellation task has been activated - ... Reference: Clause 12.4.4.3.2 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -66,7 +66,7 @@ PUT information about a cancellation of an ongoing coordination action - method ... Test title: PUT information about a cancellation of an ongoing coordination action - method not implemented ... Test objective: The objective is to test that the PUT method is not allowed to modify cancellation details of an ongoing coordination action ... Pre-conditions: A cancellation task has been activated - ... Reference: Clause 12.4.4.3.3 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.3 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -79,7 +79,7 @@ PATCH information about a cancellation of an ongoing coordination action - metho ... Test title: PATCH information about a cancellation of an ongoing coordination action - method not implemented ... Test objective: he objective is to test that the PATCH method is not allowed to modify cancellation details of an ongoing coordination action ... Pre-conditions: A cancellation task has been activated - ... Reference: Clause 12.4.4.3.4 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.4 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -92,9 +92,33 @@ DELETE information about a cancellation of an ongoing coordination action - meth ... Test title: DELETE information about a cancellation of an ongoing coordination action - method not implemented ... Test objective: The objective is to test that the DELETE method is not allowed to remove cancellation details of an ongoing coordination action ... Pre-conditions: A cancellation task has been activated - ... Reference: Clause 12.4.4.3.5 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.4.3.5 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none DELETE information about a cancellation of an ongoing coordination action - Check HTTP Response Status Code Is 405 \ No newline at end of file + Check HTTP Response Status Code Is 405 + +Request a cancellation of an ongoing coordination action with permitted authorization scope + [Documentation] Test ID: 5.3.8.4.8 + ... Test title: Request a cancellation of an ongoing coordination action with permitted authorization scope + ... Test objective: The objective is to test the request for the cancellation of an ongoing coordination task with permitted authorization scope + ... Pre-conditions: An ongoing coordination action is available + ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 + ... Config ID: Config_prod_OSS/BSS + ... Applicability: none + ... Post-Conditions: none + Send Post Request for cancellation of an ongoing coordination action with permitted authorization scope + Check HTTP Response Status Code Is 202 + +Request a cancellation of an ongoing coordination action with not permitted authorization scope + [Documentation] Test ID: 5.3.8.4.9 + ... Test title: Request a cancellation of an ongoing coordination action with not permitted authorization scope + ... Test objective: The objective is to test that the request for the cancellation of an ongoing coordination task fails when using not permitted authorization scope + ... Pre-conditions: An ongoing coordination action is available + ... Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 + ... Config ID: Config_prod_OSS/BSS + ... Applicability: none + ... Post-Conditions: none + Send Post Request for cancellation of an ongoing coordination action with not permitted authorization scope + Check HTTP Response Status Code Is 202 \ No newline at end of file diff --git a/SOL005/NSLCMCoordination-API/Coordinations.robot b/SOL005/NSLCMCoordination-API/Coordinations.robot index 4fb278643cd32b403ef5843ee714e12c2a2d674d..c03bacf4d1bcac2ef7a4c94c4d955dc6cc8dc5f2 100644 --- a/SOL005/NSLCMCoordination-API/Coordinations.robot +++ b/SOL005/NSLCMCoordination-API/Coordinations.robot @@ -13,7 +13,7 @@ Request a Coordination of an LCM operation occurrence synchronously ... Test title: Request a Coordination of an LCM operation occurrence synchronously ... Test objective: The objective is to test the synchronous request for the coordination of an LCM operation occurrence and perform the JSON schema validation of the returned structure ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: A Individual coordination action resource is successfully created on the NFVO @@ -29,7 +29,7 @@ Request a Coordination of an LCM operation occurrence asynchronously ... Test title: Request a Coordination of an LCM operation occurrence asynchronously ... Test objective: The objective is to test the asynchronous request for the coordination of an LCM operation occurrence and perform the validation of the headers returned ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -42,7 +42,7 @@ Request a Coordination of an LCM operation occurrence - FORBIDDEN ... Test title: Request a Coordination of an LCM operation occurrence - FORBIDDEN ... Test objective: The objective is to test the failure of a request for the coordination of an LCM operation occurrence ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING". The request is performed by a user that has not the grant to run this operation - ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -55,7 +55,7 @@ Request a Coordination of an LCM operation occurrence - CONFLICT ... Test title: Request a Coordination of an LCM operation occurrence - CONFLICT ... Test objective: The objective is to test the failure of a request for the coordination of an LCM operation occurrence ... Pre-conditions: The status of the related LCM opeation occurrence is not "PROCESSING" - ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -69,7 +69,7 @@ Request a Coordination of an LCM operation occurrence synchronously - Service Un ... Test title: Request a Coordination of an LCM operation occurrence synchronously - Service Unavailable ... Test objective: The objective is to test the request for the coordination of an LCM operation occurrence and the verify that the NFVO cannot perform immediately the request, but can perform it sometime in the future. ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" but API producer cannot perform immediately the request - ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -83,7 +83,7 @@ Request a Coordination of an LCM operation occurrence without authentication ... Test title: Request a Coordination of an LCM operation occurrence without authentication ... Test objective: The objective is to test the failure of the request for the coordination of an LCM operation occurrence without providing an authentication token ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -96,7 +96,7 @@ GET all Coordinations of an LCM operation occurrence - method not implemented ... Test title: GET all Coordinations of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the GET method is not allowed to retrieve coordination requests information ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -109,7 +109,7 @@ PUT all Coordinations of an LCM operation occurrence - method not implemented ... Test title: PUT all Coordinations of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the PUT method is not allowed to modify coordination requests information ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.3 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.3 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -122,7 +122,7 @@ PATCH all Coordinations of an LCM operation occurrence - method not implemented ... Test title: PATCH all Coordinations of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the PATCH method is not allowed to modify coordination requests information ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.4 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.4 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -135,9 +135,36 @@ DELETE all Coordinations of an LCM operation occurrence - method not implemented ... Test title: DELETE all Coordinations of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the DELETE method is not allowed to remove coordination requests information ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" - ... Reference: Clause 12.4.2.3.5 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.2.3.5 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none DELETE all Coordinations of an LCM operation occurrence - Check HTTP Response Status Code Is 405 \ No newline at end of file + Check HTTP Response Status Code Is 405 + +Request a Coordination of an LCM operation occurrence synchronously with permitted authorization scope + [Documentation] Test ID: 5.3.8.2.10 + ... Test title: Request a Coordination of an LCM operation occurrence synchronously with permitted authorization scope + ... Test objective: The objective is to test the synchronous request for the coordination of an LCM operation occurrence with permitted authorization scope + ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 + ... Config ID: Config_prod_OSS/BSS + ... Applicability: none + ... Post-Conditions: A Individual coordination action resource is successfully created on the NFVO + Send Post Request for coordination of an LCM operation occurrence with permitted authorization scope + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is LcmCoord + Check Postcondition LcmCoord Exists + +Request a Coordination of an LCM operation occurrence synchronously with not permitted authorization scope + [Documentation] Test ID: 5.3.8.2.10 + ... Test title: Request a Coordination of an LCM operation occurrence synchronously with not permitted authorization scope + ... Test objective: The objective is to test that the synchronous request for the coordination of an LCM operation occurrence fails when using not permitted authorization scope + ... Pre-conditions: The status of the related LCM opeation occurrence is "PROCESSING" + ... Reference: Clause 12.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 + ... Config ID: Config_prod_OSS/BSS + ... Applicability: none + ... Post-Conditions: none + Send Post Request for coordination of an LCM operation occurrence with permitted authorization scope + Check HTTP Response Status Code Is 401 \ No newline at end of file diff --git a/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot b/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot index f79a7d446d9ba35588d9ceececbf16defe843f4b..2ee2e9d1b6ce3d1b0dbabe33fa3ff92dc9b4b280 100644 --- a/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot +++ b/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot @@ -13,7 +13,7 @@ POST an individual coordination action of an LCM operation occurrence - method n ... Test title: POST an individual coordination action of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the POST method is not allowed to submit a new individuaal coordination requests information ... Pre-conditions: One or more LCM Coordinations have been requested - ... Reference: Clause 12.4.3.3.1 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -26,7 +26,7 @@ Get information about a finished coordination task ... Test title: Get information about a finished coordination task ... Test objective: The objective is to retrieve information about an individual coordination task and perform a JSON schema validation. ... Pre-conditions: Individual coordination task is terminated - ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -40,7 +40,7 @@ Get information about an ongoing coordination task ... Test title: Get information about an ongoing coordination task ... Test objective: The objective is to retrieve information about an individual coordination task that is still in running or is in the process of being cancelled ... Pre-conditions: Individual coordination task is still ongoing or is in the process of being cancelled - ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -53,7 +53,7 @@ Get information about an invalid coordination task ... Test title: Get information about an invalid coordination task ... Test objective: The objective is to try to read an individual coordination task ... Pre-conditions: Individual coordination task is not present - ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -66,7 +66,7 @@ Get information about a finished coordination task without authentication ... Test title: Get information about a finished coordination task without authentication ... Test objective: The objective is to try to read an individual coordination task without using authentication ... Pre-conditions: none - ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -79,7 +79,7 @@ PUT an individual coordination action of an LCM operation occurrence - method no ... Test title: PUT an individual coordination action of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the PUT method is not allowed to modify an individual coordination action ... Pre-conditions: One or more LCM Coordinations have been requested - ... Reference: Clause 12.4.3.3.3 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.3 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -92,7 +92,7 @@ PATCH an individual coordination action of an LCM operation occurrence - method ... Test title: PATCH an individual coordination action of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the PATCH method is not allowed to modify an individual coordination action ... Pre-conditions: One or more LCM Coordinations have been requested - ... Reference: Clause 12.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none @@ -105,9 +105,35 @@ DELETE an individual coordination action of an LCM operation occurrence - method ... Test title: DELETE an individual coordination action of an LCM operation occurrence - method not implemented ... Test objective: The objective is to test that the DELETE method is not allowed to remove an individual coordination action ... Pre-conditions: One or more LCM Coordinations have been requested - ... Reference: Clause 12.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v4.4.1 + ... Reference: Clause 12.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v4.5.1 ... Config ID: Config_prod_OSS/BSS ... Applicability: none ... Post-Conditions: none DELETE an individual coordination action of an LCM operation occurrence Check HTTP Response Status Code Is 405 + +Get information about a finished coordination task with permitted authorization scope + [Documentation] Test ID: 5.3.8.3.9 + ... Test title: Get information about a finished coordination task with permitted authorization scope + ... Test objective: The objective is to retrieve information about an individual coordination task with permitted authorization scope + ... Pre-conditions: Individual coordination task is terminated + ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 + ... Config ID: Config_prod_OSS/BSS + ... Applicability: none + ... Post-Conditions: none + Retrieve information about a finished coordination task with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is LcmCoord + + +Get information about a finished coordination task with not permitted authorization scope + [Documentation] Test ID: 5.3.8.3.9 + ... Test title: Get information about a finished coordination task with not permitted authorization scope + ... Test objective: The objective is to test that retrieve information about an individual coordination task fails when using not permitted authorization scope + ... Pre-conditions: Individual coordination task is terminated + ... Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1 + ... Config ID: Config_prod_OSS/BSS + ... Applicability: none + ... Post-Conditions: none + Retrieve information about a finished coordination task with not permitted authorization scope + Check HTTP Response Status Code Is 401 \ No newline at end of file diff --git a/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot b/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot index 1fbd51d7c768a0253a6456079835319982188bb9..1fa359755abef4c6791d7fa0449901c2ee49e186 100644 --- a/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot +++ b/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot @@ -10,6 +10,7 @@ Library JSONSchemaLibrary schemas/ Library RequestsLibrary Library Process Library String +Library jwt *** Keywords *** Send Post Request for coordination of an LCM operation occurrence @@ -22,6 +23,34 @@ Send Post Request for coordination of an LCM operation occurrence REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations ${body} ${output}= Output response Set Suite Variable ${response} ${output} + +Send Post Request for coordination of an LCM operation occurrence with permitted authorization scope + Log Requesting a new coordination task for an LCM Operation occurrence + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${template}= Get File jsons/createLcmCoordRequest.json + ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} lcmOperationType=${lcmOperationType} coordinationActionName=${coordinationActionName} nsLcmOpOccHref=${nsLcmOpOccHref} nsInstanceHref=${nsInstanceHref} + ${scopeValue}= Create Dictionary scope=${ALL_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key='' algorithm=${OAUTH_ENCRIPTION_ALGORITHM} + Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Authorization Token: ${authorizationToken} + REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send Post Request for coordination of an LCM operation occurrence with not permitted authorization scope + Log Requesting a new coordination task for an LCM Operation occurrence + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${template}= Get File jsons/createLcmCoordRequest.json + ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} lcmOperationType=${lcmOperationType} coordinationActionName=${coordinationActionName} nsLcmOpOccHref=${nsLcmOpOccHref} nsInstanceHref=${nsInstanceHref} + ${scopeValue}= Create Dictionary scope=${NOT_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key='' algorithm=${OAUTH_ENCRIPTION_ALGORITHM} + Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Authorization Token: ${authorizationToken} + REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} Check HTTP Response Body Json Schema Is @@ -149,6 +178,31 @@ Retrieve information about a finished coordination task REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${coordinationId} ${output}= Output response Set Suite Variable ${response} ${output} + +Retrieve information about a finished coordination task with permitted authorization scope + Log Requesting the retrieve of a finished coordination task + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scopeValue}= Create Dictionary scope=${ALL_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key='' algorithm=${OAUTH_ENCRIPTION_ALGORITHM} + Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Authorization Token: ${authorizationToken} + REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${coordinationId} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Retrieve information about a finished coordination task with not permitted authorization scope + Log Requesting the retrieve of a finished coordination task + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scopeValue}= Create Dictionary scope=${NOT_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key='' algorithm=${OAUTH_ENCRIPTION_ALGORITHM} + Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Authorization Token: ${authorizationToken} + REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${coordinationId} + ${output}= Output response + Set Suite Variable ${response} ${output} Retrieve information about an ongoing coordination task @@ -218,6 +272,31 @@ Send Post Request for cancellation of an ongoing coordination action ${output}= Output response Set Suite Variable ${response} ${output} +Send Post Request for cancellation of an ongoing coordination action with permitted authorization scope + Log Requesting the cancellation of an ongoing coordination task + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scopeValue}= Create Dictionary scope=${ALL_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key='' algorithm=${OAUTH_ENCRIPTION_ALGORITHM} + Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Authorization Token: ${authorizationToken} + REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${ongoingCoordinationId}/cancel + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Send Post Request for cancellation of an ongoing coordination action with not permitted authorization scope + Log Requesting the cancellation of an ongoing coordination task + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scopeValue}= Create Dictionary scope=${NOT_PERMITTED_SCOPE} + ${authorizationToken}= JWT Encode payload=${scopeValue} key='' algorithm=${OAUTH_ENCRIPTION_ALGORITHM} + Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Authorization Token: ${authorizationToken} + REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${ongoingCoordinationId}/cancel + ${output}= Output response + Set Suite Variable ${response} ${output} + Send Post Request for cancellation of a finished coordination action Log Requesting the cancellation of a finished coordination task Set Headers {"Accept": "${ACCEPT_JSON}"} @@ -270,4 +349,9 @@ DELETE information about a cancellation of an ongoing coordination action Run Keyword If ${NFVO_AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.DELETE ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${ongoingCoordinationId}/cancel ${output}= Output response - Set Suite Variable ${response} ${output} \ No newline at end of file + Set Suite Variable ${response} ${output} + +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} \ No newline at end of file diff --git a/SOL005/NSLCMCoordination-API/environment/variables.txt b/SOL005/NSLCMCoordination-API/environment/variables.txt index ef38b0b48d686cb7e30c4ab467d55e5b70ce8d65..06d1657472b6f8c4ae1006bd0afc76690e6041f0 100644 --- a/SOL005/NSLCMCoordination-API/environment/variables.txt +++ b/SOL005/NSLCMCoordination-API/environment/variables.txt @@ -4,6 +4,12 @@ ${NFVO_PORT} 8081 # Listening port of the NFVO ${NFVO_SCHEMA} https ${AUTHORIZATION_HEADER} Authorization ${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 + +${OAUTH_ENCRIPTION_ALGORITHM} HS256 +${ALL_PERMITTED_SCOPE} lcmcoord:v2:all +${NOT_PERMITTED_SCOPE} lcmcoord:v2:invalid + + ${INSUFFICIENT_AUTHORIZATION_TOKEN} Bearer INSUFFICIENT_AUTHORIZATION_TOKEN #${NEG_AUTHORIZATION_TOKEN} Bearer negativetoken ${NFVO_AUTH_USAGE} 1