From b66d4d97613bd6303c7b4607c4aa0ccd6bbae4fa Mon Sep 17 00:00:00 2001 From: "mudassar.sabeel" Date: Fri, 23 Aug 2024 15:22:33 +0500 Subject: [PATCH 1/6] update SOL002 document version in all testcases of VNFConfiguration API --- .../VNFConfiguration-API/Configuration.robot | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 5ab2c4148..5d913d40e 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -13,7 +13,7 @@ Set new VNF Configuration ... Test title: Set a new VNF Configuration ... Test objective: The objective is to test the creation of a new VNF configuration and perform a JSON schema validation of the returned configuration data structure ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers ... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration @@ -29,7 +29,7 @@ Get information about a VNF configuration ... Test title: Get information about a VNF configuration ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured. - ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -43,7 +43,7 @@ Get information about a VNF configuration with HTTP Etag ... Test title: Get information about a VNF configuration with HTTP Etag ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration, check the generation by the VNF of an HTTP Etag opaque identifier, and perform a JSON schema validation of the collected configuration data structure ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured - ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers ... Post-Conditions: none @@ -58,7 +58,7 @@ Set new VNF Configuration - HTTP Etag precondition unsuccessful ... Test title: Set a new VNF Configuration - HTTP Etag precondition unsuccessful ... Test objective: The objective is to test the unsuccess in setting a duplication of VNF configuration identified by an already used HTTP Etag identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured (Test ID 6.3.1.1.1) with a given HTTP Etag identifier. - ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers ... Post-Conditions: The VNF configuration is not modified by the unsuccessful operation and it matches the configuration issued in Test ID 6.3.1.1.1 @@ -72,7 +72,7 @@ POST VNF Configuration - Method not implemented ... Test title: POST VNF Configuration - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create a new VNF configuration ... Pre-conditions: none - ... Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -84,7 +84,7 @@ PUT VNF Configuration - Method not implemented ... Test title: PUT VNF Configuration - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify an existing VNF configuration ... Pre-conditions: none - ... Reference: Clause 9.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -96,7 +96,7 @@ DELETE VNF Configuration - Method not implemented ... Test title: Delete VNF Configuration - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete an existing VNF configuration ... Pre-conditions: none - ... Reference: Clause 9.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -108,7 +108,7 @@ Set new VNF Configuration With Attribute vnfConfigurationData ... Test title: Set a new VNF Configuration with Attribute vnfConfigurationData ... Test objective: The objective is to test the creation of a new VNF configuration and perform a JSON schema validation of the returned configuration data structure ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers ... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration @@ -123,7 +123,7 @@ Set new VNF Configuration With Attribute vnfcConfigurationData ... Test title: Set a new VNF Configuration with Attribute vnfcConfigurationData ... Test objective: The objective is to test the creation of a new VNF configuration and perform a JSON schema validation of the returned configuration data structure ... Pre-conditions: A VNF instance is instantiated - ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 9.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation of HTTP Etag opaque identifiers ... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration -- GitLab From 519e60a780e82ac7ac91b471e4daf2ae55f002c8 Mon Sep 17 00:00:00 2001 From: "mudassar.sabeel" Date: Mon, 26 Aug 2024 16:52:34 +0500 Subject: [PATCH 2/6] update datamodel: VnfcConfigurationData as per clause 9.5.3.4 --- .../vnfConfigModifications.schema.json | 56 +++++++++++++++++++ .../schemas/vnfConfiguration.schema.json | 56 +++++++++++++++++++ 2 files changed, 112 insertions(+) diff --git a/SOL002/VNFConfiguration-API/schemas/vnfConfigModifications.schema.json b/SOL002/VNFConfiguration-API/schemas/vnfConfigModifications.schema.json index d6d51413e..cf781befc 100644 --- a/SOL002/VNFConfiguration-API/schemas/vnfConfigModifications.schema.json +++ b/SOL002/VNFConfiguration-API/schemas/vnfConfigModifications.schema.json @@ -200,6 +200,62 @@ } } }, + "certificateData": { + "description": "Certificates data to be configured or modified into VNFC instance. Shall be present if delegation-mode is used. Otherwise it shall be absent.\n", + "type": "array", + "items": { + "description": "This type provides input information related to subject of certificate.\nNOTE : Either set of ΓÇ£privatekeyΓÇ¥ and ΓÇ£certificateFileΓÇ¥ or ΓÇ£keystoreFileΓÇ¥ but not both shall be present.\n", + "type": "object", + "properties": { + "privateKey": { + "type": "string", + "description": "Private key paired with the signed public key. VNFM shall generate both the private key and public key and set this attribute. See note.\n" + }, + "certificateFile": { + "type": "string", + "description": "Signed certificate including the public key and certificate chain. See note.\n" + }, + "keystoreFile": { + "type": "string", + "description": "Keystore which includes the private key, signed certificate, and certificate chain (e.g., pkcs#12, pfx). Credentials to read this file shall be provided to the VNF instance by outbound. See note.\n" + }, + "certSubjectData": { + "description": "This type provides input information related to subject of certificate.\n* NOTE: At least one overriding attributes shall be present, otherwise shall be absent.\n", + "type": "object", + "properties": { + "commonName": { + "description": "Information of certification target subject FQDN. See note.", + "type": "string" + }, + "organization": { + "description": "Information of certification target subject Organization. See note.", + "type": "string" + }, + "country": { + "description": "Information of certification target subject Country. See note.", + "type": "string" + }, + "state": { + "description": "Information of certification target subject State. See note.", + "type": "string" + }, + "locality": { + "description": "Information of certification target subject Locality. See note.", + "type": "string" + }, + "emailAddress": { + "description": "Information of certification contact email address. See note.", + "type": "string" + } + } + }, + "certifiateProfileName": { + "type": "string", + "description": "Name of the certificate profile to be signed.\n" + } + } + } + }, "vnfcSpecificData": { "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of keyvalue pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 8259. In the following example, a list of key-value pairs with four keys (\"aString\", \"aNumber\", \"anArray\" and \"anObject\") is provided to illustrate that the values associated with different keys can be of different type.\n", "type": "object" diff --git a/SOL002/VNFConfiguration-API/schemas/vnfConfiguration.schema.json b/SOL002/VNFConfiguration-API/schemas/vnfConfiguration.schema.json index d99f14882..2b95e2321 100644 --- a/SOL002/VNFConfiguration-API/schemas/vnfConfiguration.schema.json +++ b/SOL002/VNFConfiguration-API/schemas/vnfConfiguration.schema.json @@ -191,6 +191,62 @@ } } }, + "certificateData": { + "description": "Certificates data to be configured or modified into VNFC instance. Shall be present if delegation-mode is used. Otherwise it shall be absent.\n", + "type": "array", + "items": { + "description": "This type provides input information related to subject of certificate.\nNOTE : Either set of ΓÇ£privatekeyΓÇ¥ and ΓÇ£certificateFileΓÇ¥ or ΓÇ£keystoreFileΓÇ¥ but not both shall be present.\n", + "type": "object", + "properties": { + "privateKey": { + "type": "string", + "description": "Private key paired with the signed public key. VNFM shall generate both the private key and public key and set this attribute. See note.\n" + }, + "certificateFile": { + "type": "string", + "description": "Signed certificate including the public key and certificate chain. See note.\n" + }, + "keystoreFile": { + "type": "string", + "description": "Keystore which includes the private key, signed certificate, and certificate chain (e.g., pkcs#12, pfx). Credentials to read this file shall be provided to the VNF instance by outbound. See note.\n" + }, + "certSubjectData": { + "description": "This type provides input information related to subject of certificate.\n* NOTE: At least one overriding attributes shall be present, otherwise shall be absent.\n", + "type": "object", + "properties": { + "commonName": { + "description": "Information of certification target subject FQDN. See note.", + "type": "string" + }, + "organization": { + "description": "Information of certification target subject Organization. See note.", + "type": "string" + }, + "country": { + "description": "Information of certification target subject Country. See note.", + "type": "string" + }, + "state": { + "description": "Information of certification target subject State. See note.", + "type": "string" + }, + "locality": { + "description": "Information of certification target subject Locality. See note.", + "type": "string" + }, + "emailAddress": { + "description": "Information of certification contact email address. See note.", + "type": "string" + } + } + }, + "certifiateProfileName": { + "type": "string", + "description": "Name of the certificate profile to be signed.\n" + } + } + } + }, "vnfcSpecificData": { "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of keyvalue pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 8259. In the following example, a list of key-value pairs with four keys (\"aString\", \"aNumber\", \"anArray\" and \"anObject\") is provided to illustrate that the values associated with different keys can be of different type.\n", "type": "object" -- GitLab From b92c322eff136bdb484eccba6fc9f6d4c671f91f Mon Sep 17 00:00:00 2001 From: "mudassar.sabeel" Date: Wed, 11 Sep 2024 15:18:14 +0500 Subject: [PATCH 3/6] implement OAuth scope test for VNFConfiguration API of SOL002 --- .../VNFConfiguration-API/Configuration.robot | 57 ++++++++++++++++++- .../environment/variables.txt | 3 + 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 5d913d40e..2447390af 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -6,6 +6,7 @@ Library JSONSchemaLibrary schemas/ Library OperatingSystem Library String Library DependencyLibrary +Library jwt *** Test Cases *** Set new VNF Configuration @@ -132,8 +133,32 @@ Set new VNF Configuration With Attribute vnfcConfigurationData Check HTTP Response Header Contains ETag and Last-Modified Check HTTP Response Body Json Schema Is vnfConfigModifications Check Postcondition VNF Is Configured - - +Get information about a VNF configuration with permitted authorization scope + [Tags] no-etag + [Documentation] Test ID: 6.3.1.1.10 + ... Test title: Get information about a VNF configuration with permitted authorization scope + ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure + ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured. + ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Get VNF configuration with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfConfiguration +Get information about a VNF configuration with NOT permitted authorization scope + [Tags] no-etag + [Documentation] Test ID: 6.3.1.1.11 + ... Test title: Get information about a VNF configuration with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure + ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured. + ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Get VNF configuration with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Get VNF configuration Log Query VNF The GET method queries information about a configuration. @@ -247,4 +272,30 @@ Check HTTP Response Header Contains [Arguments] ${CONTENT_TYPE} Log ${response['headers']} Should Contain ${response['headers']} ${CONTENT_TYPE} - Log Header is present \ No newline at end of file + Log Header is present +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get VNF configuration with permitted authorization scope + Log Query VNF The GET method queries information about a configuration. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${CONFIGURATION_SCOPE} + ${Authorization_Key}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${Authorization_Key}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiMajorVersion}/configuration + ${output}= Output response + Set Suite Variable ${response} ${output} +Get VNF configuration with not permitted authorization scope + Log Query VNF The GET method queries information about a configuration. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${Authorization_Key}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${Authorization_Key}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiMajorVersion}/configuration + ${output}= Output response + Set Suite Variable ${response} ${output} \ No newline at end of file diff --git a/SOL002/VNFConfiguration-API/environment/variables.txt b/SOL002/VNFConfiguration-API/environment/variables.txt index 2e7355081..763e8b2e2 100644 --- a/SOL002/VNFConfiguration-API/environment/variables.txt +++ b/SOL002/VNFConfiguration-API/environment/variables.txt @@ -10,6 +10,9 @@ ${ACCEPT} application/json ${AUTH_USAGE} 1 ${AUTHORIZATION_HEADER} Authorization ${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${NEG_SCOPE} configuration:v1:invalid +${CONFIGURATION_SCOPE} configuration:v1:invalid +${OAUTH_Encryption_ALGORITHM} HS256 ${CONTENT_TYPE} application/json -- GitLab From c529b4e16b6d5f1a9a236e566a50acd99fbce54c Mon Sep 17 00:00:00 2001 From: "mudassar.sabeel" Date: Fri, 13 Sep 2024 12:38:58 +0500 Subject: [PATCH 4/6] implement Version tag in the header of VNF Configuration API requests as per clause 9.1 S0L013 --- SOL002/VNFConfiguration-API/ApiVersion.robot | 30 ++++++++++++------- .../VNFConfiguration-API/Configuration.robot | 28 +++++++++++------ .../environment/variables.txt | 1 + 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/SOL002/VNFConfiguration-API/ApiVersion.robot b/SOL002/VNFConfiguration-API/ApiVersion.robot index a392e48ce..7e0d66f44 100644 --- a/SOL002/VNFConfiguration-API/ApiVersion.robot +++ b/SOL002/VNFConfiguration-API/ApiVersion.robot @@ -130,70 +130,80 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 2447390af..c4c8287d8 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -162,7 +162,8 @@ Get information about a VNF configuration with NOT permitted authorization scope *** Keywords *** Get VNF configuration Log Query VNF The GET method queries information about a configuration. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Log Execute Query and validate response @@ -172,7 +173,8 @@ Get VNF configuration Send VNF configuration log Trying to perform a PATCH. This method modifies the configuration - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${body}= Get File jsons/vnfConfigModifications.json @@ -215,6 +217,7 @@ Send Duplicated VNF configuration Depends On Test Send VNF configuration # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"If-Match": "${etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} @@ -225,7 +228,8 @@ Send Duplicated VNF configuration Send POST Request for VNF Configuration log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/configuration ${output}= Output response @@ -233,7 +237,8 @@ Send POST Request for VNF Configuration Send PUT Request for VNF Configuration log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/${apiMajorVersion}/configuration ${output}= Output response @@ -241,7 +246,8 @@ Send PUT Request for VNF Configuration Send DELETE Request for VNF Configuration log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/configuration ${output}= Output response @@ -249,7 +255,8 @@ Send DELETE Request for VNF Configuration Send VNF configuration with vnfConfigurationData log Trying to perform a PATCH. This method modifies the configuration when attribute is vnfConfigurationData - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template}= Get File jsons/vnfConfigModificationsWithVnfConfigurationData.json @@ -260,7 +267,8 @@ Send VNF configuration with vnfConfigurationData Send VNF configuration with vnfcConfigurationData log Trying to perform a PATCH. This method modifies the configuration when attribute is vnfcConfigurationData - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template}= Get File jsons/vnfConfigModificationsWithvnfcConfigurationData.json @@ -279,7 +287,8 @@ JWT Encode [Return] ${encoded} Get VNF configuration with permitted authorization scope Log Query VNF The GET method queries information about a configuration. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} ${scope_value}= Create Dictionary scopeValue=${CONFIGURATION_SCOPE} ${Authorization_Key}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} @@ -290,7 +299,8 @@ Get VNF configuration with permitted authorization scope Set Suite Variable ${response} ${output} Get VNF configuration with not permitted authorization scope Log Query VNF The GET method queries information about a configuration. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} ${Authorization_Key}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} diff --git a/SOL002/VNFConfiguration-API/environment/variables.txt b/SOL002/VNFConfiguration-API/environment/variables.txt index 763e8b2e2..bebd011d7 100644 --- a/SOL002/VNFConfiguration-API/environment/variables.txt +++ b/SOL002/VNFConfiguration-API/environment/variables.txt @@ -13,6 +13,7 @@ ${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 ${NEG_SCOPE} configuration:v1:invalid ${CONFIGURATION_SCOPE} configuration:v1:invalid ${OAUTH_Encryption_ALGORITHM} HS256 +${API_VERSION} 1.12.0 ${CONTENT_TYPE} application/json -- GitLab From bbec30b05cb18a03312bcf69739ba11f9a695caf Mon Sep 17 00:00:00 2001 From: "mudassar.sabeel" Date: Fri, 13 Sep 2024 16:19:26 +0500 Subject: [PATCH 5/6] editorial change of updating objectives of OAuth scope test cases --- SOL002/VNFConfiguration-API/Configuration.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index c4c8287d8..0a3fdc1a0 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -137,7 +137,7 @@ Get information about a VNF configuration with permitted authorization scope [Tags] no-etag [Documentation] Test ID: 6.3.1.1.10 ... Test title: Get information about a VNF configuration with permitted authorization scope - ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure + ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure with permitted authorization scope ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured. ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE @@ -150,7 +150,7 @@ Get information about a VNF configuration with NOT permitted authorization scope [Tags] no-etag [Documentation] Test ID: 6.3.1.1.11 ... Test title: Get information about a VNF configuration with not permitted authorization scope - ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure + ... Test objective: The objective is to test the retrieval of an existing VNF instance configuration and perform a JSON schema validation of the collected configuration data structure with not permitted authorization scope ... Pre-conditions: A VNF instance is instantiated. The VNF instance is already configured. ... Reference: Clause 9.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE -- GitLab From b90f91031a7952b1792be0100ddfa9653b6e66fb Mon Sep 17 00:00:00 2001 From: "mudassar.sabeel" Date: Mon, 16 Sep 2024 09:55:27 +0500 Subject: [PATCH 6/6] editorial change of upadting OAuth Test case title, objective and log --- SOL002/VNFConfiguration-API/Configuration.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 0a3fdc1a0..93a73a930 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -286,7 +286,7 @@ JWT Encode ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) [Return] ${encoded} Get VNF configuration with permitted authorization scope - Log Query VNF The GET method queries information about a configuration. + Log Query VNF The GET method queries information about a configuration with permitted authorization scope. Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} @@ -298,7 +298,7 @@ Get VNF configuration with permitted authorization scope ${output}= Output response Set Suite Variable ${response} ${output} Get VNF configuration with not permitted authorization scope - Log Query VNF The GET method queries information about a configuration. + Log Query VNF The GET method queries information about a configuration with not permitted authorization scope. Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} -- GitLab