''[Documentation] robot --outputdir ../../outputs ./PlatBandwidthManager.robot ''[Documentation] robot --outputdir ../../../outputs ./TrafficManagement.robot
... Test Suite to validate Bandwidth Management API (BWA) operations. ... Test Suite to validate Bandwidth Management API (BWA) operations.
*** Settings *** *** Settings ***
Resource environment/variables.txt Resource environment/variables.txt
Resource ../../pics.txt Resource ../../../pics.txt
Resource ../../GenericKeywords.robot Resource ../../../GenericKeywords.robot
Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false
Library OperatingSystem Library OperatingSystem
##GET on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations
*** Test Cases *** *** Test Cases ***
Request the list of configured bandwidth allocations TP_MEC_MEC015_SRV_TM_001_OK
[Documentation] TC_MEC_SRV_BWA_001_OK [Documentation]
... Check that the IUT responds with the list of configured bandwidth allocations when queried by a MEC Application ... 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 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 ... 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} Retrieve the list of configured bandwidth allocations
Check HTTP Response Status Code Is 200 Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is BwInfo Check HTTP Response Body Json Schema Is BwInfo
Check AppInstanceId ${APP_INSTANCE_ID} 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}
Request the list of configured bandwidth allocations with wrong app instance id TP_MEC_MEC015_SRV_TM_002_OK
[Documentation] TC_MEC_SRV_BWA_001_BR [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
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
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}
TP_MEC_MEC015_SRV_TM_002_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 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 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 ... 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} Retrieve the list of configured bandwidth using filter ${BAD_FILTER} ${APP_INSTANCE_ID}
Check HTTP Response Status Code Is 400 Check HTTP Response Status Code Is 400
#Check ProblemDetails 400
TP_MEC_MEC015_SRV_TM_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
... 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
Retrieve the list of configured bandwidth using filter ${CORRECT_FILTER} ${NON_EXISTENT_APP_INSTANCE_ID}
Check HTTP Response Status Code Is 404
Request to register Bandwidth Management Services
[Documentation] TC_MEC_SRV_BWA_002_OK ##POST on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations
TP_MEC_MEC015_SRV_TM_003_OK_01
[Documentation]
... Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application ... 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 ... 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 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json
Registration for bandwidth services ${APP_INSTANCE_ID} BwInfo Register Bandwidth Management Service Application specific BwInfoApplicationSpecific
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 TP_MEC_MEC015_SRV_TM_003_OK_02
[Documentation] TC_MEC_SRV_BWA_002_BR [Documentation]
... Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application ... 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 ... 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 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json
Registration for bandwidth services ${APP_INSTANCE_ID} BwInfoError Register Bandwidth Management Service Session specific BwInfoSessionSpecific
Check HTTP Response Status Code Is 400
TP_MEC_MEC015_SRV_TM_003_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_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
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 for a bandwidth allocation
[Documentation] TC_MEC_SRV_BWA_003_OK ##GET on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID}
TP_MEC_MEC015_SRV_TM_004_OK
[Documentation]
... Check that the IUT responds with the configured bandwidth allocation when queried by a MEC Application ... 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 ... 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 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json
Get a bandwidth allocation ${ALLOCATION_ID} Get a bandwidth allocation ${ALLOCATION_ID}
Check HTTP Response Status Code Is 200 Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is BwInfo Check HTTP Response Body Json Schema Is BwInfo
Check AppInstanceId ${APP_INSTANCE_ID} Should Be Equal As Strings ${response['body']['appInsId']} ${APP_INSTANCE_ID}
Request for a bandwidth allocation using wrong parameters TP_MEC_MEC015_SRV_TM_004_NF
[Documentation] TC_MEC_SRV_BWA_003_NF [Documentation]
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application ... 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 ... 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 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json
Get a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID} Get a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID}
Check HTTP Response Status Code Is 404 Check HTTP Response Status Code Is 404
Updates the requested bandwidth requirements ##PUT on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID}
[Documentation] TC_MEC_SRV_BWA_004_OK TP_MEC_MEC015_SRV_TM_005_OK
[Documentation]
... Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application ... 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 ... 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 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json
# Preamble ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate.json
Register Bandwidth Management Service BwInfo ${body} Get File ${path}
# Test body ${json_object}= Evaluate json.loads('''${body}''') json
Update a bandwidth allocation ${ALLOCATION_ID} BwInfoUpdate Update a bandwidth allocation ${ALLOCATION_ID} ${body}
Check HTTP Response Status Code Is 200 Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is BwInfo Check HTTP Response Body Json Schema Is BwInfo
Check AppInstanceId ${APP_INSTANCE_ID} Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']}
# Postamble Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']}
Unregister Bandwidth Management Service ${ALLOCATION_ID} Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']}
Updates the requested bandwidth requirements using wrong allocationDirection
[Documentation] TC_MEC_SRV_BWA_004_BR TP_MEC_MEC015_SRV_TM_005_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 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 ... 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 ... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json
# Preamble ${path} Catenate SEPARATOR= jsons/ BwInfoUpdate_BR.json
Register Bandwidth Management Service BwInfo ${body} Get File ${path}
# Test body ${json_object}= Evaluate json.loads('''${body}''') json
Update a bandwidth allocation ${ALLOCATION_ID} BwInfoError Update a bandwidth allocation ${ALLOCATION_ID} ${body}
Check HTTP Response Status Code Is 400 Check HTTP Response Status Code Is 400
# Postamble
Unregister Bandwidth Management Service ${ALLOCATION_ID}
Updates the requested bandwidth requirements using wrong allocationId TP_MEC_MEC015_SRV_TM_005_NF
[Documentation] TC_MEC_SRV_BWA_004_NF [Documentation]
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application ... 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 ... 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 ... 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 Update a bandwidth allocation ${NON_EXISTENT_ALLOCATION_ID} BwInfoUpdate
Check HTTP Response Status Code Is 404 Check HTTP Response Status Code Is 404
Check ProblemDetails 404
Updates the requested bandwidth requirements using wrong parameters ##PATCH on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID}
[Documentation] TC_MEC_SRV_BWA_004_PF TP_MEC_MEC015_SRV_TM_006_OK
... Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition [Documentation]
... 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 ... 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 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3
... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
# Preamble # Preamble
Register Bandwidth Management Service BwInfo Register Bandwidth Management Service Application specific BwInfoApplicationSpecific
# Test body # Test body
Request a deltas changes ${ALLOCATION_ID} BwInfoUpdateDelta ${path} Catenate SEPARATOR= jsons/ BwInfoDeltas.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 Status Code Is 200
Check HTTP Response Body Json Schema Is bwInfo Check HTTP Response Body Json Schema Is BwInfoDelta
Check AppInstanceId ${APP_INSTANCE_ID} Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']}
# Postamble Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']}
Unregister Bandwidth Management Service ${ALLOCATION_ID} Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']}
Request for deltas changes using invalid requestType TP_MEC_MEC015_SRV_TM_006_BR
[Documentation] TC_MEC_SRV_BWA_005_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 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 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3
... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
# Preamble # Preamble
Register Bandwidth Management Service BwInfo Register Bandwidth Management Service Application specific BwInfoApplicationSpecific
# Test body # Test body
Request a deltas changes ${ALLOCATION_ID} BwInfoUpdateDeltaError ${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 Check HTTP Response Status Code Is 400
# Postamble
Unregister Bandwidth Management Service ${ALLOCATION_ID}
Request for deltas changes using an unknown URI TP_MEC_MEC015_SRV_TM_006_NF
[Documentation] TC_MEC_SRV_BWA_005_NF [Documentation]
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application ... 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 ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.3
... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
Request a deltas changes ${NON_EXISTENT_ALLOCATION_ID} BwInfoUpdateDelta ${path} Catenate SEPARATOR= jsons/ BwInfoDeltas_BR.json
Check HTTP Response Status Code Is 404 ${body} Get File ${path}
Request a deltas changes ${NON_EXISTENT_ALLOCATION_ID} ${body}
Check HTTP Response Status Code Is 400
Request for deltas changes using wrong parameters ##DELETE on ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/{ALLOCATION_ID}
[Documentation] TC_MEC_SRV_BWA_005_PF TP_MEC_MEC015_SRV_TM_007_OK
... Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition [Documentation]
... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.3 ... Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application
... Reference https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.json ... ETSI GS MEC 015 V2.1.1, clause 8.3.3.5
# Preamble ... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
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} Unregister Bandwidth Management Service ${ALLOCATION_ID}
Check HTTP Response Status Code Is 204
TP_MEC_MEC015_SRV_TM_007_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.5
... https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
Unregister Bandwidth Management Service ${NON_EXISTENT_ALLOCATION_ID}
Check HTTP Response Status Code Is 404
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 *** Keywords ***
... Reference ETSI GS MEC 015 V1.1.1, clause 8.3.3.5 Retrieve the list of configured bandwidth allocations
... 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_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Register Bandwidth Management Service BwInfo
# Test body
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"} Set Headers {"Content-Length":"0"}
Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${ALLOCATION_ID} GET ${apiRoot}/${apiName}/${apiVersion}/bw_allocations
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 204
Request to unregister bandwidth Management Service with wrong parameters Retrieve the list of configured bandwidth using filter
[Documentation] TC_MEC_SRV_BWA_006_NF [Arguments] ${filter} ${value}
... 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_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
# Test body
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"} Set Headers {"Content-Length":"0"}
Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${NON_EXISTENT_ALLOCATION_ID} Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations?${filter}=${value}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 404
Check ProblemDetails 404
*** Keywords *** Retrieve a configured bandwidth allocations
Retrieve the list of configured bandwidth allocations
[Arguments] ${app_instance_id} [Arguments] ${app_instance_id}
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"} Set Headers {"Content-Length":"0"}
Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id} Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id}
...@@ -241,7 +268,6 @@ Registration for bandwidth services ...@@ -241,7 +268,6 @@ Registration for bandwidth services
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
${file}= Catenate SEPARATOR= jsons/ ${content} .json ${file}= Catenate SEPARATOR= jsons/ ${content} .json
${body}= Get File ${file} ${body}= Get File ${file}
Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id} ${body} Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${app_instance_id} ${body}
...@@ -254,87 +280,81 @@ Get a bandwidth allocation ...@@ -254,87 +280,81 @@ Get a bandwidth allocation
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} Get ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Update 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_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} 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} Put ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Update a bandwidth allocation with invalid ETAG Request a deltas changes
[Arguments] ${allocation_id} ${content} [Arguments] ${allocation_id} ${body}
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"If-Match":"${INVALID_ETAG}"} Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body}
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 ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Request a deltas changes Register Bandwidth Management Service with incorrect parameters
[Arguments] ${allocation_id} ${content} [Arguments] ${content}
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"If-Match":"${ETAG}"}
Set Headers {"Content-Length":"0"}
${file}= Catenate SEPARATOR= jsons/ ${content} .json ${file}= Catenate SEPARATOR= jsons/ ${content} .json
${body}= Get File ${file} ${body}= Get File ${file}
Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 400
Register Bandwidth Management Service Session specific
Request a deltas changes with invalid ETAG [Arguments] ${content}
[Arguments] ${allocation_id} ${content}
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"If-Match":"${INVALID_ETAG}"}
Set Headers {"Content-Length":"0"}
${file}= Catenate SEPARATOR= jsons/ ${content} .json ${file}= Catenate SEPARATOR= jsons/ ${content} .json
${body}= Get File ${file} ${body}= Get File ${file}
Patch ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id} ${body} ${json_object}= Evaluate json.loads('''${body}''') json
Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} 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
Register Bandwidth Management Service
[Arguments] ${content} [Arguments] ${content}
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
${file}= Catenate SEPARATOR= jsons/ ${content} .json ${file}= Catenate SEPARATOR= jsons/ ${content} .json
${body}= Get File ${file} ${body}= Get File ${file}
Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body} Post ${apiRoot}/${apiName}/${apiVersion}/bw_allocations ${body}
...@@ -342,12 +362,14 @@ Register Bandwidth Management Service ...@@ -342,12 +362,14 @@ Register Bandwidth Management Service
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 201 Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is BwInfo Check HTTP Response Body Json Schema Is BwInfo
# Extract ETAG_VALUE ${json_object}= Evaluate json.loads('''${body}''') json
Set Suite Variable ${ETAG_VALUE} ${response['status']['ETag']} Should Not Be Empty ${response['headers']['Location']}
Should Not Be Empty ${ETAG_VALUE} Should Be Equal As Strings ${response['body']['appInsId']} ${json_object['appInsId']}
# TODO Extract allocationId not possible, information is missing in the standard doc Should Be Equal As Strings ${response['body']['requestType']} ${json_object['requestType']}
Set Suite Variable ${ALLOCATION_ID} ${response['body']['bwInfo']['allocationId']} Should Be Equal As Strings ${response['body']['fixedAllocation']} ${json_object['fixedAllocation']}
Should Not Be Empty ${ALLOCATION_ID} Should Be Equal As Strings ${response['body']['allocationDirection']} ${json_object['allocationDirection']}
Unregister Bandwidth Management Service Unregister Bandwidth Management Service
...@@ -355,24 +377,8 @@ Unregister Bandwidth Management Service ...@@ -355,24 +377,8 @@ Unregister Bandwidth Management Service
Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"*/*"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${value} Delete ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${value}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} 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
*** Variables *** *** Variables ***
# Generic variables # Generic variables
${SCHEMA} http ${SCHEMA} http
${HOST} 10.192.2.172 ${HOST} 127.0.0.1
${PORT} 8081 ${PORT} 8082
${response} {} ${response} {}
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${apiRoot} ${apiRoot}
...@@ -14,14 +14,19 @@ ${apiVersion} v1 ...@@ -14,14 +14,19 @@ ${apiVersion} v1
${CORRECT_FILTER} app_instance_id
${BAD_FILTER} appInsId
${APP_INSTANCE_ID} 5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f ${APP_INSTANCE_ID} 5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f
${NON_EXISTENT_APP_INSTANCE_ID} NON_EXISTENT_INSTANCE_ID ${NON_EXISTENT_APP_INSTANCE_ID} NON_EXISTENT_INSTANCE_ID
${FIXED_ALLOCATION} 32
${ALLOCATION_DIRECTION} 00
${APP_SRVSUB_NOTIF_CALLBACK_URI} http://127.0.0.1/subscribe ${APP_SRVSUB_NOTIF_CALLBACK_URI} http://127.0.0.1/subscribe
${SUBSCRIPTION_ID} e0deee2b-6e50-4f33-ab09-8bf0585025d3 ${SUBSCRIPTION_ID} e0deee2b-6e50-4f33-ab09-8bf0585025d3
${NON_EXISTENT_SUBSCRIPTION_ID} NON_EXISTENT_SUBSCRIPTION_ID ${NON_EXISTENT_SUBSCRIPTION_ID} NON_EXISTENT_SUBSCRIPTION_ID
${ALLOCATION_ID} 59ab1593-d330-4087-85ec-4e484092f306 ${ALLOCATION_ID} 59ab1593-d330-4087-85ec-4e484092f306
${NON_EXISTENT_ALLOCATION_ID} NON_EXISTENT_ALLOCATION_ID ${NON_EXISTENT_ALLOCATION_ID} NON_EXISTENT_ALLOCATION_ID
${INVALID_ETAG} ${INVALID_ETAG} INVALID_ETAG
${ETAG_VALUE} ${ETAG_VALUE}
${ETAG} ${ETAG}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 0,
"fixedAllocation": "32",
"allocationDirection": "00"
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 0,
"fixedAllocation": "32",
"allocationDirection": "01"
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": "INVALID_VALUE",
"fixedAllocation": "32",
"allocationDirection": "01"
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 1,
"fixedAllocation": "32",
"allocationDirection": "00",
"sessionFilter": [{
"protocol": "123",
"sourceIp": "10.10.0.3",
"dstAddress": "1234",
"dstPort": [
"1234",
"1334"
],
"sourcePort": [
"8080",
"8082"
]
}]
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 0,
"fixedAllocation": "32",
"allocationDirection": "01"
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 0,
"fixedAllocation": "64",
"allocationDirection": "INVALID_VALUE"
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 0,
"fixedAllocation": "INVALID_VALUE",
"allocationDirection": "00"
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 0,
"fixedAllocation": "-30",
"allocationDirection": "00",
"sessionFilter": [{
"protocol": "123",
"sourceIp": "10.10.0.3",
"dstAddress": "1234",
"dstPort": [
"1234",
"1334"
],
"sourcePort": [
"8080",
"8082"
]
}]
}
\ No newline at end of file
{
"appInsId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
"requestType": 1,
"sessionFilter":"",
"fixedAllocation": "10",
"allocationDirection": "00"
}
\ No newline at end of file
{
"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
{
"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
...@@ -3,152 +3,168 @@ ...@@ -3,152 +3,168 @@
*** Settings *** *** Settings ***
Resource environment/variables.txt Resource environment/variables.txt
Resource ../../pics.txt Resource ../../../pics.txt
Resource ../../GenericKeywords.robot Resource ../../../GenericKeywords.robot
Resource resources/UeAppsContextAPI.robot
Library String Library String
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases *** *** Test Cases ***
Creation of the application context TP_MEC_MEC016_MEO_UEAPPCTX_001_OK
[Documentation] TC_MEC_MEO_UEAPPCTX_001_OK [Documentation]
... Check that the IUT acknowledges the creation of the application context when requested by an UE Application ... Check that the IUT acknowledges the creation of the application context when requested by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4 ... Reference ETSI GS MEC 016 v2.2.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Create application context ${CREATE_APP_CTX} Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create application context AppContext.json
Check HTTP Response Status Code Is 201 Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is AppContext Check HTTP Response Body Json Schema Is AppContext
Should Be True ${response['body']['appContext']['appInfo']['appName']} == ${APP_NAME} Check HTTP Response Header Contains Location
# Postamble Should Be Equal As Strings ${response['body']['appInfo']['appName']} MyNewWornderfulApp
Delete an application context ${APP_CTX_ID} Set Suite Variable ${contextId} ${response['body']['contextId']}
Creation of the application context with wrong parameters TP_MEC_MEC016_MEO_UEAPPCTX_001_BR
[Documentation] TC_MEC_MEO_UEAPPCTX_001_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 an error when a request with incorrect URL is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4 ... Reference ETSI GS MEC 016 v2.2.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Create application context ${CREATE_APP_CTX_BR} Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create application context AppContext_BR.json
Check HTTP Response Status Code Is 400 Check HTTP Response Status Code Is 400
Check ProblemDetails 400
Update of the application context TP_MEC_MEC016_MEO_UEAPPCTX_001_NF
[Documentation] TC_MEC_MEO_UEAPPCTX_002_OK [Documentation]
... Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application
... Reference ETSI GS MEC 016 v2.2.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create application context using wrong endpoint AppContext.json
Check HTTP Response Status Code Is 404
TP_MEC_MEC016_MEO_UEAPPCTX_002_OK
[Documentation]
... Check that the IUT updates the application callback reference when commanded by an UE Application ... Check that the IUT updates the application callback reference when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2 ... Reference ETSI GS MEC 016 v2.2.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1 Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body # Test Body
${CREATE_APP_CTX}= Set Variable ${CALLBACK_REFERENCE_1} Update application context ${contextId} UpdateAppContext.json
Update application context ${APP_CTX_ID} ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 204 Check HTTP Response Status Code Is 204
Check HTTP Response Body Json Schema Is AppContext
Should Be True ${response['body']['appContext']['callbackReference']} == ${CALLBACK_REFERENCE_1}
# Postamble
Delete an application context ${APP_CTX_ID}
TP_MEC_MEC016_MEO_UEAPPCTX_002_BR
Update of the application context with wrong parameters [Documentation]
[Documentation] TC_MEC_MEO_UEAPPCTX_002_BR
... 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 an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2 ... Reference ETSI GS MEC 016 v2.2.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1 Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Create an application context Update application context ${contextId} UpdateAppContext_BR.json
# Test Body
${CREATE_APP_CTX}= Set Variable '' # Empty string
Update application context ${APP_CTX_ID} ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 400 Check HTTP Response Status Code Is 400
Check ProblemDetails 400
# Postamble
Delete an application context ${APP_CTX_ID}
Update of the application context with unknown URI TP_MEC_MEC016_MEO_UEAPPCTX_002_NF
[Documentation] TC_MEC_MEO_UEAPPCTX_002_NF [Documentation]
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application ... 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 016 V1.1.1, clause 7.5.3.2 ... Reference ETSI GS MEC 016 2.2.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
# Preamble # Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1 Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Create an application context Update application context using wrong endpoint ${contextId} UpdateAppContext.json
# Test Body
${CREATE_APP_CTX}= Set Variable ${CALLBACK_REFERENCE_1}
Update application context ${NON_EXISTENT_APP_CTX_ID} ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 404 Check HTTP Response Status Code Is 404
Check ProblemDetails 404
# Postamble
Delete an application context ${APP_CTX_ID}
Delete of the application context TP_MEC_MEC016_MEO_UEAPPCTX_003_OK
[Documentation] TC_MEC_MEO_UEAPPCTX_003_OK [Documentation]
... Check that the IUT deletes the application context when commanded by an UE Application ... Check that the IUT deletes the application context when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5 ... Reference ETSI GS MEC 016 2.2.1, clause 7.5.3.5
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble # Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1 Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
Create an application context Delete application context ${contextId}
# Test Body
Delete application context ${APP_CTX_ID}
Check HTTP Response Status Code Is 204 Check HTTP Response Status Code Is 204
Delete of the application context with non esistent APP CTX ID TP_MEC_MEC016_MEO_UEAPPCTX_003_NF
[Documentation] TC_MEC_MEO_UEAPPCTX_003_NF [Documentation]
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application ... Check that the IUT deletes the application context when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5 ... Reference ETSI GS MEC 016 2.2.1, clause 7.5.3.5
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext ... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble # Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1 Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1 Should Be True ${PIC_SERVICES} == 1
# AppCtx not created! Delete application context ${NON_EXISTING_CONTEXT_ID}
# Test Body
Delete application context ${APP_CTX_ID}
Check HTTP Response Status Code Is 404 Check HTTP Response Status Code Is 404
Check ProblemDetails 404
*** Keywords *** *** Keywords ***
Create application context Create application context
[Arguments] ${content} [Arguments] ${content}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"} Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"} ${path} Catenate SEPARATOR= jsons/ ${content}
Post /exampleAPI/mx2/v2/app_contexts ${content} ${body} Get File ${path}
Post ${apiRoot}/${apiName}/${apiVersion}/app_contexts ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Create application context using wrong endpoint
[Arguments] ${content}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${path} Catenate SEPARATOR= jsons/ ${content}
${body} Get File ${path}
Post ${apiRoot}/${apiName}/${apiVersion}/app_contexts_error ${body}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Update application context Update application context
[Arguments] ${context_id} ${content} [Arguments] ${context_id} ${content}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"} ${path} Catenate SEPARATOR= jsons/ ${content}
Put /exampleAPI/mx2/v2/app_contexts/${context_id} ${content} ${body} Get File ${path}
Put ${apiRoot}/${apiName}/${apiVersion}/app_contexts/${context_id} ${body}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
Update application context using wrong endpoint
[Arguments] ${context_id} ${content}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${path} Catenate SEPARATOR= jsons/ ${content}
${body} Get File ${path}
Put ${apiRoot}/${apiName}/${apiVersion}/app_contexts_error/${context_id} ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Delete application context Delete application context
[Arguments] ${context_id} [Arguments] ${context_id}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"} Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"} Set Headers {"Content-Length":"0"}
Delete /exampleAPI/mx2/v2/app_contexts/${context_id} Delete ${apiRoot}/${apiName}/${apiVersion}/app_contexts/${context_id}
${output}= Output response
Set Suite Variable ${response} ${output}
Delete application context using wrong endpoint
[Arguments] ${context_id}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete ${apiRoot}/${apiName}/${apiVersion}/app_contexts_error/${context_id}
${output}= Output response ${output}= Output response
Set Suite Variable ${response} ${output} Set Suite Variable ${response} ${output}
*** Variables ***
${apiRoot}
${apiName} dev_app
${apiVersion} v1
${MEC-APP_SCHEMA} http
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${contextId}
${NON_EXISTING_CONTEXT_ID} NON_EXISTING_CONTEXT_ID
\ No newline at end of file
{
"associateDevAppId":"MyNewWornderfulDevAppId",
"appInfo":{
"appName":"MyNewWornderfulApp",
"appProvider":"TTF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}
{
"associateDevAppId":"MyNewWornderfulDevAppId",
"appInfo":{
"app":"MyNewWornderfulApp",
"appProvider":"TTF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}
{
"associateDevAppId":"MyNewWornderfulDevAppId",
"contextId": "1",
"callbackReference": "http://127.0.0.1/callbackuri",
"appInfo":{
"appName":"MyNewWornderfulApp",
"appProvider":"TTF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}