From 0a30faa4968ea5dcfd25a7ad53dbe26c47d09a71 Mon Sep 17 00:00:00 2001 From: piscione Date: Thu, 21 Dec 2023 18:21:47 +0100 Subject: [PATCH] Draft TCs for MEC015 v2.1.1 Bandwidth allocation (BWA) available --- MEC015/SRV/TM/TrafficManagement.robot | 418 ++++++++++-------- MEC015/SRV/TM/environment/variables.txt | 18 +- .../TM/jsons/BwInfoApplicationSpecific.json | 2 +- MEC015/SRV/TM/jsons/BwInfoDeltas.json | 2 +- MEC015/SRV/TM/jsons/BwInfoDeltas_BR.json | 3 +- MEC015/SRV/TM/jsons/BwInfoDeltas_BR2.json | 6 + MEC015/SRV/TM/jsons/BwInfoUpdate.json | 2 +- MEC015/SRV/TM/jsons/BwInfoUpdate_BR.json | 4 +- MEC015/SRV/TM/jsons/BwInfoUpdate_BR2.json | 5 + MEC015/SRV/TM/jsons/BwInfo_BR.json | 1 + MEC015/SRV/TM/jsons/BwInfo_BR2.json | 17 +- .../TM/jsons/CreateAppInstanceRequest.json | 5 + MEC015/SRV/TM/schemas/BwInfo.schema.json | 2 - MEC015/SRV/TM/schemas/BwInfoList.schema.json | 127 ++++++ 14 files changed, 412 insertions(+), 200 deletions(-) create mode 100644 MEC015/SRV/TM/jsons/BwInfoDeltas_BR2.json create mode 100644 MEC015/SRV/TM/jsons/BwInfoUpdate_BR2.json create mode 100644 MEC015/SRV/TM/jsons/CreateAppInstanceRequest.json create mode 100644 MEC015/SRV/TM/schemas/BwInfoList.schema.json diff --git a/MEC015/SRV/TM/TrafficManagement.robot b/MEC015/SRV/TM/TrafficManagement.robot index 323dc06..a964fd0 100644 --- a/MEC015/SRV/TM/TrafficManagement.robot +++ b/MEC015/SRV/TM/TrafficManagement.robot @@ -1,5 +1,5 @@ ''[Documentation] robot --outputdir ../../../outputs ./TrafficManagement.robot -... Test Suite to validate Bandwidth Management API (BWA) operations. +... Test Suite to validate Bandwidth Management allocations (BWA) operations. *** Settings *** Resource environment/variables.txt @@ -7,224 +7,345 @@ Resource ../../../pics.txt Resource ../../../GenericKeywords.robot Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library OperatingSystem +Library String - -##GET on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations *** Test Cases *** -TP_MEC_MEC015_SRV_TM_001_OK + +TC_MEC_MEC015_SRV_TM_001_OK_01 [Documentation] ... Check that the IUT responds with the list of configured bandwidth allocations when queried by a MEC Application - ... Reference ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific Retrieve the list of configured bandwidth allocations Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is BwInfo - FOR ${bwInfo} IN @{response['body']} - ${passed} Run Keyword And Return Status Should Be Equal As Strings ${bwInfo['appInsId']} ${APP_INSTANCE_ID} - Exit For Loop If ${passed} - END - Should Be True ${passed} + Check HTTP Response Body Json Schema Is BwInfoList + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} -TP_MEC_MEC015_SRV_TM_002_OK +TC_MEC_MEC015_SRV_TM_001_OK_02 [Documentation] - ... Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application - ... Reference ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json + ... Check that the IUT responds with the list of configured bandwidth allocations when queried by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific Retrieve the list of configured bandwidth using filter ${CORRECT_FILTER} ${APP_INSTANCE_ID} Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is BwInfo + Check HTTP Response Body Json Schema Is BwInfoList FOR ${bwInfo} IN @{response['body']} ${passed} Run Keyword And Return Status Should Be Equal As Strings ${bwInfo['appInsId']} ${APP_INSTANCE_ID} Exit For Loop If ${passed} END Should Be True ${passed} + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} + -TP_MEC_MEC015_SRV_TM_002_BR +TC_MEC_MEC015_SRV_TM_001_OK_03 + [Documentation] + ... Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + Retrieve the list of configured bandwidth using filter ${APP_NAME_FILTER} ${APP_NAME} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is BwInfoList + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} + +# TC_MEC_MEC015_SRV_TM_001_OK_04 + ##TODO To discuss the corresponding TP: the sessionId is not attribute of BwInfo data type + # [Documentation] + # ... Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application + # ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + # ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + # ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 + # [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + # Retrieve the list of configured bandwidth using filter ${SESSION_ID_FILTER} ${SESSION_ID} + # Check HTTP Response Status Code Is 200 + # Check HTTP Response Body Json Schema Is BwInfoList + # [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} + + + +TC_MEC_MEC015_SRV_TM_001_BR [Documentation] ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application ... Reference ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific Retrieve the list of configured bandwidth using filter ${BAD_FILTER} ${APP_INSTANCE_ID} Check HTTP Response Status Code Is 400 + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} + -TP_MEC_MEC015_SRV_TM_002_NF +TC_MEC_MEC015_SRV_TM_001_NF_01 [Documentation] - ... Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application - ... Reference ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json + ... Check that the IUT responds with an error when + ... a request with an unknown resource URI is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 Retrieve the list of configured bandwidth using filter ${CORRECT_FILTER} ${NON_EXISTENT_APP_INSTANCE_ID} Check HTTP Response Status Code Is 404 - - -##POST on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations -TP_MEC_MEC015_SRV_TM_003_OK_01 +TC_MEC_MEC015_SRV_TM_001_NF_02 [Documentation] - ... Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application - ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.4 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Register Bandwidth Management Service Application specific BwInfoApplicationSpecific - -TP_MEC_MEC015_SRV_TM_003_OK_02 + ... Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application - app_name + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 + Retrieve the list of configured bandwidth using filter ${APP_NAME_FILTER} ${NON_EXISTENT_APP_NAME} + Check HTTP Response Status Code Is 404 + +TC_MEC_MEC015_SRV_TM_001_NF_03 [Documentation] - ... Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application - ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.4 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Register Bandwidth Management Service Session specific BwInfoSessionSpecific - + ... Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application - session_id + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.1 + Retrieve the list of configured bandwidth using filter ${SESSION_ID_FILTER} ${NON_EXISTENT_SESSION_ID} + Check HTTP Response Status Code Is 404 -TP_MEC_MEC015_SRV_TM_003_BR_01 +TC_MEC_MEC015_SRV_TM_002_OK [Documentation] - ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.4 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Register Bandwidth Management Service with incorrect parameters BwInfo_BR - -TP_MEC_MEC015_SRV_TM_003_BR_02 + ... Check that the IUT acknowledges a creation of a bandwidthAllocation resource + ... ETSI GS MEC 015 V2.1.1, clause 6.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2, + ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.4 + [Setup] Create new App Instance CreateAppInstanceRequest + Registration for bandwidth services ${APP_INSTANCE_ID} BwInfoApplicationSpecific + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is BwInfo + ${appInsId} Get value entry from JSON file BwInfoApplicationSpecific appInsId + ${requestType} Get value entry from JSON file BwInfoApplicationSpecific requestType + ${fixedAllocation} Get value entry from JSON file BwInfoApplicationSpecific fixedAllocation + ${allocationDirection} Get value entry from JSON file BwInfoApplicationSpecific allocationDirection + 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']['fixedAllocation']} ${fixedAllocation} + Should Be Equal As Strings ${response['body']['allocationDirection']} ${allocationDirection} + [TearDown] Delete App Instance ${APP_INSTANCE_ID} + + +TC_MEC_MEC015_SRV_TM_002_BR_01 [Documentation] ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.4 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Register Bandwidth Management Service with incorrect parameters BwInfo_BR2 - -TP_MEC_MEC015_SRV_TM_003_BR_03 + [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} + +TC_MEC_MEC015_SRV_TM_002_BR_02 [Documentation] ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application ... ETSI GS MEC 015 V2.1.1, clause 8.4.3.4 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Register Bandwidth Management Service with incorrect parameters BwInfo_BR3 - + [Setup] Create new App Instance CreateAppInstanceRequest + Registration for bandwidth services ${APP_INSTANCE_ID} BwInfo_BR2 + Check HTTP Response Status Code Is 400 + [TearDown] Delete App Instance ${APP_INSTANCE_ID} -##GET on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID} -TP_MEC_MEC015_SRV_TM_004_OK +TC_MEC_MEC015_SRV_TM_003_OK [Documentation] ... Check that the IUT responds with the configured bandwidth allocation when queried by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific Get a bandwidth allocation ${ALLOCATION_ID} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is BwInfo Should Be Equal As Strings ${response['body']['appInsId']} ${APP_INSTANCE_ID} + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} -TP_MEC_MEC015_SRV_TM_004_NF +TC_MEC_MEC015_SRV_TM_003_NF [Documentation] ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.5 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json + [Setup] Unregister Bandwidth Management Service ${NON_EXISTENT_ALLOCATION_ID} Get a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID} Check HTTP Response Status Code Is 404 -##PUT on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID} -TP_MEC_MEC015_SRV_TM_005_OK + +TC_MEC_MEC015_SRV_TM_004_OK [Documentation] ... Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate.json - ${body} Get File ${path} - ${json_object}= Evaluate json.loads('''${body}''') json - Update a bandwidth allocation ${ALLOCATION_ID} ${body} + [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 + ${allocationDirection} Get value entry from JSON file BwInfoUpdate allocationDirection Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is BwInfo - Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']} - Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']} - Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']} + 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} -TP_MEC_MEC015_SRV_TM_005_BR +TC_MEC_MEC015_SRV_TM_004_BR_01 [Documentation] ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate_BR.json - ${body} Get File ${path} - ${json_object}= Evaluate json.loads('''${body}''') json - Update a bandwidth allocation ${ALLOCATION_ID} ${body} + + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate_BR Check HTTP Response Status Code Is 400 + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} -TP_MEC_MEC015_SRV_TM_005_NF +TC_MEC_MEC015_SRV_TM_004_BR_02 + [Documentation] + ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 + ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.2 + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate_BR2 + Check HTTP Response Status Code Is 400 + [TearDown] Unregister bw Service And Delete APP Instance ${ALLOCATION_ID} ${APP_INSTANCE_ID} + + +TC_MEC_MEC015_SRV_TM_004_NF [Documentation] ... Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate.json - ${body} Get File ${path} - ${json_object}= Evaluate json.loads('''${body}''') json + + [Setup] Delete APP Instance ${NON_EXISTENT_ALLOCATION_ID} Update a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID} BwInfoUpdate Check HTTP Response Status Code Is 404 -##PATCH on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID} -TP_MEC_MEC015_SRV_TM_006_OK +TC_MEC_MEC015_SRV_TM_005_OK [Documentation] ... Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - # Preamble - Register Bandwidth Management Service Application specific BwInfoApplicationSpecific - # Test body - ${path} Catenate SEPARATOR= jsons/ BwInfoDeltas.json - ${body} Get File ${path} - ${json_object}= Evaluate json.loads('''${body}''') json - Request a deltas changes ${ALLOCATION_ID} ${body} + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + Request a deltas changes ${ALLOCATION_ID} BwInfoDeltas + Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is BwInfoDelta - Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']} - Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']} - Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']} - -TP_MEC_MEC015_SRV_TM_006_BR + ${appInsId} Get value entry from JSON file BwInfoDeltas appInsId + ${fixedAllocation} Get value entry from JSON file BwInfoDeltas fixedAllocation + ${allocationDirection} Get value entry from JSON file BwInfoDeltas allocationDirection + 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} + +TC_MEC_MEC015_SRV_TM_005_BR_01 [Documentation] ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - # Preamble - Register Bandwidth Management Service Application specific BwInfoApplicationSpecific - # Test body - ${path} Catenate SEPARATOR= jsons/ BwInfoDeltas_BR.json - ${body} Get File ${path} - Request a deltas changes ${ALLOCATION_ID} ${body} + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + Request a deltas changes ${ALLOCATION_ID} BwInfoDeltas_BR Check HTTP Response Status Code Is 400 +TC_MEC_MEC015_SRV_TM_005_BR_02 + [Documentation] + ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 + ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3 + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific + Request a deltas changes ${ALLOCATION_ID} BwInfoDeltas_BR2 + Check HTTP Response Status Code Is 400 + -TP_MEC_MEC015_SRV_TM_006_NF +TC_MEC_MEC015_SRV_TM_005_NF [Documentation] ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.4 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - ${path} Catenate SEPARATOR= jsons/ BwInfoDeltas_BR.json - ${body} Get File ${path} - Request a deltas changes ${NON_EXISTENT_ALLOCATION_ID} ${body} - Check HTTP Response Status Code Is 400 + [Setup] Delete APP Instance ${NON_EXISTENT_ALLOCATION_ID} + Request a deltas changes ${NON_EXISTENT_ALLOCATION_ID} BwInfoDeltas + Check HTTP Response Status Code Is 404 + - -##DELETE on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID} -TP_MEC_MEC015_SRV_TM_007_OK +TC_MEC_MEC015_SRV_TM_006_OK [Documentation] ... Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.3 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.5 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + [Setup] Create new App Instance and Register for bw service CreateAppInstanceRequest BwInfoApplicationSpecific Unregister Bandwidth Management Service ${ALLOCATION_ID} Check HTTP Response Status Code Is 204 + [TearDown] Delete APP Instance ${ALLOCATION_ID} -TP_MEC_MEC015_SRV_TM_007_NF +TC_MEC_MEC015_SRV_TM_006_NF [Documentation] ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 6.2.3 + ... ETSI GS MEC 015 V2.1.1, clause 7.2.2 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.5 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + [Setup] Unregister Bandwidth Management Service ${NON_EXISTENT_ALLOCATION_ID} Unregister Bandwidth Management Service ${NON_EXISTENT_ALLOCATION_ID} Check HTTP Response Status Code Is 404 - *** Keywords *** +Create new App Instance and Register for bw service + [Arguments] ${appInstancePayload} ${bwServicePayload} + 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] + + + +Unregister bw Service And Delete APP Instance + [Arguments] ${allocationId} ${app_instance_id} + Unregister Bandwidth Management Service ${allocationId} + Delete APP Instance ${app_instance_id} + +Create new App Instance + [Arguments] ${content} + Log Creating a new app package + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + POST http://${APP_INST_HOST}:${APP_INST_PORT}/${apiRoot_APP_INST}/${apiName_APP_INST}/${apiVersion_APP_INST}/app_instances ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + Set Suite Variable ${APP_INSTANCE_ID} ${response['body']['id']} + + +Delete APP Instance + [Arguments] ${app_instance_id} + Log Get single App Instance + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"*/*"} + Set Headers {"Authorization":"${TOKEN}"} + DELETE http://${APP_INST_HOST}:${APP_INST_PORT}/${apiRoot_APP_INST}/${apiName_APP_INST}/${apiVersion_APP_INST}/app_instances${app_instance_id} + ${output}= Output response + Set Suite Variable ${response} ${output} + Retrieve the list of configured bandwidth allocations Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 @@ -270,7 +391,7 @@ Registration for bandwidth services Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id} ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -288,11 +409,14 @@ Get a bandwidth allocation Update a bandwidth allocation - [Arguments] ${allocation_id} ${body} + [Arguments] ${allocation_id} ${content} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} + ${path} Catenate SEPARATOR= jsons/ ${content}.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json Set Headers {"Authorization":"${TOKEN}"} Put ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} ${output}= Output response @@ -300,85 +424,27 @@ Update a bandwidth allocation Request a deltas changes - [Arguments] ${allocation_id} ${body} + [Arguments] ${allocation_id} ${content} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Register Bandwidth Management Service with incorrect parameters - [Arguments] ${content} - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 - Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 400 - -Register Bandwidth Management Service Session specific - [Arguments] ${content} - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 - Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} + ${path} Catenate SEPARATOR= jsons/ ${content}.json + ${body} Get File ${path} ${json_object}= Evaluate json.loads('''${body}''') json - Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 201 - Check HTTP Response Body Json Schema Is BwInfo - Should Not Be Empty ${response['headers']['Location']} - Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']} - Should Be Equal As Strings ${response['body']['requestType']} ${json_object['requestType']} - Should Be Equal As Strings ${response['body']['sessionFilter']} ${json_object['sessionFilter']} - Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']} - Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']} - - -Register Bandwidth Management Service Application specific - [Arguments] ${content} - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 - Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body} + Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 201 - Check HTTP Response Body Json Schema Is BwInfo - ${json_object}= Evaluate json.loads('''${body}''') json - Should Not Be Empty ${response['headers']['Location']} - Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']} - Should Be Equal As Strings ${response['body']['requestType']} ${json_object['requestType']} - Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']} - Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']} - - Unregister Bandwidth Management Service - [Arguments] ${value} + [Arguments] ${allocationId} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"*/*"} Set Headers {"Authorization":"${TOKEN}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${value} + Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocationId} ${output}= Output response Set Suite Variable ${response} ${output} diff --git a/MEC015/SRV/TM/environment/variables.txt b/MEC015/SRV/TM/environment/variables.txt index 4a9a19d..fd3aab1 100644 --- a/MEC015/SRV/TM/environment/variables.txt +++ b/MEC015/SRV/TM/environment/variables.txt @@ -19,6 +19,14 @@ ${BAD_FILTER} appInsId ${APP_INSTANCE_ID} 5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f ${NON_EXISTENT_APP_INSTANCE_ID} NON_EXISTENT_INSTANCE_ID +${APP_NAME_FILTER} app_name +${APP_NAME} appName +${NON_EXISTENT_APP_NAME} NON_EXISTENT_APP_NAME + +${SESSION_ID_FILTER} session_id +${NON_EXISTENT_SESSION_ID} NON_EXISTENT_SESSION_ID + + ${FIXED_ALLOCATION} 32 ${ALLOCATION_DIRECTION} 00 @@ -29,4 +37,12 @@ ${ALLOCATION_ID} 59ab1593-d330-4087-85ec-4e484092f306 ${NON_EXISTENT_ALLOCATION_ID} NON_EXISTENT_ALLOCATION_ID ${INVALID_ETAG} INVALID_ETAG ${ETAG_VALUE} -${ETAG} \ No newline at end of file +${ETAG} + +##Variables for App Instances management +${APP_INST_HOST} 127.0.0.1 +${APP_INST_PORT} 8081 +${apiRoot_APP_INST} +${apiName_APP_INST} app_lcm +${apiVersion_APP_INST} v1 +${elements} \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json b/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json index 511b36f..9746f32 100644 --- a/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json +++ b/MEC015/SRV/TM/jsons/BwInfoApplicationSpecific.json @@ -1,5 +1,5 @@ { -"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", + "appInsId": "appInstanceId", "requestType": 0, "fixedAllocation": "32", "allocationDirection": "00" diff --git a/MEC015/SRV/TM/jsons/BwInfoDeltas.json b/MEC015/SRV/TM/jsons/BwInfoDeltas.json index 28d4b0a..4bcc10f 100644 --- a/MEC015/SRV/TM/jsons/BwInfoDeltas.json +++ b/MEC015/SRV/TM/jsons/BwInfoDeltas.json @@ -1,5 +1,5 @@ { -"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", +"appInsId": "appInstanceId", "requestType": 0, "fixedAllocation": "32", "allocationDirection": "01" diff --git a/MEC015/SRV/TM/jsons/BwInfoDeltas_BR.json b/MEC015/SRV/TM/jsons/BwInfoDeltas_BR.json index fca0e97..0a8c388 100644 --- a/MEC015/SRV/TM/jsons/BwInfoDeltas_BR.json +++ b/MEC015/SRV/TM/jsons/BwInfoDeltas_BR.json @@ -1,6 +1,7 @@ { "appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", - "requestType": "INVALID_VALUE", + "requestType": "0", + "sessionFilter":"someValues", "fixedAllocation": "32", "allocationDirection": "01" } \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfoDeltas_BR2.json b/MEC015/SRV/TM/jsons/BwInfoDeltas_BR2.json new file mode 100644 index 0000000..b123a74 --- /dev/null +++ b/MEC015/SRV/TM/jsons/BwInfoDeltas_BR2.json @@ -0,0 +1,6 @@ +{ +"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", + "requestType": "1", + "fixedAllocation": "32", + "allocationDirection": "01" +} \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfoUpdate.json b/MEC015/SRV/TM/jsons/BwInfoUpdate.json index 28d4b0a..4bcc10f 100644 --- a/MEC015/SRV/TM/jsons/BwInfoUpdate.json +++ b/MEC015/SRV/TM/jsons/BwInfoUpdate.json @@ -1,5 +1,5 @@ { -"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", +"appInsId": "appInstanceId", "requestType": 0, "fixedAllocation": "32", "allocationDirection": "01" diff --git a/MEC015/SRV/TM/jsons/BwInfoUpdate_BR.json b/MEC015/SRV/TM/jsons/BwInfoUpdate_BR.json index 2ccb051..9346f14 100644 --- a/MEC015/SRV/TM/jsons/BwInfoUpdate_BR.json +++ b/MEC015/SRV/TM/jsons/BwInfoUpdate_BR.json @@ -1,6 +1,6 @@ { -"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", +"appInsId": "appInstanceId", "requestType": 0, "fixedAllocation": "64", - "allocationDirection": "INVALID_VALUE" + "sessionFilter":"sessionFilterVlues" } \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfoUpdate_BR2.json b/MEC015/SRV/TM/jsons/BwInfoUpdate_BR2.json new file mode 100644 index 0000000..a4f6dac --- /dev/null +++ b/MEC015/SRV/TM/jsons/BwInfoUpdate_BR2.json @@ -0,0 +1,5 @@ +{ +"appInsId": "appInstanceId", + "requestType": 1, + "fixedAllocation": "64" +} \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfo_BR.json b/MEC015/SRV/TM/jsons/BwInfo_BR.json index b783529..af487d2 100644 --- a/MEC015/SRV/TM/jsons/BwInfo_BR.json +++ b/MEC015/SRV/TM/jsons/BwInfo_BR.json @@ -1,6 +1,7 @@ { "appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", "requestType": 0, + "sessionFlter":"someValues", "fixedAllocation": "INVALID_VALUE", "allocationDirection": "00" } \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/BwInfo_BR2.json b/MEC015/SRV/TM/jsons/BwInfo_BR2.json index c08fbf8..8f616f0 100644 --- a/MEC015/SRV/TM/jsons/BwInfo_BR2.json +++ b/MEC015/SRV/TM/jsons/BwInfo_BR2.json @@ -1,19 +1,6 @@ { "appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", - "requestType": 0, + "requestType": 1, "fixedAllocation": "-30", - "allocationDirection": "00", - "sessionFilter": [{ - "protocol": "123", - "sourceIp": "10.10.0.3", - "dstAddress": "1234", - "dstPort": [ - "1234", - "1334" - ], - "sourcePort": [ - "8080", - "8082" - ] - }] + "allocationDirection": "00" } \ No newline at end of file diff --git a/MEC015/SRV/TM/jsons/CreateAppInstanceRequest.json b/MEC015/SRV/TM/jsons/CreateAppInstanceRequest.json new file mode 100644 index 0000000..3691ba6 --- /dev/null +++ b/MEC015/SRV/TM/jsons/CreateAppInstanceRequest.json @@ -0,0 +1,5 @@ +{ + "appDId": "e0deee2b-6e50-4f33-ab09-8bf0585025d3", + "appInstanceDescription": "description", + "appInstanceName": "name" +} \ No newline at end of file diff --git a/MEC015/SRV/TM/schemas/BwInfo.schema.json b/MEC015/SRV/TM/schemas/BwInfo.schema.json index 66ca806..ed52c3b 100644 --- a/MEC015/SRV/TM/schemas/BwInfo.schema.json +++ b/MEC015/SRV/TM/schemas/BwInfo.schema.json @@ -1,5 +1,4 @@ { - "items": { "properties": { "allocationDirection": { "description": "The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical", @@ -123,5 +122,4 @@ ], "type": "object", "x-etsi-ref": "7.2.2" -} } \ No newline at end of file diff --git a/MEC015/SRV/TM/schemas/BwInfoList.schema.json b/MEC015/SRV/TM/schemas/BwInfoList.schema.json new file mode 100644 index 0000000..66ca806 --- /dev/null +++ b/MEC015/SRV/TM/schemas/BwInfoList.schema.json @@ -0,0 +1,127 @@ +{ + "items": { + "properties": { + "allocationDirection": { + "description": "The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "appInsId": { + "description": "Application instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "fixedAllocation": { + "description": "Size of requested fixed BW allocation in [bps]", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "fixedBWPriority": { + "description": "Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document", + "enum": [ + "SEE_DESCRIPTION" + ], + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Enum" + }, + "requestType": { + "description": "Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION", + "type": "integer", + "enum": [ + 0, + 1 + ], + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "sessionFilter": { + "description": "Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected", + "items": { + "type": "object", + "properties": { + "dstAddress": { + "description": "Destination address identity of session (including range)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "dstPort": { + "description": "Destination port identity of session", + "items": { + "type": "string" + }, + "minItems": 0, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "String" + }, + "protocol": { + "description": "Protocol number", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "sourceIp": { + "description": "Source address identity of session (including range)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "sourcePort": { + "description": "Source port identity of session", + "items": { + "type": "string" + }, + "minItems": 0, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "String" + } + } + }, + "minItems": 0, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "timeStamp": { + "description": "Time stamp to indicate when the corresponding information elements are sent", + "properties": { + "nanoSeconds": { + "description": "The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + }, + "seconds": { + "format": "uint32", + "type": "integer", + "description": "The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + } + }, + "required": [ + "appInsId", + "requestType", + "fixedAllocation", + "allocationDirection" + ], + "type": "object", + "x-etsi-ref": "7.2.2" +} +} \ No newline at end of file -- GitLab