From 38fe5511ad1f4056764655df73db4c9ff5f007e6 Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Thu, 3 Jul 2025 14:35:03 +0500 Subject: [PATCH 01/12] correct test case TC_MEC_MEC010p2_MEPM_PKGM_002_02_OK --- MEC010p2/MEPM/PKGM/AppPkgMgt.robot | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MEC010p2/MEPM/PKGM/AppPkgMgt.robot b/MEC010p2/MEPM/PKGM/AppPkgMgt.robot index f0710b1..65b4988 100644 --- a/MEC010p2/MEPM/PKGM/AppPkgMgt.robot +++ b/MEC010p2/MEPM/PKGM/AppPkgMgt.robot @@ -93,7 +93,7 @@ TC_MEC_MEC010p2_MEPM_PKGM_002_02_OK [Setup] Create new App Package CreateAppPackage.json Set Suite Variable ${APP_PKG_ID} ${response['body']['id']} Set Suite Variable ${APPD_ID} ${response['body']['appDId']} - Get an individual APP Package identified by ID ${APPD_ID} + Get an individual onboarded APP Package identified by ID ${APPD_ID} Check HTTP Response Status Code Is 200 Validate Json OnboardedAppPkgInfo.schema.json ${response['body']} Should Contain ${response['body']['_links']['self']['href']} ${APP_PKG_ID} @@ -417,6 +417,14 @@ Get an individual APP Package identified by ID ${output}= Output response Set Suite Variable ${response} ${output} +Get an individual onboarded APP Package identified by ID + [Arguments] ${identifier} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"*/*"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/onboarded_app_packages/${identifier} + ${output}= Output response + Set Suite Variable ${response} ${output} GET all app Packages content by appPkgId -- GitLab From f7fa43c46a119730140db770bdfc352bd2de61a1 Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Tue, 15 Jul 2025 12:47:16 +0500 Subject: [PATCH 02/12] modify ResorceQuotaInfo.json, add ResourceQuotaInfo2.json and ResourceQuotaInfo3.json --- MEC048/MEO/CSE/jsons/ResourceQuotaInfo.json | 2 +- MEC048/MEO/CSE/jsons/ResourceQuotaInfo2.json | 3 +++ MEC048/MEO/CSE/jsons/ResourceQuotaInfo3.json | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 MEC048/MEO/CSE/jsons/ResourceQuotaInfo2.json create mode 100644 MEC048/MEO/CSE/jsons/ResourceQuotaInfo3.json diff --git a/MEC048/MEO/CSE/jsons/ResourceQuotaInfo.json b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo.json index fc360ad..6025515 100644 --- a/MEC048/MEO/CSE/jsons/ResourceQuotaInfo.json +++ b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo.json @@ -1,3 +1,3 @@ { - "cpuQuota": "CPU_QUOTA" + "cpuQuota": 1 } \ No newline at end of file diff --git a/MEC048/MEO/CSE/jsons/ResourceQuotaInfo2.json b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo2.json new file mode 100644 index 0000000..d67bc4c --- /dev/null +++ b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo2.json @@ -0,0 +1,3 @@ +{ + "cpuQuota": 2 +} \ No newline at end of file diff --git a/MEC048/MEO/CSE/jsons/ResourceQuotaInfo3.json b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo3.json new file mode 100644 index 0000000..6acfd3e --- /dev/null +++ b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo3.json @@ -0,0 +1,3 @@ +{ + "cpuQuota": 3 +} \ No newline at end of file -- GitLab From 7a61e3757af8dd9d6eacb3fe87928b6d3e5ff218 Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Tue, 15 Jul 2025 12:52:43 +0500 Subject: [PATCH 03/12] correct the retrieve function and remove the redundant check for TC_MEC_MEC048_MEO_CSE_009_OK --- MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index cee7386..ade094b 100644 --- a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot +++ b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot @@ -235,12 +235,9 @@ TC_MEC_MEC048_MEO_CSE_009_OK [Tags] PIC_SERVICES [Setup] Register tenant Info TenantInfo Register mutiple site resource quota Info and get site Ids ${TENANT_ID_1} SiteResourceQuotaInfo SiteResourceQuotaInfo2 SiteResourceQuotaInfo3 - Retrieve all resource quota info resource ${TENANT_ID_1} + Retrieve all site resource quota info resource ${TENANT_ID_1} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is SiteResourceQuotaInfoList - FOR ${element} IN @{response['body']} - Should Be Equal As Strings ${element}[siteId] ${SITE_ID_1} - END Remove mutiple site resource quota Info ${TENANT_ID_1} ${SITE_ID_1} ${SITE_ID_2} ${SITE_ID_3} [Teardown] Remove specific tenant info resource ${TENANT_ID_1} -- GitLab From de95feaea50d1ed279b118723e2fdb9693f8e258 Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Tue, 15 Jul 2025 13:02:33 +0500 Subject: [PATCH 04/12] update Register tenant Info function to only set suite variable if it's an individual call and the status code is not 400 --- MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index ade094b..ef63413 100644 --- a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot +++ b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot @@ -1144,7 +1144,7 @@ Retrieve all tenant info resources with query parameters Set Suite Variable ${response} ${output} Register tenant Info - [Arguments] ${content} + [Arguments] ${content} ${is_individual_call}=${True} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} @@ -1155,7 +1155,7 @@ Register tenant Info POST ${apiRoot}/${apiName}/${apiVersion}/tenants ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Set Suite Variable ${TENANT_ID_1} ${response}[body][tenantId] + Run Keyword If ${is_individual_call} and ${response}[status] != 400 Set Suite Variable ${TENANT_ID_1} ${response}[body][tenantId] Update tenant Info [Arguments] ${tenantId} ${content} -- GitLab From 6f1c80bbf0c0706349301306add5eadd12379999 Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Tue, 15 Jul 2025 13:04:16 +0500 Subject: [PATCH 05/12] modify Update tenant Info function to send request body and only set suite variable if status code is not 400 and 404 --- MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index ef63413..2216364 100644 --- a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot +++ b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot @@ -1166,10 +1166,10 @@ Update tenant Info Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - PUT ${apiRoot}/${apiName}/${apiVersion}/tenants/${tenantId} + PUT ${apiRoot}/${apiName}/${apiVersion}/tenants/${tenantId} ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Set Suite Variable ${TENANT_ID} ${response}[body][tenantId] + Run Keyword If ${response['status']} != 400 and ${response['status']} != 404 Set Suite Variable ${TENANT_ID_1} ${response['body']['tenantId']} Update resource quota Info [Arguments] ${tenantId} ${content} -- GitLab From 86212b69b097fe87612e3c0ba173eca4287b5af7 Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Tue, 15 Jul 2025 13:05:47 +0500 Subject: [PATCH 06/12] correct Update resource quota Info function to send request body and remove the incorrect tenantId suite variable --- MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index 2216364..7b9aafe 100644 --- a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot +++ b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot @@ -1180,10 +1180,9 @@ Update resource quota Info Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - PUT ${apiRoot}/${apiName}/${apiVersion}/tenants/${tenantId}/resources/quota_in_system + PUT ${apiRoot}/${apiName}/${apiVersion}/tenants/${tenantId}/resources/quota_in_system ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Set Suite Variable ${TENANT_ID} ${response}[body][tenantId] Register mutiple tenant Info and get tenant Ids [Arguments] ${content_01} ${content_02} ${content_03} -- GitLab From 2db18b993515cb2d720e6e0f0a2f5e18eab22a2d Mon Sep 17 00:00:00 2001 From: Umair Zafar Date: Tue, 15 Jul 2025 13:07:08 +0500 Subject: [PATCH 07/12] add logic to not set suite variable of tenantId if registering multiple tenant info in Register mutiple tenant Info and get tenant Ids function --- MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index 7b9aafe..04219e5 100644 --- a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot +++ b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot @@ -1186,15 +1186,15 @@ Update resource quota Info Register mutiple tenant Info and get tenant Ids [Arguments] ${content_01} ${content_02} ${content_03} - Register tenant Info ${content_01} + Register tenant Info ${content_01} ${False} Set Suite Variable ${TENANT_ID_1} ${response}[body][tenantId] Set Suite Variable ${CUSTOMER_ID_1} ${response}[body][customerId] Set Suite Variable ${CUSTOMER_NAME_1} ${response}[body][customerName] - Register tenant Info ${content_02} + Register tenant Info ${content_02} ${False} Set Suite Variable ${TENANT_ID_2} ${response}[body][tenantId] Set Suite Variable ${CUSTOMER_ID_2} ${response}[body][customerId] Set Suite Variable ${CUSTOMER_NAME_2} ${response}[body][customerName] - Register tenant Info ${content_03} + Register tenant Info ${content_03} ${False} Set Suite Variable ${TENANT_ID_3} ${response}[body][tenantId] Set Suite Variable ${CUSTOMER_ID_3} ${response}[body][customerId] Set Suite Variable ${CUSTOMER_NAME_3} ${response}[body][customerName] -- GitLab From 880cacc4663b1890c6d3c7264e147ab551f7d3b3 Mon Sep 17 00:00:00 2001 From: Ikram Ul Haq Date: Tue, 22 Jul 2025 16:13:23 +0500 Subject: [PATCH 08/12] update MTS session info JSON files for test validation --- MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json | 3 ++- .../MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json | 2 +- MEC015/SRV/MTS/jsons/MtsSessionInfoSessionSpecific.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json index 93cbbb0..3afd369 100644 --- a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json @@ -1,6 +1,7 @@ { - "appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b", + "appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb", "requestType": 0, + "appName": "appName", "qosD": { "minTpt": 10 }, diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json index c113400..f94afa3 100644 --- a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json @@ -1,5 +1,5 @@ { - "appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b", + "appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb", "requestType": 0, "mtsMode": 0, "trafficDirection": "00" diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoSessionSpecific.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoSessionSpecific.json index 9308f2d..2514a92 100644 --- a/MEC015/SRV/MTS/jsons/MtsSessionInfoSessionSpecific.json +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoSessionSpecific.json @@ -1,6 +1,6 @@ { - "appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b", - "requestType": 1, + "appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb", + "requestType": 0, "mtsMode":4, "trafficDirection":"00", "qosD": { -- GitLab From efebddd7a0a08c3a1a91dddd4f07a45323349805 Mon Sep 17 00:00:00 2001 From: Ikram Ul Haq Date: Tue, 22 Jul 2025 16:45:06 +0500 Subject: [PATCH 09/12] Validate test suite with MEC sandbox and fix multiple issues --- .../SRV/MTS/MultiAccessTrafficSteering.robot | 36 +++++++++++-------- .../SRV/MTS/environment/variables_sandbox.txt | 14 ++++---- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot b/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot index 7e10162..99ccac7 100644 --- a/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot +++ b/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot @@ -8,6 +8,7 @@ Resource ../../../GenericKeywords.robot Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library OperatingSystem Library String +Library Collections *** Test Cases *** TC_MEC_MEC015_SRV_MTS_001_OK @@ -33,7 +34,7 @@ TC_MEC_MEC015_SRV_MTS_002_OK_01 ... ETSI GS MEC 015 v3.1.1, clause 9.3.3.1 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] + Set Suite Variable ${SESSION_ID} ${elements}[-1] Retrieve MTS session list information Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo @@ -50,8 +51,8 @@ TC_MEC_MEC015_SRV_MTS_002_OK_02 ... ETSI GS MEC 015 v3.1.1, clause 9.5.3.1 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] - Retrieve MTS session list information using filter ${APP_NAME_FILTER} ${APP_INSTANCE_ID} + Set Suite Variable ${SESSION_ID} ${elements}[-1] + Retrieve MTS session list information using filter ${CORRECT_FILTER} ${APP_INSTANCE_ID} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo FOR ${mstSessionInfo} IN @{response['body']} @@ -70,7 +71,8 @@ TC_MEC_MEC015_SRV_MTS_002_OK_03 ... ETSI GS MEC 015 v3.1.1, clause 7.2.5, ... ETSI GS MEC 015 v3.1.1, clause 9.5.3.1 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific - + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SESSION_ID} ${elements}[-1] Retrieve MTS session list information using filter ${APP_NAME_FILTER} ${APP_NAME} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo @@ -85,6 +87,8 @@ TC_MEC_MEC015_SRV_MTS_002_OK_03 ... ETSI GS MEC 015 v3.1.1, clause 7.2.5, ... ETSI GS MEC 015 v3.1.1, clause 9.5.3.1 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SESSION_ID} ${elements}[-1] Retrieve MTS session list information using filter ${SESSION_ID_FILTER} ${SESSION_ID} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo @@ -102,7 +106,7 @@ TC_MEC_MEC015_SRV_MTS_002_BR ... ETSI GS MEC 015 v3.1.1, clause 9.5.3.1 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] + Set Suite Variable ${SESSION_ID} ${elements}[-1] Retrieve MTS session list information using filter ${BAD_FILTER} ${APP_INSTANCE_ID} Check HTTP Response Status Code Is 400 @@ -153,8 +157,10 @@ TC_MEC_MEC015_SRV_MTS_003_OK_02 ... ETSI GS MEC 015 v3.1.1, clause 6.2.7 ... ETSI GS MEC 015 v3.1.1, clause 7.2.5 ... ETSI GS MEC 015 v3.1.1, clause 9.5.3.2 - #[Setup] Create new App Instance CreateAppInstanceRequest + [Setup] Create new App Instance CreateAppInstanceRequest Register MTS session MtsSessionInfoSessionSpecific + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SESSION_ID} ${elements}[-1] Check HTTP Response Status Code Is 201 Check HTTP Response Body Json Schema Is MtsSessionInfo ${appInsId} Get value entry from JSON file MtsSessionInfoSessionSpecific appInsId @@ -166,11 +172,13 @@ TC_MEC_MEC015_SRV_MTS_003_OK_02 Should Be Equal As Strings ${response['body']['appInsId']} ${appInsId} Should Be Equal As Strings ${response['body']['requestType']} ${requestType} - Should Be Equal As Strings ${response['body']['flowFilter']} ${flowFilter} + Dictionaries Should Be Equal ${response['body']['flowFilter'][0]} ${flowFilter}[0] Should Be Equal As Strings ${response['body']['qosD']} ${qosD} Should Be Equal As Strings ${response['body']['mtsMode']} ${mtsMode} Should Be Equal As Strings ${response['body']['trafficDirection']} ${trafficDirection} - [TearDown] Delete APP Instance ${APP_INSTANCE_ID} + [TearDown] Unregister from the MTS Service ${SESSION_ID} + Delete APP Instance ${APP_INSTANCE_ID} + TC_MEC_MEC015_SRV_MTS_003_BR [Documentation] @@ -180,7 +188,7 @@ TC_MEC_MEC015_SRV_MTS_003_BR ... ETSI GS MEC 015 v3.1.1, clause 6.2.7 ... ETSI GS MEC 015 v3.1.1, clause 7.2.5 ... ETSI GS MEC 015 v3.1.1, clause 9.5.3.2 - [Setup] Create new App Instance CreateAppInstanceRequest + [Setup] Create new App Instance CreateAppInstanceRequest Register MTS session MtsSessionInfoApplicationSpecific_BR Check HTTP Response Status Code Is 400 [TearDown] Delete APP Instance ${APP_INSTANCE_ID} @@ -195,7 +203,7 @@ TC_MEC_MEC015_SRV_MTS_004_OK ... ETSI GS MEC 015 v3.1.1, clause 9.4.3.1 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] + Set Suite Variable ${SESSION_ID} ${elements}[-1] Retrieve single MTS session ${SESSION_ID} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo @@ -242,7 +250,7 @@ TC_MEC_MEC015_SRV_MTS_005_OK ... ETSI GS MEC 015 v3.1.1, clause 9.4.3.2 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] + Set Suite Variable ${SESSION_ID} ${elements}[-1] Update requested requirements on the MTS Service ${SESSION_ID} MtsSessionInfoApplicationSpecificUpdate Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo @@ -266,7 +274,7 @@ TC_MEC_MEC015_SRV_MTS_005_BR ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] + Set Suite Variable ${SESSION_ID} ${elements}[-1] Update requested requirements on the MTS Service ${SESSION_ID} MtsSessionInfoApplicationSpecificUpdate_BR Check HTTP Response Status Code Is 400 [TearDown] Unregister from the MTS Service And Delete APP Instance ${SESSION_ID} ${APP_INSTANCE_ID} @@ -279,7 +287,7 @@ TC_MEC_MEC015_SRV_MTS_005_NF ... ETSI GS MEC 015 v3.1.1, clause 7.2.5 ... ETSI GS MEC 015 v3.1.1, clause 9.4.3.2 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - #[Setup] Unregister from the MTS Service ${NOT_EXISTING_SESSION_ID} + [Setup] Unregister from the MTS Service ${NOT_EXISTING_SESSION_ID} Update requested requirements on the MTS Service ${NOT_EXISTING_SESSION_ID} MtsSessionInfoApplicationSpecificUpdate Check HTTP Response Status Code Is 404 @@ -294,7 +302,7 @@ TC_MEC_MEC015_SRV_MTS_006_OK ... ETSI GS MEC 015 v3.1.1, clause 9.4.3.3 [Setup] Create new App Instance and Register MTS session CreateAppInstanceRequest MtsSessionInfoApplicationSpecific ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${SESSION_ID} ${elements}[3] + Set Suite Variable ${SESSION_ID} ${elements}[-1] Unregister from the MTS Service ${SESSION_ID} Check HTTP Response Status Code Is 204 diff --git a/MEC015/SRV/MTS/environment/variables_sandbox.txt b/MEC015/SRV/MTS/environment/variables_sandbox.txt index 3901782..8ff761b 100644 --- a/MEC015/SRV/MTS/environment/variables_sandbox.txt +++ b/MEC015/SRV/MTS/environment/variables_sandbox.txt @@ -1,23 +1,23 @@ *** Variables *** # Generic variables ${SCHEMA} https -${HOST} try-mec.etsi.org +${HOST} 192.168.40.50 ${PORT} 443 ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l -${apiRoot} //mep1 +${apiRoot} sbxme1qzq4/mep1 ${apiName} mts ${apiVersion} v1 # Specific variables -${APP_INSTANCE_ID} 81c51643-8c6f-4781-ad45-f8a457ca549b +${APP_INSTANCE_ID} f1e4d448-e277-496b-bf63-98391cfd20fb ${NOT_EXISTING_APP_INSTANCE_ID} NOT_EXISTING_APP_INS_ID ${CORRECT_FILTER} app_instance_id ${APP_NAME_FILTER} app_name ${SESSION_ID_FILTER} session_id ${BAD_FILTER} appInsId -${APP_NAME} app_name +${APP_NAME} appName ${SESSION_ID} 5 ${WRONG_SESSION_ID} WRONG_SESSION_ID @@ -29,9 +29,9 @@ ${TRAFFIC_DIRECTION_DL} 00 ##Variables for App Instances management -${APP_INST_SCHEMA} https -${APP_INST_HOST} try-mec.etsi.org -${APP_INST_PORT} 443 +${APP_INST_SCHEMA} http +${APP_INST_HOST} 192.168.40.50 +${APP_INST_PORT} 80 ${apiRoot_APP_INST} ${apiName_APP_INST} app_lcm ${apiVersion_APP_INST} v1 -- GitLab From 5b8ac7d077906181fb21c16103824d85a0cc3888 Mon Sep 17 00:00:00 2001 From: Ikram Ul Haq Date: Wed, 23 Jul 2025 13:11:24 +0500 Subject: [PATCH 10/12] Update TrafficManagement test suite and related resources for dynamic allocationId handling - Modified TrafficManagement.robot to inject allocationId into request bodies at runtime and fixed related test logic - Updated environment/variables_sandbox.txt for test execution compatibility - Updated BwInfoApplicationSpecific.json, BwInfoDeltas.json, and BwInfoUpdate.json to align with new runtime requirements --- MEC015/SRV/TM/TrafficManagement.robot | 20 ++++++++++++------- .../SRV/TM/environment/variables_sandbox.txt | 4 ++-- .../TM/jsons/BwInfoApplicationSpecific.json | 5 +++-- MEC015/SRV/TM/jsons/BwInfoDeltas.json | 2 +- MEC015/SRV/TM/jsons/BwInfoUpdate.json | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/MEC015/SRV/TM/TrafficManagement.robot b/MEC015/SRV/TM/TrafficManagement.robot index 184f810..ffefc22 100644 --- a/MEC015/SRV/TM/TrafficManagement.robot +++ b/MEC015/SRV/TM/TrafficManagement.robot @@ -8,6 +8,7 @@ Resource ../../../GenericKeywords.robot Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library OperatingSystem Library String +Library Collections *** Test Cases *** @@ -121,8 +122,10 @@ TC_MEC_MEC015_SRV_TM_002_OK ... ETSI GS MEC 015 v3.1.1, clause 6.2.2, ... ETSI GS MEC 015 v3.1.1, clause 7.2.2, ... ETSI GS MEC 015 v3.1.1, clause 8.4.3.4 - [Setup] Create new App Instance CreateAppInstanceRequest + [Setup] Create new App Instance CreateAppInstanceRequest Registration for bandwidth services ${APP_INSTANCE_ID} BwInfoApplicationSpecific + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${ALLOCATION_ID} ${elements}[-1] Check HTTP Response Status Code Is 201 Check HTTP Response Body Json Schema Is BwInfo ${appInsId} Get value entry from JSON file BwInfoApplicationSpecific appInsId @@ -133,7 +136,7 @@ TC_MEC_MEC015_SRV_TM_002_OK Should Be Equal As Strings ${response['body']['requestType']} ${requestType} Should Be Equal As Strings ${response['body']['fixedAllocation']} ${fixedAllocation} Should Be Equal As Strings ${response['body']['allocationDirection']} ${allocationDirection} - [TearDown] Delete App Instance ${APP_INSTANCE_ID} + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} TC_MEC_MEC015_SRV_TM_002_BR_01 @@ -145,7 +148,7 @@ TC_MEC_MEC015_SRV_TM_002_BR_01 [Setup] Create new App Instance CreateAppInstanceRequest Registration for bandwidth services ${APP_INSTANCE_ID} BwInfo_BR Check HTTP Response Status Code Is 400 - [TearDown] Delete App Instance ${APP_INSTANCE_ID} + [TearDown] Delete App Instance ${APP_INSTANCE_ID} TC_MEC_MEC015_SRV_TM_002_BR_02 [Documentation] @@ -195,7 +198,7 @@ TC_MEC_MEC015_SRV_TM_004_OK ... ETSI GS MEC 015 v3.1.1, clause 6.2.4 ... ETSI GS MEC 015 v3.1.1, clause 7.2.2 ... ETSI GS MEC 015 v3.1.1, clause 8.3.3.2 - #[Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate ${appInsId} Get value entry from JSON file BwInfoUpdate appInsId ${fixedAllocation} Get value entry from JSON file BwInfoUpdate fixedAllocation @@ -205,7 +208,7 @@ TC_MEC_MEC015_SRV_TM_004_OK Should Be Equal As Strings ${response['body']['appInsId']} ${appInsId} Should Be Equal As Strings ${response['body']['fixedAllocation']} ${fixedAllocation} Should Be Equal As Strings ${response['body']['allocationDirection']} ${allocationDirection} - #[TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} TC_MEC_MEC015_SRV_TM_004_BR_01 @@ -326,7 +329,7 @@ Create new App Instance and Register for bw service Create new App Instance ${appInstancePayload} Registration for bandwidth services ${APP_INSTANCE_ID} ${bwServicePayload} ${elements} = Split String ${response['headers']['Location']} / - Set Suite Variable ${ALLOCATION_ID} ${elements}[3] + Set Suite Variable ${ALLOCATION_ID} ${elements}[-1] @@ -446,7 +449,10 @@ Request a deltas changes Set Headers {"Authorization":"${TOKEN}"} ${path} Catenate SEPARATOR= jsons/ ${content}.json ${body} Get File ${path} - ${json_object}= Evaluate json.loads('''${body}''') json + ${json_object}= Evaluate json.loads('''${body}''') json + # Inject allocation_id into the JSON object + Set To Dictionary ${json_object} allocationId=${allocation_id} + ${body}= Evaluate json.dumps(${json_object}) json Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} diff --git a/MEC015/SRV/TM/environment/variables_sandbox.txt b/MEC015/SRV/TM/environment/variables_sandbox.txt index 6e72164..f3856ea 100644 --- a/MEC015/SRV/TM/environment/variables_sandbox.txt +++ b/MEC015/SRV/TM/environment/variables_sandbox.txt @@ -6,7 +6,7 @@ ${HOST} try-mec.etsi.org ${PORT} 443 ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l -${apiRoot} //mep1 +${apiRoot} sbxme1qzq4/mep1 ${apiName} bwm ${apiVersion} v1 @@ -17,7 +17,7 @@ ${apiVersion} v1 ${CORRECT_FILTER} app_instance_id ${BAD_FILTER} appInsId -${APP_INSTANCE_ID} 81c51643-8c6f-4781-ad45-f8a457ca549b +${APP_INSTANCE_ID} f1e4d448-e277-496b-bf63-98391cfd20fb ${NON_EXISTENT_APP_INSTANCE_ID} NON_EXISTENT_INSTANCE_ID ${SESSION_ID} 5 ${APP_NAME_FILTER} app_name diff --git a/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json b/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json index a0688f8..5041a81 100644 --- a/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json +++ b/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json @@ -1,6 +1,7 @@ { - "appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b", + "appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb", "requestType": 0, "fixedAllocation": "32", - "allocationDirection": "00" + "allocationDirection": "00", + "appName": "appName" } \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfoDeltas.json b/MEC015/SRV/TM/jsons/BwInfoDeltas.json index d2d8d10..b061288 100644 --- a/MEC015/SRV/TM/jsons/BwInfoDeltas.json +++ b/MEC015/SRV/TM/jsons/BwInfoDeltas.json @@ -1,5 +1,5 @@ { -"appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b", +"appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb", "requestType": 0, "fixedAllocation": "32", "allocationDirection": "01" diff --git a/MEC015/SRV/TM/jsons/BwInfoUpdate.json b/MEC015/SRV/TM/jsons/BwInfoUpdate.json index d2d8d10..b061288 100644 --- a/MEC015/SRV/TM/jsons/BwInfoUpdate.json +++ b/MEC015/SRV/TM/jsons/BwInfoUpdate.json @@ -1,5 +1,5 @@ { -"appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b", +"appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb", "requestType": 0, "fixedAllocation": "32", "allocationDirection": "01" -- GitLab From 202519863d0ef414761d00178e47b5cfff934d88 Mon Sep 17 00:00:00 2001 From: Ikram Ul Haq Date: Mon, 28 Jul 2025 16:27:12 +0500 Subject: [PATCH 11/12] validate and update MEC016 Device Application Interface test suite --- MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot | 4 +- MEC016/MEO/UEAPPCTX/environment/variables.txt | 9 ++- MEC016/MEO/UEAPPCTX/jsons/AppContext.json | 66 +++++++++++++---- MEC016/MEO/UEAPPCTX/jsons/AppContext_BR.json | 66 +++++++++++++---- .../MEO/UEAPPCTX/jsons/UpdateAppContext.json | 69 ++++++++++++++---- .../UEAPPCTX/jsons/UpdateAppContext_BR.json | 70 +++++++++++++++---- .../UEAPPLOC/SysUeApplicationsLocation.robot | 2 +- .../jsons/AppLocationAvailability.json | 36 ++++++++-- .../jsons/AppLocationAvailability_BR.json | 36 ++++++++-- 9 files changed, 288 insertions(+), 70 deletions(-) diff --git a/MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot b/MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot index 736322e..9db53e5 100644 --- a/MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot +++ b/MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot @@ -155,12 +155,12 @@ Update application context Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} ${path} Catenate SEPARATOR= jsons/ ${content} - ${body} Get File ${path} + ${body_template} Get File ${path} + ${body} Replace String ${body_template} __CONTEXT_ID__ ${context_id} Put ${apiRoot}/${apiName}/${apiVersion}/app_contexts/${context_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Update application context using wrong endpoint [Arguments] ${context_id} ${content} Set Headers {"Content-Type":"application/json"} diff --git a/MEC016/MEO/UEAPPCTX/environment/variables.txt b/MEC016/MEO/UEAPPCTX/environment/variables.txt index 2d2e456..230fa06 100644 --- a/MEC016/MEO/UEAPPCTX/environment/variables.txt +++ b/MEC016/MEO/UEAPPCTX/environment/variables.txt @@ -1,11 +1,10 @@ *** Variables *** -${apiRoot} +${apiRoot} sbxme1qzq4/mep1 ${apiName} dev_app ${apiVersion} v1 - -${MEC-APP_SCHEMA} http -${MEC-APP_HOST} mockoon -${MEC-APP_PORT} 3003 +${MEC-APP_SCHEMA} https +${MEC-APP_HOST} 192.168.40.50 +${MEC-APP_PORT} 443 ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l diff --git a/MEC016/MEO/UEAPPCTX/jsons/AppContext.json b/MEC016/MEO/UEAPPCTX/jsons/AppContext.json index 38f4741..97d468c 100644 --- a/MEC016/MEO/UEAPPCTX/jsons/AppContext.json +++ b/MEC016/MEO/UEAPPCTX/jsons/AppContext.json @@ -1,13 +1,55 @@ { - "associateDevAppId":"MyNewWornderfulDevAppId", - "appInfo":{ - "appName":"MyNewWornderfulApp", - "appProvider":"TTF012", - "appDVersion":"v0.0.1", - "userAppInstanceInfo":[ - { - } - ] - } -} - + "associateDevAppId": "MyNewId", + "callbackReference": "http://www.umair.com", + "appInfo": { + "appDId": "onboarded-demo4", + "appName": "MyNewWornderfulApp", + "appProvider": "demo", + "appSoftVersion": "v0.1.0", + "appDVersion": "v0.1.0", + "appDescription": "Basic HTTP Ping Pong", + "userAppInstanceInfo": [ + { + "appInstanceId": "c5f834ae-db0c-4eec-bdfe-3dfc55f91b4a", + "appLocation": { + "area": { + "coordinates": [ + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ], + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ] + ] + }, + "countryCode": "US", + "civicAddressElement": [ + { + "caType": 7, + "caValue": "caValue" + }, + { + "caType": 7, + "caValue": "caValue" + } + ] + }, + "referenceURI": "http://example.com/aeiou" + } + ] + } +} \ No newline at end of file diff --git a/MEC016/MEO/UEAPPCTX/jsons/AppContext_BR.json b/MEC016/MEO/UEAPPCTX/jsons/AppContext_BR.json index 6186f6a..a5e7fc9 100644 --- a/MEC016/MEO/UEAPPCTX/jsons/AppContext_BR.json +++ b/MEC016/MEO/UEAPPCTX/jsons/AppContext_BR.json @@ -1,13 +1,55 @@ { - "associateDevAppId":"MyNewWornderfulDevAppId", - "appInfo":{ - "app":"MyNewWornderfulApp", - "appProvider":"TTF012", - "appDVersion":"v0.0.1", - "userAppInstanceInfo":[ - { - } - ] - } -} - + "associateDevAppId": "MyNewId", + "callbackReference": "http://www.umair.com", + "appInfo": { + "appDId": "onboarded-demo4", + "app": "MyNewWornderfulApp", + "appProvider": "demo", + "appSoftVersion": "v0.1.0", + "appDVersion": "v0.1.0", + "appDescription": "Basic HTTP Ping Pong", + "userAppInstanceInfo": [ + { + "appInstanceId": "c5f834ae-db0c-4eec-bdfe-3dfc55f91b4a", + "appLocation": { + "area": { + "coordinates": [ + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ], + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ] + ] + }, + "countryCode": "US", + "civicAddressElement": [ + { + "caType": 7, + "caValue": "caValue" + }, + { + "caType": 7, + "caValue": "caValue" + } + ] + }, + "referenceURI": "http://example.com/aeiou" + } + ] + } +} \ No newline at end of file diff --git a/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext.json b/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext.json index cd0f9ef..5857a00 100644 --- a/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext.json +++ b/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext.json @@ -1,15 +1,56 @@ { - "associateDevAppId":"MyNewWornderfulDevAppId", - "contextId": "1", - "callbackReference": "http://127.0.0.1/callbackuri", - "appInfo":{ - "appName":"MyNewWornderfulApp", - "appProvider":"TTF012", - "appDVersion":"v0.0.1", - "userAppInstanceInfo":[ - { - } - ] - } -} - + "contextId": "__CONTEXT_ID__", + "associateDevAppId": "MyNewId", + "callbackReference": "http://www.updated-callback.com", + "appInfo": { + "appDId": "onboarded-demo4", + "appName": "MyNewWornderfulApp", + "appProvider": "demo", + "appSoftVersion": "v0.1.0", + "appDVersion": "v0.1.0", + "appDescription": "Basic HTTP Ping Pong", + "userAppInstanceInfo": [ + { + "appInstanceId": "c5f834ae-db0c-4eec-bdfe-3dfc55f91b4a", + "appLocation": { + "area": { + "coordinates": [ + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ], + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ] + ] + }, + "countryCode": "US", + "civicAddressElement": [ + { + "caType": 7, + "caValue": "caValue" + }, + { + "caType": 7, + "caValue": "caValue" + } + ] + }, + "referenceURI": "http://example.com/aeiou" + } + ] + } +} \ No newline at end of file diff --git a/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext_BR.json b/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext_BR.json index dcdd441..40fa57b 100644 --- a/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext_BR.json +++ b/MEC016/MEO/UEAPPCTX/jsons/UpdateAppContext_BR.json @@ -1,15 +1,57 @@ { - "associateUeAppId":"MyNewWornderfulDevAppId", - "contextId": "1", - "callbackReference": "http://127.0.0.1/callbackuri", - "appInfo":{ - "appName":"MyNewWornderfulApp", - "appProvider":"TTF012", - "appDVersion":"v0.0.1", - "userAppInstanceInfo":[ - { - } - ] - } -} - + "contextId": "__CONTEXT_ID__", + "associateDevAppId": "MyNewId", + "associateUeAppId": "some_value", + "callbackReference": "http://www.updated-callback.com", + "appInfo": { + "appDId": "onboarded-demo4", + "appName": "MyNewWornderfulApp", + "appProvider": "demo", + "appSoftVersion": "v0.1.0", + "appDVersion": "v0.1.0", + "appDescription": "Basic HTTP Ping Pong", + "userAppInstanceInfo": [ + { + "appInstanceId": "c5f834ae-db0c-4eec-bdfe-3dfc55f91b4a", + "appLocation": { + "area": { + "coordinates": [ + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ], + [ + [ + 2.302136, + 2.302136 + ], + [ + 2.302136, + 2.302136 + ] + ] + ] + }, + "countryCode": "US", + "civicAddressElement": [ + { + "caType": 7, + "caValue": "caValue" + }, + { + "caType": 7, + "caValue": "caValue" + } + ] + }, + "referenceURI": "http://example.com/aeiou" + } + ] + } +} \ No newline at end of file diff --git a/MEC016/MEO/UEAPPLOC/SysUeApplicationsLocation.robot b/MEC016/MEO/UEAPPLOC/SysUeApplicationsLocation.robot index e58b290..f8626b5 100644 --- a/MEC016/MEO/UEAPPLOC/SysUeApplicationsLocation.robot +++ b/MEC016/MEO/UEAPPLOC/SysUeApplicationsLocation.robot @@ -20,7 +20,7 @@ TP_MEC_MEC016_MEO_UEAPPLOC_001_OK Obtain Application Location Availability Task AppLocationAvailability.json Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is ApplicationLocationAvailability - Should Be Equal As Strings ${response['body']['appInfo']['appName']} MyNewWornderfulApp + Should Be Equal As Strings ${response['body']['appInfo']['appName']} onboarded-demo4 TP_MEC_MEC016_MEO_UEAPPLOC_001_BR diff --git a/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability.json b/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability.json index fdf8d3a..db0cf53 100644 --- a/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability.json +++ b/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability.json @@ -1,8 +1,34 @@ { - "associateDevAppId":"MyNewWornderfulDevAppId", + "associateDevAppId":"onboarded-demo4", "appInfo":{ - "appName":"MyNewWornderfulApp", - "appProvider":"TF012", - "appDVersion":"v0.0.1" - } + "appName": "onboarded-demo4", + "appProvider": "ETSI", + "appSoftVersion": "v0.1.0", + "appDVersion": "v0.1.0", + "appDescription": "Basic HTTP Ping Pong", + "availableLocations": [ + { + "appLocation": { + "countryCode": "492", + "civicAddressElement": [ + { "caType": 1, "caValue": "A1" }, + { "caType": 2, "caValue": "A2" } + ], + "area": { + "coordinates": [ + [ + [2.302136, 2.302136], + [2.302136, 2.302136] + ], + [ + [2.302136, 2.302136], + [2.302136, 2.302136] + ] + ] + } + } + } + ], + "appPackageSource": "http://example.com/aeiou" +} } \ No newline at end of file diff --git a/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability_BR.json b/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability_BR.json index d907dd4..c444b8f 100644 --- a/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability_BR.json +++ b/MEC016/MEO/UEAPPLOC/jsons/AppLocationAvailability_BR.json @@ -1,8 +1,34 @@ { - "associateDevAppId":"MyNewWornderfulDevAppId", + "associateDevAppId":"onboarded-demo4", "appInfo":{ - "app":"MyNewWornderfulApp", - "appProvider":"TF012", - "appDVersion":"v0.0.1" - } + "app": "onboarded-demo4", + "appProvider": "ETSI", + "appSoftVersion": "v0.1.0", + "appDVersion": "v0.1.0", + "appDescription": "Basic HTTP Ping Pong", + "availableLocations": [ + { + "appLocation": { + "countryCode": "492", + "civicAddressElement": [ + { "caType": 1, "caValue": "A1" }, + { "caType": 2, "caValue": "A2" } + ], + "area": { + "coordinates": [ + [ + [2.302136, 2.302136], + [2.302136, 2.302136] + ], + [ + [2.302136, 2.302136], + [2.302136, 2.302136] + ] + ] + } + } + } + ], + "appPackageSource": "http://example.com/aeiou" +} } \ No newline at end of file -- GitLab From 4ab98dfe7efdfad1a55ae454759d8e68ac8b1376 Mon Sep 17 00:00:00 2001 From: Ikram Ul Haq Date: Wed, 30 Jul 2025 17:17:37 +0500 Subject: [PATCH 12/12] Validate MEC048 test suite and fix notification and teardown issues --- .../CSE/CustomerSelfServiceEnablement.robot | 197 ++++++++++-------- MEC048/MEO/CSE/environment/variables.txt | 4 +- .../jsons/SiteResourceUsageSubscription.json | 21 +- .../jsons/SiteResourceUsageSubscription1.json | 13 +- .../SiteResourceUsageSubscriptionBR.json | 10 +- .../SiteResourceUsageSubscriptionUpdate.json | 10 +- 6 files changed, 144 insertions(+), 111 deletions(-) diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index 04219e5..9733c93 100644 --- a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot +++ b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot @@ -333,7 +333,7 @@ TC_MEC_MEC048_MEO_CSE_012_OK Should Be Equal As Integers ${response['body']['memoryQuota']} ${MEMORY_QUOTA_VALUE} Should Be Equal As Integers ${response['body']['diskQuota']} ${DISK_QUOTA_VALUE} - [Teardown] Remove tenant and site resources + [Teardown] Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_012_BR [Documentation] TP_MEC_MEC048_MEO_CSE_012_BR @@ -344,7 +344,7 @@ TC_MEC_MEC048_MEO_CSE_012_BR # Attempt to update the site resource quota with invalid data Update site resource quota Info ${TENANT_ID_1} ${SITE_ID_1} SiteResourceQuotaInfoBR Check HTTP Response Status Code Is 400 - [Teardown] Remove tenant and site resources + [Teardown] Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_012_NF [Documentation] TP_MEC_MEC048_MEO_CSE_012_NF @@ -461,7 +461,7 @@ TC_MEC_MEC048_MEO_CSE_014_OK_02 [Setup] Register site resource quota for tenant # Create a new SiteResourceUsageSubscription - Register subscription SiteResourceUsageSubscription1 + Register site Resource subscription SiteResourceUsageSubscription1 # Verify response status code Check HTTP Response Status Code Is 201 @@ -499,8 +499,8 @@ TC_MEC_MEC048_MEO_CSE_014_OK_02 # Teardown - clean up the created resources [Teardown] Run Keywords ... Delete Created Subscription AND - ... Remove tenant and site resources - + ... Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} AND + ... Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_014_BR [Documentation] TP_MEC_MEC048_MEO_CSE_014_BR ... Check that the IUT returns an error on creating a new subscription when requested to a CSE @@ -527,16 +527,21 @@ TC_MEC_MEC048_MEO_CSE_015_OK ... ETSI GS MEC 048 v3.1.1, clause 7.9.3.1, clause 6.3.2, clause 6.3.3 [Tags] PIC_SERVICES - # Setup - Create a tenant, site resources, and subscription - [Setup] Register site resource quota for tenant + # Setup - Create a tenant and site resources + [Setup] Run Keywords + ... Register site resource quota for tenant - # Create a SiteResourceUsageSubscription - Register subscription SiteResourceUsageSubscription + Register site Resource subscription SiteResourceUsageSubscription - # Save the subscription ID for later retrieval and cleanup + # Verify subscription creation + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is SiteResourceUsageSubscription + + # Save the subscription ID for retrieval and cleanup ${subscription_uri}= Set Variable ${response['body']['_links']['self']['href']} - ${subscription_id}= Fetch From Right ${subscription_uri} /subscriptions/ - Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_uri} + ${subscription_id}= Evaluate "${subscription_uri}".split("/")[-1] + Run Keyword If '${subscription_id}' == '' Fail Failed to extract subscription ID from ${subscription_uri} + Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_id} # Retrieve the specific subscription Retrieve specific subscription ${subscription_id} @@ -568,8 +573,9 @@ TC_MEC_MEC048_MEO_CSE_015_OK # Teardown - clean up the created resources [Teardown] Run Keywords - ... Delete Created Subscription AND - ... Remove tenant and site resources + ... Run Keyword If '${SUBSCRIPTION_ID}' != '' and '${SUBSCRIPTION_ID}' != 'None' Delete Created Subscription + ... AND Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} + ... AND Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_015_NF [Documentation] TP_MEC_MEC048_MEO_CSE_015_NF @@ -588,57 +594,35 @@ TC_MEC_MEC048_MEO_CSE_016_OK ... Check that the IUT updates an existing subscription when requested by a CSE ... ETSI GS MEC 048 v3.1.1, clause 7.9.3.2, clause 6.3.2, clause 6.3.3 [Tags] PIC_SERVICES - - # Setup - Create a tenant, site resources, and subscription [Setup] Register site resource quota for tenant - - # Create a SiteResourceUsageSubscription to be updated later - Register subscription SiteResourceUsageSubscription - - # Save the subscription ID for update and cleanup + Register site Resource subscription SiteResourceUsageSubscription ${subscription_uri}= Set Variable ${response['body']['_links']['self']['href']} - ${subscription_id}= Fetch From Right ${subscription_uri} /subscriptions/ - Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_uri} + ${subscription_id}= Evaluate "${subscription_uri}".split("/")[-1] + Run Keyword If '${subscription_id}' == '' Fail Failed to extract subscription ID from ${subscription_uri} + Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_id} Set Suite Variable ${OLD_CUSTOMER_ID} ${response['body']['customerId']} - - # Create another tenant to get a new customer ID - Register tenant Info TenantInfo2 + Register tenant Info TenantInfo2 ${True} TENANT_ID_2 Set Suite Variable ${NEW_CUSTOMER_ID} ${response['body']['customerId']} Set Suite Variable ${TENANT_ID_2} ${response['body']['tenantId']} - - # Update the subscription with the new customer ID Update subscription ${subscription_id} SiteResourceUsageSubscriptionUpdate - - # Verify response status code Check HTTP Response Status Code Is 200 - - # Verify response body schema Check HTTP Response Body Json Schema Is SiteResourceUsageSubscription - - # Verify response body content - specifically that the customerId has been updated Should Be Equal As Strings ${response['body']['subscriptionType']} SiteResourceUsageSubscription Should Be Equal As Strings ${response['body']['customerId']} ${NEW_CUSTOMER_ID} Should Not Be Equal As Strings ${response['body']['customerId']} ${OLD_CUSTOMER_ID} Should Be Equal As Strings ${response['body']['tenantId']} ${TENANT_ID_1} Should Be Equal As Strings ${response['body']['callbackReference']} some/uri/updated - - # Verify siteList contains our test site ${siteList}= Get From Dictionary ${response['body']} siteList List Should Contain Value ${siteList} ${SITE_ID_1} - - # Verify notification trigger details Should Be Equal As Integers ${response['body']['notificationTrigger']['triggerType']} 10 Should Be Equal As Integers ${response['body']['notificationTrigger']['threshold']} 4 Should Be Equal ${response['body']['notificationTrigger']['greaterOrLess']} ${FALSE} - - # Verify self-link in response Should Not Be Empty ${response['body']['_links']['self']['href']} Should Be Equal As Strings ${response['body']['_links']['self']['href']} ${subscription_uri} - - # Teardown - clean up the created resources [Teardown] Run Keywords ... Delete Created Subscription AND - ... Remove tenant and site resources AND + ... Run Keyword If '${SITE_ID_1}' != '' and '${SITE_ID_1}' != 'None' Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} AND + ... Remove specific tenant info resource ${TENANT_ID_1} AND ... Remove specific tenant info resource ${TENANT_ID_2} TC_MEC_MEC048_MEO_CSE_016_NF @@ -663,7 +647,8 @@ TC_MEC_MEC048_MEO_CSE_016_NF # Teardown - clean up the created resources [Teardown] Run Keywords - ... Remove tenant and site resources AND + ... Run Keyword If '${SITE_ID_1}' != '' and '${SITE_ID_1}' != 'None' Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} AND + ... Remove specific tenant info resource ${TENANT_ID_1} AND ... Remove specific tenant info resource ${TENANT_ID_2} TC_MEC_MEC048_MEO_CSE_016_BR @@ -681,10 +666,10 @@ TC_MEC_MEC048_MEO_CSE_016_BR # Save the subscription ID for update and cleanup ${subscription_uri}= Set Variable ${response['body']['_links']['self']['href']} ${subscription_id}= Fetch From Right ${subscription_uri} /subscriptions/ - Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_uri} + Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_id} # Create another tenant to get a new customer ID for the update - Register tenant Info TenantInfo2 + Register tenant Info TenantInfo2 ${True} TENANT_ID_2 Set Suite Variable ${NEW_CUSTOMER_ID} ${response['body']['customerId']} Set Suite Variable ${TENANT_ID_2} ${response['body']['tenantId']} @@ -696,9 +681,10 @@ TC_MEC_MEC048_MEO_CSE_016_BR # Teardown - clean up the created resources [Teardown] Run Keywords - ... Delete Created Subscription AND - ... Remove tenant and site resources AND - ... Remove specific tenant info resource ${TENANT_ID_2} + ... Run Keyword If '${SUBSCRIPTION_ID}' != '' and '${SUBSCRIPTION_ID}' != 'None' Delete Created Subscription AND + ... Run Keyword If '${SITE_ID_1}' != '' and '${SITE_ID_1}' != 'None' Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} AND + ... Run Keyword If '${TENANT_ID_1}' != '' and '${TENANT_ID_1}' != 'None' Remove specific tenant info resource ${TENANT_ID_1} AND + ... Run Keyword If '${TENANT_ID_2}' != '' and '${TENANT_ID_2}' != 'None' Remove specific tenant info resource ${TENANT_ID_2} TC_MEC_MEC048_MEO_CSE_017_OK [Documentation] TP_MEC_MEC048_MEO_CSE_017_OK @@ -727,7 +713,9 @@ TC_MEC_MEC048_MEO_CSE_017_OK Check HTTP Response Status Code Is 404 # Teardown - clean up the created resources (only tenant and site as subscription is deleted) - [Teardown] Remove tenant and site resources + [Teardown] Run Keywords + ... Run Keyword If '${SITE_ID_1}' != '' and '${SITE_ID_1}' != 'None' Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} AND + ... Run Keyword If '${TENANT_ID_1}' != '' and '${TENANT_ID_1}' != 'None' Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_017_NF [Documentation] TP_MEC_MEC048_MEO_CSE_017_NF @@ -765,11 +753,11 @@ TC_MEC_MEC048_MEO_CSE_018_OK # Save the subscription ID for cleanup ${subscription_uri}= Set Variable ${response['body']['_links']['self']['href']} ${subscription_id}= Fetch From Right ${subscription_uri} /subscriptions/ - Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_uri} + Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_id} # Generate load to trigger the notification Log Generating CPU load to trigger notification - ${result}= Generate CPU Load 60 4 + ${result}= Generate CPU Load 60 5 Log ${result} # Start the notification server to wait for and capture the notification @@ -789,8 +777,9 @@ TC_MEC_MEC048_MEO_CSE_018_OK # Teardown - clean up resources [Teardown] Run Keywords - ... Delete Created Subscription AND - ... Remove tenant and site resources + ... Run Keyword If '${SUBSCRIPTION_ID}' != '' and '${SUBSCRIPTION_ID}' != 'None' Delete Created Subscription AND + ... Run Keyword If '${SITE_ID_1}' != '' and '${SITE_ID_1}' != 'None' Remove specific site resource quota info resource ${TENANT_ID_1} ${SITE_ID_1} AND + ... Run Keyword If '${TENANT_ID_1}' != '' and '${TENANT_ID_1}' != 'None' Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_019_OK [Documentation] TP_MEC_MEC048_MEO_CSE_019_OK @@ -801,29 +790,29 @@ TC_MEC_MEC048_MEO_CSE_019_OK # Setup - Create a tenant for the subscription [Setup] Register tenant Info TenantInfo - # Create a ResourceUsageSubscription with callback to our notification server + # Create a ResourceUsageSubscription with callback to notification server ${subscription_json}= Get File jsons/ResourceUsageSubscription.json ${callback_url}= Set Variable http://${NOTIFICATION_SERVER_IP}:${NOTIFICATION_SERVER_PORT}${NOTIFICATION_SERVER_URI} ${subscription_json}= Replace String ${subscription_json} "some/uri" "${callback_url}" - ${subscription_json}= Replace String ${subscription_json} "tenant-123" "${TENANT_ID_1}" + ${subscription_json}= Replace String ${subscription_json} "tenant-123" "${TENANT_ID_1}" ${subscription_json}= Replace String ${subscription_json} "customer-123" "${CUSTOMER_ID_1}" - # Register the subscription with our callback URL + # Register the subscription Post Raw Subscription ${subscription_json} Check HTTP Response Status Code Is 201 # Save the subscription ID for cleanup ${subscription_uri}= Set Variable ${response['body']['_links']['self']['href']} ${subscription_id}= Fetch From Right ${subscription_uri} /subscriptions/ - Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_uri} + Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_id} - # Generate load to trigger the notification - Log Generating CPU load to trigger notification - ${result}= Generate CPU Load 60 4 + # Generate CPU load to trigger the notification + Log Generating CPU load to trigger notification (cpuUsed: 5) + ${result}= Generate CPU Load 60 5 Log ${result} - # Start the notification server to wait for and capture the notification - ${notification}= Spawn Resource Notification Server + # Start the notification server to capture the notification + ${notification}= Spawn Notification Server # Verify notification exists Should Not Be Empty ${notification} @@ -838,8 +827,8 @@ TC_MEC_MEC048_MEO_CSE_019_OK # Teardown - clean up resources [Teardown] Run Keywords - ... Delete Created Subscription AND - ... Remove specific tenant info resource ${TENANT_ID_1} + ... Run Keyword If '${SUBSCRIPTION_ID}' != '' and '${SUBSCRIPTION_ID}' != 'None' Delete Created Subscription AND + ... Run Keyword If '${TENANT_ID_1}' != '' and '${TENANT_ID_1}' != 'None' Remove specific tenant info resource ${TENANT_ID_1} TC_MEC_MEC048_MEO_CSE_020_OK [Documentation] TP_MEC_MEC048_MEO_CSE_020_OK @@ -850,52 +839,51 @@ TC_MEC_MEC048_MEO_CSE_020_OK # Setup - Create a tenant for the subscription [Setup] Register tenant Info TenantInfo - # Get the current time and add a short time for expiry deadline (10 seconds in the future) + # Get the current time and add a short expiry deadline (10 seconds in the future) ${current_time}= Get Current Date ${expiry_time}= Add Time To Date ${current_time} 10 seconds ${expiry_time_iso}= Convert Date ${expiry_time} result_format=%Y-%m-%dT%H:%M:%SZ Set Suite Variable ${EXPIRY_DEADLINE} ${expiry_time_iso} - # Create a ResourceUsageSubscription with a short expiry time and callback to our notification server + # Create a ResourceUsageSubscription with expiry ${subscription_json}= Get File jsons/ResourceUsageSubscriptionWithExpiry.json ${callback_url}= Set Variable http://${NOTIFICATION_SERVER_IP}:${NOTIFICATION_SERVER_PORT}${NOTIFICATION_SERVER_URI} ${subscription_json}= Replace String ${subscription_json} "some/uri" "${callback_url}" - ${subscription_json}= Replace String ${subscription_json} "tenant-123" "${TENANT_ID_1}" + ${subscription_json}= Replace String ${subscription_json} "tenant-123" "${TENANT_ID_1}" ${subscription_json}= Replace String ${subscription_json} "customer-123" "${CUSTOMER_ID_1}" ${subscription_json}= Replace String ${subscription_json} "2099-12-31T23:59:59Z" "${EXPIRY_DEADLINE}" - # Register the subscription with our callback URL + # Register the subscription Post Raw Subscription ${subscription_json} Check HTTP Response Status Code Is 201 - # Save the subscription ID and HREF for verification + # Save the subscription ID and HREF ${subscription_uri}= Set Variable ${response['body']['_links']['self']['href']} ${subscription_id}= Fetch From Right ${subscription_uri} /subscriptions/ Set Suite Variable ${SUBSCRIPTION_ID} ${subscription_id} Set Suite Variable ${SUBSCRIPTION_HREF} ${subscription_uri} - # Start the notification server to wait for and capture the expiry notification - # Need to wait for the subscription to expire (a bit longer than our expiry time) - ${notification}= Spawn Expiry Notification Server + # Trigger subscription expiry + Log Waiting for subscription to expire + Sleep 12s # Wait past the 10-second expiry deadline + + # Start the notification server to capture the expiry notification + ${notification}= Spawn Notification Server # Verify notification exists Should Not Be Empty ${notification} # Verify notification content Should Be Equal As Strings ${notification['notificationType']} ExpiryNotification - - # Verify subscription link in the notification Should Be Equal As Strings ${notification['_links']['subscription']['href']} ${SUBSCRIPTION_HREF} - - # Verify expiry deadline matches what we set Should Be Equal As Strings ${notification['expiryDeadline']} ${EXPIRY_DEADLINE} - # Verify the subscription no longer exists/is expired + # Verify the subscription no longer exists Retrieve specific subscription ${SUBSCRIPTION_ID} Check HTTP Response Status Code Is 404 - # Teardown - clean up tenant (subscription should be auto-removed after expiry) - [Teardown] Remove specific tenant info resource ${TENANT_ID_1} + # Teardown - clean up tenant (subscription auto-removed after expiry) + [Teardown] Run Keyword If '${TENANT_ID_1}' != '' and '${TENANT_ID_1}' != 'None' Remove specific tenant info resource ${TENANT_ID_1} *** Keywords *** @@ -934,10 +922,11 @@ Update subscription Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - # Replace placeholder values in the JSON with actual test values - ${body}= Replace String ${body} "tenant-123" "${TENANT_ID_1}" + Log Variables - TENANT_ID_1: ${TENANT_ID_1}, TENANT_ID_2: ${TENANT_ID_2}, NEW_CUSTOMER_ID: ${NEW_CUSTOMER_ID}, SITE_ID_1: ${SITE_ID_1} + ${body}= Replace String ${body} "placeholder-tenant" "${TENANT_ID_1}" ${body}= Replace String ${body} "customer-new" "${NEW_CUSTOMER_ID}" ${body}= Replace String ${body} "site-placeholder" "${SITE_ID_1}" + Log Request body after replacements: ${body} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscription_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -950,6 +939,7 @@ Retrieve specific subscription Set Headers {"Authorization":"${TOKEN}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscription_id} ${output}= Output response + Log GET Response: ${output} Set Suite Variable ${response} ${output} Create ResourceUsageSubscription @@ -981,6 +971,36 @@ Retrieve subscriptions with filter ${output}= Output response Set Suite Variable ${response} ${output} +Register site Resource subscription + [Arguments] ${content} + Should Be True ${PIC_MEC_PLAT} == 1 msg=PIC_MEC_PLAT must be 1 + Should Be True ${PIC_SERVICES} == 1 msg=PIC_SERVICES must be 1 + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + Log Loading JSON file: ${file} + ${file_exists}= Run Keyword And Return Status File Should Exist ${file} + Run Keyword If not ${file_exists} Fail JSON file not found: ${file} + ${body}= Get File ${file} + Log Request Body Before Replacement: ${body} + # Validate variables + Should Not Be Empty ${TENANT_ID_1} msg=TENANT_ID_1 is not defined + Should Not Be Empty ${CUSTOMER_ID_1} msg=CUSTOMER_ID_1 is not defined + Should Not Be Empty ${SITE_ID_1} msg=SITE_ID_1 is not defined + # Replace placeholders + ${body}= Replace String ${body} "placeholder-tenant" "${TENANT_ID_1}" + ${body}= Replace String ${body} "placeholder-customer" "${CUSTOMER_ID_1}" + ${body}= Replace String ${body} "placeholder-site" "${SITE_ID_1}" + Log Request Body After Replacement: ${body} + # Validate JSON using Collections + # ${json_dict}= Evaluate json.loads($body) modules=json + # Should Be True isinstance($json_dict, dict) msg=JSON is not a valid dictionary: ${body} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${output}= Output response + Log POST Response: ${output} + Set Suite Variable ${response} ${output} + Run Keyword If ${response['status']} != 201 Fail Subscription creation failed: ${response['body']['error']} status=${response['status']} Register subscription [Arguments] ${content} Should Be True ${PIC_MEC_PLAT} == 1 @@ -990,9 +1010,11 @@ Register subscription Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - # Replace placeholder values in the JSON with actual test values - ${body}= Replace String ${body} "tenant-123" "${TENANT_ID_1}" - ${body}= Replace String ${body} "customer-123" "${CUSTOMER_ID_1}" + Log Variables - TENANT_ID_1: ${TENANT_ID_1}, CUSTOMER_ID_1: ${CUSTOMER_ID_1}, SITE_ID_1: ${SITE_ID_1} + ${body}= Replace String ${body} "placeholder-tenant" "${TENANT_ID_1}" + ${body}= Replace String ${body} "placeholder-customer" "${CUSTOMER_ID_1}" + ${body}= Replace String ${body} "placeholder-site" "${SITE_ID_1}" + Log Request body after replacements: ${body} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -1061,6 +1083,7 @@ Register site resource quota for tenant # Create tenant Register tenant Info TenantInfo Set Suite Variable ${TENANT_ID_1} ${response['body']['tenantId']} + Set Suite Variable ${CUSTOMER_ID_1} ${response['body']['customerId']} # Create site resource quota Register site resource quota Info ${TENANT_ID_1} SiteResourceQuotaInfo Set Suite Variable ${SITE_ID_1} ${response['body']['siteId']} @@ -1144,7 +1167,7 @@ Retrieve all tenant info resources with query parameters Set Suite Variable ${response} ${output} Register tenant Info - [Arguments] ${content} ${is_individual_call}=${True} + [Arguments] ${content} ${is_individual_call}=${True} ${tenant_var}=TENANT_ID_1 Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} @@ -1155,7 +1178,7 @@ Register tenant Info POST ${apiRoot}/${apiName}/${apiVersion}/tenants ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Run Keyword If ${is_individual_call} and ${response}[status] != 400 Set Suite Variable ${TENANT_ID_1} ${response}[body][tenantId] + Run Keyword If ${is_individual_call} and ${response}[status] != 400 Set Suite Variable \${${tenant_var}} ${response}[body][tenantId] Update tenant Info [Arguments] ${tenantId} ${content} diff --git a/MEC048/MEO/CSE/environment/variables.txt b/MEC048/MEO/CSE/environment/variables.txt index d66e161..1b69a94 100644 --- a/MEC048/MEO/CSE/environment/variables.txt +++ b/MEC048/MEO/CSE/environment/variables.txt @@ -3,10 +3,10 @@ ${SCHEMA} http ${HOST} 127.0.0.1 #${HOST} 10.192.2.172 -${PORT} 8081 +${PORT} 5000 ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l -${apiRoot} +${apiRoot} ${apiName} cse ${apiVersion} v1 diff --git a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription.json b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription.json index 63dc110..f4f9e39 100644 --- a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription.json +++ b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription.json @@ -1,12 +1,17 @@ { "subscriptionType": "SiteResourceUsageSubscription", - "callbackReference": "http://example.org/callback3", - "customerId": "customer-123", - "tenantId": "tenant-123", - "siteId": "site-456", + "callbackReference": "some/uri", + "_links": { + "self": { + "href": "LINK_TO_THE_RESOURCE" + } + }, + "customerId": "placeholder-customer", + "tenantId": "placeholder-tenant", + "siteList": ["placeholder-site"], "notificationTrigger": { - "triggerType": 30, - "threshold": 90, - "greaterOrLess": true + "triggerType": 10, + "threshold": 4, + "greaterOrLess": false } - } \ No newline at end of file +} \ No newline at end of file diff --git a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription1.json b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription1.json index e2e941a..f4f9e39 100644 --- a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription1.json +++ b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription1.json @@ -1,12 +1,17 @@ { "subscriptionType": "SiteResourceUsageSubscription", "callbackReference": "some/uri", + "_links": { + "self": { + "href": "LINK_TO_THE_RESOURCE" + } + }, "customerId": "placeholder-customer", "tenantId": "placeholder-tenant", "siteList": ["placeholder-site"], "notificationTrigger": { - "triggerType": 10, - "threshold": 4, - "greaterOrLess": false + "triggerType": 10, + "threshold": 4, + "greaterOrLess": false } - } \ No newline at end of file +} \ No newline at end of file diff --git a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionBR.json b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionBR.json index c7d3aa4..26d0e34 100644 --- a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionBR.json +++ b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionBR.json @@ -1,11 +1,11 @@ { "subscriptionType": "SiteResourceUsageSubscription", "customerId": "customer-new", - "tenantId": "tenant-123", + "tenantId": "placeholder-tenant", "siteList": ["site-placeholder"], "notificationTrigger": { - "triggerType": 10, - "threshold": 4, - "greaterOrLess": false + "triggerType": 10, + "threshold": 4, + "greaterOrLess": false } - } \ No newline at end of file +} \ No newline at end of file diff --git a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionUpdate.json b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionUpdate.json index fbbdd8b..723aa32 100644 --- a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionUpdate.json +++ b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscriptionUpdate.json @@ -2,11 +2,11 @@ "subscriptionType": "SiteResourceUsageSubscription", "callbackReference": "some/uri/updated", "customerId": "customer-new", - "tenantId": "tenant-123", + "tenantId": "placeholder-tenant", "siteList": ["site-placeholder"], "notificationTrigger": { - "triggerType": 10, - "threshold": 4, - "greaterOrLess": false + "triggerType": 10, + "threshold": 4, + "greaterOrLess": false } - } \ No newline at end of file +} \ No newline at end of file -- GitLab