diff --git a/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot b/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot index 105a706512a38fca592b4945c908a59c1fac162a..ce819b585899595e0a08223bfb066fde40ef296a 100644 --- a/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot +++ b/MEC015/SRV/MTS/MultiAccessTrafficSteering.robot @@ -21,11 +21,10 @@ TP_MEC_MEC015_SRV_MTS_001_OK Check HTTP Response Body Json Schema Is MtsCapabilityInfo - ##GET on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions TP_MEC_MEC015_SRV_MTS_002_OK [Documentation] - ... Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application + ... 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 9.5.3.1 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml Retrieve MTS session list information @@ -37,35 +36,17 @@ TP_MEC_MEC015_SRV_MTS_002_OK END Should Be True ${passed} - -TP_MEC_MEC015_SRV_MTS_003_OK +TP_MEC_MEC015_SRV_MTS_002_BR [Documentation] - ... Check that the IUT responds with a configured Multi-access Traffic Steering when queried by a MEC Application - ... ETSI GS MEC 015 V2.1.1, clause 9.5.3.1 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - 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']} - ${passed} Run Keyword And Return Status Should Be Equal As Strings ${mstSessionInfo['appInsId']} ${APP_INSTANCE_ID} - Exit For Loop If ${passed} - END - Should Be True ${passed} - - - -TP_MEC_MEC015_SRV_MTS_003_BR - [Documentation] - ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + ... Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application ... ETSI GS MEC 015 V2.1.1, clause 9.5.3.1 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml Retrieve MTS session list information using filter ${BAD_FILTER} ${APP_INSTANCE_ID} Check HTTP Response Status Code Is 400 - -TP_MEC_MEC015_SRV_MTS_003_NF +TP_MEC_MEC015_SRV_MTS_002_NF [Documentation] - ... Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application + ... Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application ... ETSI GS MEC 015 V2.1.1, clause 9.5.3.1 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml Retrieve MTS session list information using filter ${CORRECT_FILTER} ${NOT_EXISTING_APP_INSTANCE_ID} @@ -73,34 +54,152 @@ TP_MEC_MEC015_SRV_MTS_003_NF ##POST on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions -TP_MEC_MEC015_SRV_MTS_004_OK_01 +TP_MEC_MEC015_SRV_MTS_003_OK_01 + [Documentation] + ... Check that the IUT creates a MTS session when queried by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 9.5.3.2 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + ${path} Catenate SEPARATOR= jsons/ MtsSessionInfoApplicationSpecific.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Register MTS session ${body} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is MtsSessionInfo + 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']['qosD']} ${json_object['qosD']} + Should Be Equal As Strings ${response['body']['mtsMode']} ${json_object['mtsMode']} + Should Be Equal As Strings ${response['body']['trafficDirection']} ${json_object['trafficDirection']} + + +TP_MEC_MEC015_SRV_MTS_003_OK_02 [Documentation] - ... Check that the IUT responds with a registration and initialisation approval for the requested MTS session requirements sent by a MEC Application + ... Check that the IUT creates a MTS session when queried by a MEC Application ... ETSI GS MEC 015 V2.1.1, clause 9.5.3.2 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - Register MTS session MtsSessionInfoApplicationSpecific.json + ${path} Catenate SEPARATOR= jsons/ MtsSessionInfoSessionSpecific.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Register MTS session ${body} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo - Should Be Equal As Strings ${response['body']['appInsId']} ${APP_INSTANCE_ID} + 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']['flowFilter']} ${json_object['flowFilter']} + Should Be Equal As Strings ${response['body']['qosD']} ${json_object['qosD']} + Should Be Equal As Strings ${response['body']['mtsMode']} ${json_object['mtsMode']} + Should Be Equal As Strings ${response['body']['trafficDirection']} ${json_object['trafficDirection']} -TP_MEC_MEC015_SRV_MTS_004_OK_02 + +TP_MEC_MEC015_SRV_MTS_003_BR [Documentation] - ... Check that the IUT responds with a registration and initialisation approval for the requested MTS session requirements sent by a MEC Application + ... 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 9.5.3.2 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - Register MTS session MtsSessionInfoSessionSpecific.json + ${path} Catenate SEPARATOR= jsons/ MtsSessionInfoApplicationSpecific_BR.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Register MTS session ${body} + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is MtsSessionInfo + 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']['qosD']} ${json_object['qosD']} + Should Be Equal As Strings ${response['body']['mtsMode']} ${json_object['mtsMode']} + Should Be Equal As Strings ${response['body']['trafficDirection']} ${json_object['trafficDirection']} + + +##GET on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/{sessionId} +TP_MEC_MEC015_SRV_MTS_004_OK + [Documentation] + ... Check that the IUT responds with a configured Multi-access Traffic Steering session when queried by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 9.4.3.1 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + Retrieve single MTS session ${SESSION_ID} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is MtsSessionInfo - Should Be Equal As Strings ${response['body']['appInsId']} ${APP_INSTANCE_ID} + Should Be Equal As Strings ${response['body']['appInsId']} ${APP_INSTANCE_ID} + Should Be Equal As Strings ${response['body']['requestType']} ${REQUEST_TYPE_SESSION} + Should Be Equal As Strings ${response['body']['mtsMode']} ${MTS_LOW_MODE_COST} + Should Be Equal As Strings ${response['body']['trafficDirection']} ${TRAFFIC_DIRECTION_DL} + +TP_MEC_MEC015_SRV_MTS_004_BR + [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 9.4.3.1 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + Retrieve single MTS session ${WRONG_SESSION_ID} + Check HTTP Response Status Code Is 400 TP_MEC_MEC015_SRV_MTS_004_NF [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 9.5.3.2 + ... ETSI GS MEC 015 V2.1.1, clause 9.4.3.1 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - Register MTS session wrong URI MtsSessionInfoSessionSpecific.json + Retrieve single MTS session ${NOT_EXISTING_SESSION_ID} Check HTTP Response Status Code Is 404 + + +##PUT on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/{sessionId} +TP_MEC_MEC015_SRV_MTS_005_OK + [Documentation] + ... Check that the IUT updates the information about an individual MTS session when commanded by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 9.4.3.2 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + ${path} Catenate SEPARATOR= jsons/ MtsSessionInfoApplicationSpecificUpdate.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Update requested requirements on the MTS Service ${SESSION_ID} ${body} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is MtsSessionInfo + 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']['qosD']} ${json_object['qosD']} + Should Be Equal As Strings ${response['body']['mtsMode']} ${json_object['mtsMode']} + Should Be Equal As Strings ${response['body']['trafficDirection']} ${json_object['trafficDirection']} +TP_MEC_MEC015_SRV_MTS_005_BR + [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 9.4.3.2 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + ${path} Catenate SEPARATOR= jsons/ MtsSessionInfoApplicationSpecificUpdate_BR.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Update requested requirements on the MTS Service ${SESSION_ID} ${body} + Check HTTP Response Status Code Is 400 + +TP_MEC_MEC015_SRV_MTS_005_NF + [Documentation] + ... 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 9.4.3.2 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + ${path} Catenate SEPARATOR= jsons/ MtsSessionInfoApplicationSpecificUpdate.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Update requested requirements on the MTS Service ${NOT_EXISTING_SESSION_ID} ${body} + Check HTTP Response Status Code Is 404 + +##DELETE on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/{sessionId} +TP_MEC_MEC015_SRV_MTS_006_OK + [Documentation] + ... Check that the IUT deregisters a MTS session when commanded by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 9.4.3.3 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + Unregister from the MTS Service ${SESSION_ID} + Check HTTP Response Status Code Is 204 + +##TP_MEC_MEC015_SRV_MTS_006_BR missing. +#See issues https://forge.etsi.org/rep/mec/gs032p2-test-purposes/issues/11 for further details. + +TP_MEC_MEC015_SRV_MTS_006_NF + [Documentation] + ... Check that the IUT deregisters a MTS session when commanded by a MEC Application + ... ETSI GS MEC 015 V2.1.1, clause 9.4.3.3 + ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml + Unregister from the MTS Service ${NOT_EXISTING_SESSION_ID} + Check HTTP Response Status Code Is 404 + *** Keywords *** Retrieve MTS capability information Should Be True ${PIC_MEC_PLAT} == 1 @@ -120,7 +219,7 @@ Retrieve MTS session list information Set Headers {"Content-Type":"*/*"} Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Content-Length":"0"} - Get ${apiRoot}/${apiName}/${apiVersion}/mts_session + Get ${apiRoot}/${apiName}/${apiVersion}/mts_sessions ${output}= Output response Set Suite Variable ${response} ${output} @@ -133,21 +232,19 @@ Retrieve MTS session list information using filter Set Headers {"Content-Type":"*/*"} Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Content-Length":"0"} - Get ${apiRoot}/${apiName}/${apiVersion}/mts_session?${filter}=${value} + Get ${apiRoot}/${apiName}/${apiVersion}/mts_sessions?${filter}=${value} ${output}= Output response Set Suite Variable ${response} ${output} Register MTS session - [Arguments] ${content} + [Arguments] ${body} 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}"} Set Headers {"Content-Length":"0"} - ${path} Catenate SEPARATOR= jsons/ ${content} - ${body} Get File ${path} - POST ${apiRoot}/${apiName}/${apiVersion}/mts_session ${body} + POST ${apiRoot}/${apiName}/${apiVersion}/mts_sessions ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -162,6 +259,40 @@ Register MTS session wrong URI Set Headers {"Content-Length":"0"} ${path} Catenate SEPARATOR= jsons/ ${content} ${body} Get File ${path} - POST ${apiRoot}/${apiName}/v0/mts_session ${body} + POST ${apiRoot}/${apiName}/v0/mts_sessions ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Retrieve single MTS session + [Arguments] ${sessionId} + 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}"} + GET ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/${sessionId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Update requested requirements on the MTS Service + [Arguments] ${sessionId} ${body} + 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}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/${sessionId} ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Unregister from the MTS Service + [Arguments] ${sessionId} + 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}"} + LOG ${sessionId} + DELETE ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/${sessionId} ${output}= Output response Set Suite Variable ${response} ${output} \ No newline at end of file diff --git a/MEC015/SRV/MTS/environment/variables.txt b/MEC015/SRV/MTS/environment/variables.txt index 80314734c110685d02a7bfed863c400453c44b65..cceeac3b762b19846f2aac74b1d2119791a4bee6 100644 --- a/MEC015/SRV/MTS/environment/variables.txt +++ b/MEC015/SRV/MTS/environment/variables.txt @@ -13,4 +13,12 @@ ${apiVersion} v1 ${APP_INSTANCE_ID} appInstId01 ${NOT_EXISTING_APP_INSTANCE_ID} NOT_EXISTING_APP_INS_ID ${CORRECT_FILTER} app_instance_id -${BAD_FILTER} app_id \ No newline at end of file +${BAD_FILTER} appInsId + +${SESSION_ID} 1 +${WRONG_SESSION_ID} WRONG_SESSION_ID +${NOT_EXISTING_SESSION_ID} NOT_EXISTING_SESSION_ID + +${REQUEST_TYPE_SESSION} 0 +${MTS_LOW_MODE_COST} 0 +${TRAFFIC_DIRECTION_DL} 00 diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json index 8723de313b57f9e7ac522072e2d360ec5d208349..f8ec281b7f7e85b46a8e5d3f72058799d550058f 100644 --- a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific.json @@ -6,15 +6,6 @@ }, "mtsMode": 0, "trafficDirection": "00", - "flowFilter": [{ - "dstPort": [8081], - "protocol": 41, - "sourcePort": [8081], - "dstIp": "10.10.0.10", - "dscp": 40, - "sourceIp": "10.10.0.30" - } - ], "qosD":{ "minTpt":10 } diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json new file mode 100644 index 0000000000000000000000000000000000000000..16d87745c6408540461444c3e257ff735bd91545 --- /dev/null +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate.json @@ -0,0 +1,12 @@ +{ + "appInsId": "myAppInstId", + "requestType": 0, + "qosD": { + "minTpt": 30 + }, + "mtsMode": 0, + "trafficDirection": "00", + "qosD":{ + "minTpt":10 + } +} \ No newline at end of file diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate_BR.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate_BR.json new file mode 100644 index 0000000000000000000000000000000000000000..814cd503cb8a4fa4fee2250e14934d75960f9701 --- /dev/null +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecificUpdate_BR.json @@ -0,0 +1,21 @@ +{ + "appInsId": "myAppInstId", + "requestType": 0, + "qosD": { + "minTpt": 30 + }, + "mtsMode": 0, + "trafficDirection": "00", + "flowFilter": [{ + "dstPort": [8081], + "protocol": 41, + "sourcePort": [8081], + "dstIp": "10.10.0.10", + "dscp": 40, + "sourceIp": "10.10.0.30" + } + ], + "qosD":{ + "minTpt":10 + } +} \ No newline at end of file diff --git a/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific_BR.json b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific_BR.json new file mode 100644 index 0000000000000000000000000000000000000000..814cd503cb8a4fa4fee2250e14934d75960f9701 --- /dev/null +++ b/MEC015/SRV/MTS/jsons/MtsSessionInfoApplicationSpecific_BR.json @@ -0,0 +1,21 @@ +{ + "appInsId": "myAppInstId", + "requestType": 0, + "qosD": { + "minTpt": 30 + }, + "mtsMode": 0, + "trafficDirection": "00", + "flowFilter": [{ + "dstPort": [8081], + "protocol": 41, + "sourcePort": [8081], + "dstIp": "10.10.0.10", + "dscp": 40, + "sourceIp": "10.10.0.30" + } + ], + "qosD":{ + "minTpt":10 + } +} \ No newline at end of file diff --git a/MEC015/SRV/TM/PlatBandwidthManager_OLD.robot b/MEC015/SRV/TM/PlatBandwidthManager_OLD.robot deleted file mode 100644 index 664f54afcf7512f2423afe6ffa8eb352deca3107..0000000000000000000000000000000000000000 --- a/MEC015/SRV/TM/PlatBandwidthManager_OLD.robot +++ /dev/null @@ -1,378 +0,0 @@ -''[Documentation] robot --outputdir ../../outputs ./PlatBandwidthManager.robot -... Test Suite to validate Bandwidth Management API (BWA) operations. - -*** Settings *** -Resource environment/variables.txt -Resource ../../pics.txt -Resource ../../GenericKeywords.robot -Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false -Library OperatingSystem - - -*** Test Cases *** -Request the list of configured bandwidth allocations - [Documentation] TC_MEC_SRV_BWA_001_OK - ... Check that the IUT responds with the list of configured bandwidth allocations when queried by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.4.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Retrieve the list of configured bandwidth allocations ${APP_INSTANCE_ID} - Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is BwInfo - Check AppInstanceId ${APP_INSTANCE_ID} - - -Request the list of configured bandwidth allocations with wrong app instance id - [Documentation] TC_MEC_SRV_BWA_001_BR - ... 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 V1.1.1, clause 8.4.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Retrieve the list of configured bandwidth allocations ${NON_EXISTENT_APP_INSTANCE_ID} - Check HTTP Response Status Code Is 400 - #Check ProblemDetails 400 - - -Request to register Bandwidth Management Services - [Documentation] TC_MEC_SRV_BWA_002_OK - ... Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.4.3.4 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Registration for bandwidth services ${APP_INSTANCE_ID} BwInfo - Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is BwInfo - Check AppInstanceId ${APP_INSTANCE_ID} - - -Request to register Bandwidth Management Services using wrong parameters - [Documentation] TC_MEC_SRV_BWA_002_BR - ... Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.4.3.4 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Registration for bandwidth services ${APP_INSTANCE_ID} BwInfoError - Check HTTP Response Status Code Is 400 - - -Request for a bandwidth allocation - [Documentation] TC_MEC_SRV_BWA_003_OK - ... Check that the IUT responds with the configured bandwidth allocation when queried by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Get a bandwidth allocation ${ALLOCATION_ID} - Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is BwInfo - Check AppInstanceId ${APP_INSTANCE_ID} - - -Request for a bandwidth allocation using wrong parameters - [Documentation] TC_MEC_SRV_BWA_003_NF - ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.1 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Get a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID} - Check HTTP Response Status Code Is 404 - - -Updates the requested bandwidth requirements - [Documentation] TC_MEC_SRV_BWA_004_OK - ... Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Register Bandwidth Management Service BwInfo - # Test body - Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate - Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is BwInfo - Check AppInstanceId ${APP_INSTANCE_ID} - # Postamble - Unregister Bandwidth Management Service ${ALLOCATION_ID} - -Updates the requested bandwidth requirements using wrong allocationDirection - [Documentation] TC_MEC_SRV_BWA_004_BR - ... 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 V1.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Register Bandwidth Management Service BwInfo - # Test body - Update a bandwidth allocation ${ALLOCATION_ID} BwInfoError - Check HTTP Response Status Code Is 400 - # Postamble - Unregister Bandwidth Management Service ${ALLOCATION_ID} - - -Updates the requested bandwidth requirements using wrong allocationId - [Documentation] TC_MEC_SRV_BWA_004_NF - ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Update a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID} BwInfoUpdate - Check HTTP Response Status Code Is 404 - Check ProblemDetails 404 - - -Updates the requested bandwidth requirements using wrong parameters - [Documentation] TC_MEC_SRV_BWA_004_PF - ... Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.2 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # TODO Application doesn't comply with a required condition??? - # Preamble - Register Bandwidth Management Service BwInfo - # Test body - Update a bandwidth allocation with invalid ETAG ${ALLOCATION_ID} BwInfoUpdate - Check HTTP Response Status Code Is 412 - # Postamble - Unregister Bandwidth Management Service ${ALLOCATION_ID} - - - - -Request for deltas changes - [Documentation] TC_MEC_SRV_BWA_005_OK - ... Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.3 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Register Bandwidth Management Service BwInfo - # Test body - Request a deltas changes ${ALLOCATION_ID} BwInfoUpdateDelta - Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is bwInfo - Check AppInstanceId ${APP_INSTANCE_ID} - # Postamble - Unregister Bandwidth Management Service ${ALLOCATION_ID} - - -Request for deltas changes using invalid requestType - [Documentation] TC_MEC_SRV_BWA_005_BR - ... 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 V1.1.1, clause 8.3.3.3 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Register Bandwidth Management Service BwInfo - # Test body - Request a deltas changes ${ALLOCATION_ID} BwInfoUpdateDeltaError - Check HTTP Response Status Code Is 400 - # Postamble - Unregister Bandwidth Management Service ${ALLOCATION_ID} - - -Request for deltas changes using an unknown URI - [Documentation] TC_MEC_SRV_BWA_005_NF - ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.3 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Request a deltas changes ${NON_EXISTENT_ALLOCATION_ID} BwInfoUpdateDelta - Check HTTP Response Status Code Is 404 - - -Request for deltas changes using wrong parameters - [Documentation] TC_MEC_SRV_BWA_005_PF - ... Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.3 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Register Bandwidth Management Service BwInfo - # Test body - Request a deltas changes with invalid ETAG ${ALLOCATION_ID} BwInfoUpdateDelta - Check HTTP Response Status Code Is 412 - # Postamble - Unregister Bandwidth Management Service ${ALLOCATION_ID} - - -Request to unregister bandwidth Management Service - [Documentation] TC_MEC_SRV_BWA_006_OK - ... Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.5 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 - Register Bandwidth Management Service BwInfo - # Test body - Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - Set Headers {"Content-Length":"0"} - Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${ALLOCATION_ID} - ${output}= Output response - Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 204 - - -Request to unregister bandwidth Management Service with wrong parameters - [Documentation] TC_MEC_SRV_BWA_006_NF - ... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - ... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.5 - ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - # Preamble - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 - # Test body - Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - Set Headers {"Content-Length":"0"} - Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${NON_EXISTENT_ALLOCATION_ID} - ${output}= Output response - Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 404 - Check ProblemDetails 404 - - -*** Keywords *** -Retrieve the list of configured bandwidth allocations - [Arguments] ${app_instance_id} - 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}"} - Set Headers {"Content-Length":"0"} - Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Registration for bandwidth services - [Arguments] ${app_instance_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}"} - Set Headers {"Content-Length":"0"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id} ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Get a bandwidth allocation - [Arguments] ${allocation_id} - 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}"} - Set Headers {"Content-Length":"0"} - Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Update a bandwidth allocation - [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}"} - Set Headers {"If-Match":"${ETAG_VALUE}"} - Set Headers {"Content-Length":"0"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Put ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Update a bandwidth allocation with invalid ETAG - [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}"} - Set Headers {"If-Match":"${INVALID_ETAG}"} - Set Headers {"Content-Length":"0"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Put ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Request a deltas changes - [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}"} - Set Headers {"If-Match":"${ETAG}"} - Set Headers {"Content-Length":"0"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - - -Request a deltas changes with invalid ETAG - [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}"} - Set Headers {"If-Match":"${INVALID_ETAG}"} - Set Headers {"Content-Length":"0"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} - ${output}= Output response - Set Suite Variable ${response} ${output} - - - -Register Bandwidth Management Service - [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}"} - Set Headers {"Content-Length":"0"} - ${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 201 - Check HTTP Response Body Json Schema Is BwInfo - # Extract ETAG_VALUE - Set Suite Variable ${ETAG_VALUE} ${response['status']['ETag']} - Should Not Be Empty ${ETAG_VALUE} - # TODO Extract allocationId not possible, information is missing in the standard doc - Set Suite Variable ${ALLOCATION_ID} ${response['body']['bwInfo']['allocationId']} - Should Not Be Empty ${ALLOCATION_ID} - - -Unregister Bandwidth Management Service - [Arguments] ${value} - 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}"} - Set Headers {"Content-Length":"0"} - Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${value} - ${output}= Output response - Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 204 - - -Check AppInstanceId - [Arguments] ${value} - Log Check AppInstanceId for bwInfo element - Should be Equal ${response['body']['bwInfo']['appInsId']} ${value} - Log AppInstanceId OK - - -Check AllocationId - [Arguments] ${value} - Log Check AllocationId for bwInfo element - Should be Equal ${response['body']['bwInfo']['fixedAllocation']} ${value} - Log AllocationId OK diff --git a/MEC015/SRV/TM/PlatBandwidthManager.robot b/MEC015/SRV/TM/TrafficManagement.robot similarity index 82% rename from MEC015/SRV/TM/PlatBandwidthManager.robot rename to MEC015/SRV/TM/TrafficManagement.robot index c62e40686cb0e1b4ad87781ab22d2c9c5a003814..21f47798bd4557a5f21a0866823001ace969137a 100644 --- a/MEC015/SRV/TM/PlatBandwidthManager.robot +++ b/MEC015/SRV/TM/TrafficManagement.robot @@ -1,4 +1,4 @@ -''[Documentation] robot --outputdir ../../../outputs ./PlatBandwidthManager.robot +''[Documentation] robot --outputdir ../../../outputs ./TrafficManagement.robot ... Test Suite to validate Bandwidth Management API (BWA) operations. *** Settings *** @@ -64,14 +64,15 @@ TP_MEC_MEC015_SRV_TM_003_OK_01 ... 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 BwInfoApplicationSpecific ${REQUEST_TYPE_APPLICATION} + Register Bandwidth Management Service Application specific BwInfoApplicationSpecific TP_MEC_MEC015_SRV_TM_003_OK_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 BwInfoSessionSpecific ${REQUEST_TYPE_SESSION} + Register Bandwidth Management Service Session specific BwInfoSessionSpecific + TP_MEC_MEC015_SRV_TM_003_BR_01 @@ -79,21 +80,21 @@ TP_MEC_MEC015_SRV_TM_003_BR_01 ... 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 ${REQUEST_TYPE_APPLICATION} + Register Bandwidth Management Service with incorrect parameters BwInfo_BR TP_MEC_MEC015_SRV_TM_003_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_BR2 ${REQUEST_TYPE_APPLICATION} + Register Bandwidth Management Service with incorrect parameters BwInfo_BR2 TP_MEC_MEC015_SRV_TM_003_BR_03 [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 ${REQUEST_TYPE_APPLICATION} + Register Bandwidth Management Service with incorrect parameters BwInfo_BR3 @@ -125,12 +126,15 @@ TP_MEC_MEC015_SRV_TM_005_OK ... Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application ... 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 - Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate + ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Update a bandwidth allocation ${ALLOCATION_ID} ${body} 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} - Should Be Equal As Strings ${response['body']['fixedAllocation']} ${FIXED_ALLOCATION} - Should Be Equal As Strings ${response['body']['allocationDirection']} ${ALLOCATION_DIRECTION} + 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_005_BR @@ -138,27 +142,25 @@ TP_MEC_MEC015_SRV_TM_005_BR ... 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.3.3.2 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json - Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate_BR + ${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} Check HTTP Response Status Code Is 400 + TP_MEC_MEC015_SRV_TM_005_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 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 ${NON_EXISTENT_ALLOCATION_ID} BwInfoUpdate Check HTTP Response Status Code Is 404 - -TP_MEC_MEC015_SRV_TM_005_PF - [Documentation] - ... Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application - ... 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 - Update a bandwidth allocation with invalid ETAG ${ALLOCATION_ID} BwInfoUpdate - Check HTTP Response Status Code Is 412 - ##PATCH on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID} TP_MEC_MEC015_SRV_TM_006_OK [Documentation] @@ -166,14 +168,17 @@ TP_MEC_MEC015_SRV_TM_006_OK ... 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 BwInfoApplicationSpecific ${REQUEST_TYPE_APPLICATION} + Register Bandwidth Management Service Application specific BwInfoApplicationSpecific # Test body - Request a deltas changes ${ALLOCATION_ID} BwInfoDeltas + ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate.json + ${body} Get File ${path} + ${json_object}= Evaluate json.loads('''${body}''') json + Request a deltas changes ${ALLOCATION_ID} ${body} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is BwInfo - Should be Equal ${response['body']['appInsId']} ${APP_INSTANCE_ID} - # Postamble - #Unregister Bandwidth Management Service ${ALLOCATION_ID} + 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 [Documentation] @@ -181,38 +186,25 @@ TP_MEC_MEC015_SRV_TM_006_BR ... 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 BwInfoApplicationSpecific ${REQUEST_TYPE_APPLICATION} + Register Bandwidth Management Service Application specific BwInfoApplicationSpecific # Test body - Request a deltas changes ${ALLOCATION_ID} BwInfoDeltas_BR + ${path} Catenate SEPARATOR= jsons/ BwInfoDeltas_BR.json + ${body} Get File ${path} + Request a deltas changes ${ALLOCATION_ID} ${body} Check HTTP Response Status Code Is 400 - # Postamble - #Unregister Bandwidth Management Service ${ALLOCATION_ID} + TP_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 8.3.3.3 ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - Request a deltas changes ${NON_EXISTENT_ALLOCATION_ID} BwInfoDeltas_BR + ${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 - # Postamble - #Unregister Bandwidth Management Service ${ALLOCATION_ID} - - -TP_MEC_MEC015_SRV_TM_006_PF - [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 8.3.3.3 - ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml - # Preamble - Register Bandwidth Management Service BwInfoApplicationSpecific ${REQUEST_TYPE_APPLICATION} - # Test body - Request a deltas changes with invalid ETAG ${ALLOCATION_ID} BwInfoDeltas - Check HTTP Response Status Code Is 412 - # Postamble - #Unregister Bandwidth Management Service ${ALLOCATION_ID} - + ##DELETE on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID} TP_MEC_MEC015_SRV_TM_007_OK [Documentation] @@ -296,43 +288,36 @@ Get a bandwidth allocation Update a bandwidth allocation - [Arguments] ${allocation_id} ${content} + [Arguments] ${allocation_id} ${body} 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}"} - Set Headers {"If-Match":"${ETAG_VALUE}"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} Put ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} -Update a bandwidth allocation with invalid ETAG - [Arguments] ${allocation_id} ${content} +Request a deltas changes + [Arguments] ${allocation_id} ${body} 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}"} - Set Headers {"If-Match":"${INVALID_ETAG}"} - ${file}= Catenate SEPARATOR= jsons/ ${content} .json - ${body}= Get File ${file} - Put ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} + Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} -Request a deltas changes +Request a deltas changes with invalid ETAG [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}"} - Set Headers {"If-Match":"${ETAG}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} @@ -340,23 +325,22 @@ Request a deltas changes Set Suite Variable ${response} ${output} -Request a deltas changes with invalid ETAG - [Arguments] ${allocation_id} ${content} +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}"} - Set Headers {"If-Match":"${INVALID_ETAG}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} + 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 with incorrect parameters - [Arguments] ${content} ${request_type} +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"} @@ -364,13 +348,22 @@ Register Bandwidth Management Service with incorrect parameters Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} + ${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 400 + 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 - [Arguments] ${content} ${request_type} + +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"} @@ -383,15 +376,13 @@ Register Bandwidth Management Service 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']} ${APP_INSTANCE_ID} - Should Be Equal As Strings ${response['body']['requestType']} ${request_type} - Should Be Equal As Strings ${response['body']['fixedAllocation']} ${FIXED_ALLOCATION} - Should Be Equal As Strings ${response['body']['allocationDirection']} ${ALLOCATION_DIRECTION} - - # Extract ETAG_VALUE - Set Suite Variable ${ETAG_VALUE} ${response['headers']['ETag']} - Should Not Be Empty ${ETAG_VALUE} + 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']} + diff --git a/MEC015/SRV/TM/environment/variables.txt b/MEC015/SRV/TM/environment/variables.txt index e4bea3de5959270e78cb78be1bcb84f4f2054b49..4a9a19d206d06ac729a77a2e01884176ed4275eb 100644 --- a/MEC015/SRV/TM/environment/variables.txt +++ b/MEC015/SRV/TM/environment/variables.txt @@ -15,12 +15,10 @@ ${apiVersion} v1 ${CORRECT_FILTER} app_instance_id -${BAD_FILTER} app_id +${BAD_FILTER} appInsId ${APP_INSTANCE_ID} 5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f ${NON_EXISTENT_APP_INSTANCE_ID} NON_EXISTENT_INSTANCE_ID -${REQUEST_TYPE_APPLICATION} 0 -${REQUEST_TYPE_SESSION} 1 ${FIXED_ALLOCATION} 32 ${ALLOCATION_DIRECTION} 00 diff --git a/MEC015/SRV/TM/jsons/BwInfoSessionSpecific.json b/MEC015/SRV/TM/jsons/BwInfoSessionSpecific.json index 3f80a537841ff8f83c1093bc388919011c6d0d2c..d81e4f3c29d4d9607051774a64b4a1f0f15def53 100644 --- a/MEC015/SRV/TM/jsons/BwInfoSessionSpecific.json +++ b/MEC015/SRV/TM/jsons/BwInfoSessionSpecific.json @@ -2,5 +2,18 @@ "appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", "requestType": 1, "fixedAllocation": "32", - "allocationDirection": "00" + "allocationDirection": "00", + "sessionFilter": [{ + "protocol": "123", + "sourceIp": "10.10.0.3", + "dstAddress": "1234", + "dstPort": [ + "1234", + "1334" + ], + "sourcePort": [ + "8080", + "8082" + ] + }] } \ 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 470f4667e09dea6eb022f4b9986ff021193af780..c08fbf8f964e22eedee76028aecdcb5479ec2c7b 100644 --- a/MEC015/SRV/TM/jsons/BwInfo_BR2.json +++ b/MEC015/SRV/TM/jsons/BwInfo_BR2.json @@ -2,5 +2,18 @@ "appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f", "requestType": 0, "fixedAllocation": "-30", - "allocationDirection": "00" + "allocationDirection": "00", + "sessionFilter": [{ + "protocol": "123", + "sourceIp": "10.10.0.3", + "dstAddress": "1234", + "dstPort": [ + "1234", + "1334" + ], + "sourcePort": [ + "8080", + "8082" + ] + }] } \ No newline at end of file