From 40931c5a9b6e949ba7d051af99a18f2d6d9ea9be Mon Sep 17 00:00:00 2001 From: "g.bernini" Date: Thu, 5 Sep 2024 16:07:50 +0200 Subject: [PATCH 1/4] Fixed reference to SOL005 v4.5.1 in all NSLCMCoord tests --- .../CancelCoordinationActionTask.robot | 14 ++++++------- .../NSLCMCoordination-API/Coordinations.robot | 20 +++++++++---------- .../IndividualCoordinationAction.robot | 16 +++++++-------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot b/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot index a9fb107ae..05e3dcc11 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,7 +92,7 @@ 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 diff --git a/SOL005/NSLCMCoordination-API/Coordinations.robot b/SOL005/NSLCMCoordination-API/Coordinations.robot index 4fb278643..3c9bc8a37 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,7 +135,7 @@ 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 diff --git a/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot b/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot index f79a7d446..b892afce1 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,7 +105,7 @@ 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 -- GitLab From 21db903f19eba8647e98eff4a54240fb3b66653f Mon Sep 17 00:00:00 2001 From: "g.bernini" Date: Sat, 14 Sep 2024 01:14:30 +0200 Subject: [PATCH 2/4] added oauth scope tests for NS LCM Coordinations --- .../NSLCMCoordination-API/Coordinations.robot | 29 ++++++++++++++- .../NSLCMCoordKeywords.robot | 36 ++++++++++++++++++- .../environment/variables.txt | 6 ++++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/SOL005/NSLCMCoordination-API/Coordinations.robot b/SOL005/NSLCMCoordination-API/Coordinations.robot index 3c9bc8a37..c03bacf4d 100644 --- a/SOL005/NSLCMCoordination-API/Coordinations.robot +++ b/SOL005/NSLCMCoordination-API/Coordinations.robot @@ -140,4 +140,31 @@ DELETE all Coordinations of an LCM operation occurrence - method not implemented ... 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/NSLCMCoordKeywords.robot b/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot index 1fbd51d7c..59421f61d 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 @@ -270,4 +299,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 ef38b0b48..06d165747 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 -- GitLab From c42a6b0c8974024c6f4185015cd757100c7d56d0 Mon Sep 17 00:00:00 2001 From: "g.bernini" Date: Sat, 14 Sep 2024 01:17:16 +0200 Subject: [PATCH 3/4] added oauth scope tests for NS LCM individual Coordinations --- .../IndividualCoordinationAction.robot | 26 +++++++++++++++++++ .../NSLCMCoordKeywords.robot | 25 ++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot b/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot index b892afce1..2ee2e9d1b 100644 --- a/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot +++ b/SOL005/NSLCMCoordination-API/IndividualCoordinationAction.robot @@ -111,3 +111,29 @@ DELETE an individual coordination action of an LCM operation occurrence - method ... 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 59421f61d..1a0b6fb24 100644 --- a/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot +++ b/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot @@ -178,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 -- GitLab From 50ae740926d48480c82843ec0c5b502ff6189545 Mon Sep 17 00:00:00 2001 From: "g.bernini" Date: Sat, 14 Sep 2024 01:19:56 +0200 Subject: [PATCH 4/4] added oauth scope tests for NS LCM cancel coordination task --- .../CancelCoordinationActionTask.robot | 26 ++++++++++++++++++- .../NSLCMCoordKeywords.robot | 25 ++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot b/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot index 05e3dcc11..169db0841 100644 --- a/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot +++ b/SOL005/NSLCMCoordination-API/CancelCoordinationActionTask.robot @@ -97,4 +97,28 @@ DELETE information about a cancellation of an ongoing coordination action - meth ... 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/NSLCMCoordKeywords.robot b/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot index 1a0b6fb24..1fa359755 100644 --- a/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot +++ b/SOL005/NSLCMCoordination-API/NSLCMCoordKeywords.robot @@ -272,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}"} -- GitLab