diff --git a/MEC010p2/MEPM/PKGM/AppPkgMgt.robot b/MEC010p2/MEPM/PKGM/AppPkgMgt.robot index f0710b1a3056f0f4ef9d0af94c7d32ad87f22c93..65b4988449a412a833042e22bbd551c58588a4b4 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 diff --git a/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot b/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot index 7e101627f6217e7751ca42399d8c2460155a8847..99ccac7dd2e7175f5487751915b749cd28c158aa 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 3901782f4e93dfdfda6cff09e3a869baf240dc2a..8ff761b8981ab2ddaee932a73ba8ceae08172a84 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 diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json index 93cbbb05b5ee774b87a3f45fc0f473e695d85f56..3afd369b6f738903dc47b483c1a2eb9c80a4c57c 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 c1134009bac06d405e718b6f3cfcd8f511bdcef9..f94afa3c0926afac9896738927b2542b9015270b 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 9308f2d378063de56572b23dacac60fac29267ea..2514a926d929dc14500941c4a46ea02889e76fcb 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": { diff --git a/MEC015/SRV/TM/TrafficManagement.robot b/MEC015/SRV/TM/TrafficManagement.robot index 184f810f045b3cd5febc3abda7bb4d1c346127a9..ffefc22f8013cf68c628e33952a856a29a8cb166 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 6e72164d75ff2d537e7139d4f20e27f03d997b4e..f3856ea22e439031d622eab3140a7c633ee36902 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 a0688f891dd5d97f06a5efbda055314ef97b692a..5041a812e9aab69743c9fbe1d8be5f92cf52f696 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 d2d8d10069c9ed5ff909882247c872ad2a6242fc..b061288a35f14d1ca9219c8fc334fafe3c2d1727 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 d2d8d10069c9ed5ff909882247c872ad2a6242fc..b061288a35f14d1ca9219c8fc334fafe3c2d1727 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" diff --git a/MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot b/MEC016/MEO/UEAPPCTX/SysUeAppsContext.robot index 736322e26dd83579eec4d3ed44084e0692b51056..9db53e526cfafdaa21dda9e6320e19168bdaf82e 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 2d2e4564d957b5e56a211fff0c8993e4d39bef03..230fa067cf636a31c8b85eaeb430ffc01ccbd12f 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 38f47416133770526b009ac21b7cd4aade0a0f0b..97d468c53efb2106d826b406989c5ec13a98ec01 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 6186f6a279683f79e6383553bf87f19723af530d..a5e7fc9f7139a71d5cb265dd8f615c2d4bd6b7c1 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 cd0f9ef53d3cf74baf0141c3183b05fd25552e17..5857a006c6fa150760c1d3f53ece5c4d31f91fe6 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 dcdd441bf3afe0baed552e74cbb09dcf92ef2331..40fa57b1ffb9c205876918f01343dbf49fc3c8e7 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 e58b290bd8ae48b69e796010ca2bc2d550e639e7..f8626b50dfdb2e501a2acf1adaf23fc3267e6a7e 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 fdf8d3a32cc0336cedcf7ec29b789556789ee99e..db0cf53e3a91b4bcf18fcdeebefecbd8c3c1cc8d 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 d907dd4c367a5faecd5d2eef65155ae025156045..c444b8f5cc81d5eafe6f40b125b922108565d860 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 diff --git a/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot b/MEC048/MEO/CSE/CustomerSelfServiceEnablement.robot index cee73868abd477e787fb3852149ad4fee96c2412..9733c9300981b64754fb127903942c50e3b816a2 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} @@ -336,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 @@ -347,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 @@ -464,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 @@ -502,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 @@ -530,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 + + # Verify subscription creation + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is SiteResourceUsageSubscription - # Save the subscription ID for later retrieval and cleanup + # 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} @@ -571,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 @@ -591,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 @@ -666,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 @@ -684,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']} @@ -699,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 @@ -730,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 @@ -768,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 @@ -792,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 @@ -804,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} @@ -841,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 @@ -853,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 *** @@ -937,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} @@ -953,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 @@ -984,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 @@ -993,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} @@ -1064,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']} @@ -1147,7 +1167,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} ${tenant_var}=TENANT_ID_1 Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} @@ -1158,7 +1178,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_var}} ${response}[body][tenantId] Update tenant Info [Arguments] ${tenantId} ${content} @@ -1169,10 +1189,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} @@ -1183,22 +1203,21 @@ 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} - 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] diff --git a/MEC048/MEO/CSE/environment/variables.txt b/MEC048/MEO/CSE/environment/variables.txt index d66e1614d082051f04253d81fca605e299a57e55..1b69a94f6db30eec46a4965af378e4b861dee939 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/ResourceQuotaInfo.json b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo.json index fc360ada3a39b06c20eb81e32913b1b0db412e0e..60255150e4ffcd4a38f0d2c34d664e50ce7ebae5 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 0000000000000000000000000000000000000000..d67bc4c7aae16c81b198722d009fdb6adde214bf --- /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 0000000000000000000000000000000000000000..6acfd3e1e31654f44e4f6c390b05e66a82c8088c --- /dev/null +++ b/MEC048/MEO/CSE/jsons/ResourceQuotaInfo3.json @@ -0,0 +1,3 @@ +{ + "cpuQuota": 3 +} \ No newline at end of file diff --git a/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription.json b/MEC048/MEO/CSE/jsons/SiteResourceUsageSubscription.json index 63dc110146b3cb1e919c890bb3d17f68caa8adf2..f4f9e394718493c54027bd84d503897ce6ad77f8 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 e2e941a37afd334c343dd0749de335b2ef14d32e..f4f9e394718493c54027bd84d503897ce6ad77f8 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 c7d3aa45173a79a832d22152bd73e3ca780f112d..26d0e34bd58a28a9a14c5c2386962194a7655788 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 fbbdd8b5b6f0fce2e25ea5332b164a5457792b9f..723aa3229daefe80866084d123ddb705a41f7ba5 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