diff --git a/SRV/BWA/PlatBandwidthManager.robot b/SRV/BWA/PlatBandwidthManager.robot index b93883deb82842ee7ce860da895c8fbc31433634..752130bd21679d1f92adf04f15a80e658b367c7f 100644 --- a/SRV/BWA/PlatBandwidthManager.robot +++ b/SRV/BWA/PlatBandwidthManager.robot @@ -9,7 +9,6 @@ Resource resources/BandwidthManagerAPI.robot Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false - *** Test Cases *** Request the list of configured bandwidth allocations [Documentation] TC_MEC_SRV_BWA_001_OK @@ -80,15 +79,15 @@ Updates the requested bandwidth requirements ... 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 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body - Update a bandwidth allocation ${allocation_id} ${REQUEST_FOR_BW_REQUIREMENTS} + Update a bandwidth allocation ${ALLOCATION_ID} ${REQUEST_FOR_BW_REQUIREMENTS} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is bwInfo Check AppInstanceId ${APP_INSTANCE_ID} - Check Allocation ${allocation_id} + Check Allocation ${ALLOCATION_ID} # Postamble - Unregister Bandwidth Management Service ${allocation_id} + Unregister Bandwidth Management Service Updates the requested bandwidth requirements using wrong allocationDirection @@ -97,13 +96,13 @@ Updates the requested bandwidth requirements using wrong allocationDirection ... 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 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body - Update a bandwidth allocation ${allocation_id} ${REQUEST_FOR_BW_REQUIREMENTS_BR} + Update a bandwidth allocation ${ALLOCATION_ID} ${REQUEST_FOR_BW_REQUIREMENTS_BR} Check HTTP Response Status Code Is 400 Check ProblemDetails 400 # Postamble - Unregister Bandwidth Management Service ${allocation_id} + Unregister Bandwidth Management Service Updates the requested bandwidth requirements using wrong allocationId @@ -123,13 +122,13 @@ Updates the requested bandwidth requirements using wrong parameters ... 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 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body - Update a bandwidth allocation with invalid ETAG ${allocation_id} ${REQUEST_FOR_BW_REQUIREMENTS} + Update a bandwidth allocation with invalid ETAG ${ALLOCATION_ID} ${REQUEST_FOR_BW_REQUIREMENTS} Check HTTP Response Status Code Is 412 Check ProblemDetails 412 # Postamble - Unregister Bandwidth Management Service ${allocation_id} + Unregister Bandwidth Management Service Request for deltas changes @@ -138,15 +137,15 @@ Request for deltas changes ... 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 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body - Request a deltas changes ${allocation_id} ${REQUEST_FOR_DELTAS_CHANGES} + Request a deltas changes ${ALLOCATION_ID} ${REQUEST_FOR_DELTAS_CHANGES} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is bwInfo Check AppInstanceId ${APP_INSTANCE_ID} - Check Allocation ${allocation_id} + Check Allocation ${ALLOCATION_ID} # Postamble - Unregister Bandwidth Management Service ${allocation_id} + Unregister Bandwidth Management Service Request for deltas changes using invalid requestType @@ -155,13 +154,13 @@ Request for deltas changes using invalid requestType ... 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 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body - Request a deltas changes ${allocation_id} ${REQUEST_FOR_DELTAS_CHANGES_BR} + Request a deltas changes ${ALLOCATION_ID} ${REQUEST_FOR_DELTAS_CHANGES_BR} Check HTTP Response Status Code Is 400 Check ProblemDetails 400 # Postamble - Unregister Bandwidth Management Service ${allocation_id} + Unregister Bandwidth Management Service Request for deltas changes using an unknown URI @@ -180,13 +179,13 @@ Request for deltas changes using wrong parameters ... 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 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body - Request a deltas changes with invalid ETAG ${allocation_id} ${REQUEST_FOR_DELTAS_CHANGES} + Request a deltas changes with invalid ETAG ${ALLOCATION_ID} ${REQUEST_FOR_DELTAS_CHANGES} Check HTTP Response Status Code Is 412 Check ProblemDetails 412 # Postamble - Unregister Bandwidth Management Service ${allocation_id} + Unregister Bandwidth Management Service Request to unregister bandwidth Management Service @@ -197,13 +196,13 @@ Request to unregister bandwidth Management Service # Preamble Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 - ${allocation_id} ${etag_value}= Register Bandwidth Management Service + Register Bandwidth Management Service # Test body Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Content-Length":"0"} - Delete /exampleAPI/bwm/v1/bw_allocations/${allocation_id} + Delete /exampleAPI/bwm/v1/bw_allocations/${ALLOCATION_ID} ${output}= Output response Set Suite Variable ${response} ${output} Check HTTP Response Status Code Is 204 @@ -230,97 +229,97 @@ Request to unregister bandwidth Management Service with wrong parameters *** 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 /exampleAPI/bwm/v1/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"} - log ${content} - Post /exampleAPI/bwm/v1/bw_allocations/${APP_INSTANCE_ID} ${content} - ${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 /exampleAPI/bwm/v1/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 {"${ETAG_LABEL}":"${ETAG}"} - Set Headers {"Content-Length":"0"} - Put /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} - ${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 {"${ETAG_LABEL}":"${INVALID_ETAG}"} - Set Headers {"Content-Length":"0"} - Put /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} - ${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 {"${ETAG_LABEL}":"${ETAG}"} - Set Headers {"Content-Length":"0"} - Patch /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} - ${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 {"${ETAG_LABEL}":"${INVALID_ETAG}"} - Set Headers {"Content-Length":"0"} - Patch /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} - ${output}= Output response - Set Suite Variable ${response} ${output} +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 /exampleAPI/bwm/v1/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"} + log ${content} + Post /exampleAPI/bwm/v1/bw_allocations/${APP_INSTANCE_ID} ${content} + ${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 /exampleAPI/bwm/v1/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 {"ETag":"${ETAG_VALUE}"} + Set Headers {"Content-Length":"0"} + Put /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} + ${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 {"${ETAG_LABEL}":"${INVALID_ETAG}"} + Set Headers {"Content-Length":"0"} + Put /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} + ${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 {"${ETAG_LABEL}":"${ETAG}"} + Set Headers {"Content-Length":"0"} + Patch /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} + ${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 {"${ETAG_LABEL}":"${INVALID_ETAG}"} + Set Headers {"Content-Length":"0"} + Patch /exampleAPI/bwm/v1/bw_allocations/${allocation_id} ${content} + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SRV/BWA/environment/variables.txt b/SRV/BWA/environment/variables.txt index 8598e0695e0ecce0c940acc1dcd5632c4f722490..c3789a8a5221406daee9e1bb5bcf1f1c72d39bff 100644 --- a/SRV/BWA/environment/variables.txt +++ b/SRV/BWA/environment/variables.txt @@ -4,7 +4,6 @@ ${MEC-APP_SCHEMA} http #${MEC-APP_HOST} 127.0.0.1 ${MEC-APP_HOST} 192.168.56.1 ${MEC-APP_PORT} 8081 -${ETAG_LABEL} Location ${INVALID_ETAG} invalid_etag ${APP_INSTANCE_ID} appInst01 ${NON_EXISTENT_APP_INSTANCE_ID} appInst99 @@ -17,3 +16,5 @@ ${REQUEST_FOR_DELTAS_CHANGES} { "appInsId": "${APP_INSTANCE_ID}", "request ${REQUEST_FOR_DELTAS_CHANGES_BR} { "appInsId": "${APP_INSTANCE_ID}", "requestType": "UNKNOWN", "fixedBWPriority": "not defined in the present document", "fixedAllocation": "string", "allocationDirection": "00 = Downlink (towards the UE)"} ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l + +${ETAG_VALUE} diff --git a/SRV/BWA/resources/BandwidthManagerAPI.robot b/SRV/BWA/resources/BandwidthManagerAPI.robot index 59b0099d147cc677ea64727507ca372632ff0281..bf9d5b4fcfc21885c09e7afbef7b3e224c44c209 100644 --- a/SRV/BWA/resources/BandwidthManagerAPI.robot +++ b/SRV/BWA/resources/BandwidthManagerAPI.robot @@ -7,39 +7,40 @@ Library JSONSchemaLibrary schemas/ *** Keywords *** - Register Bandwidth Management Service +Register Bandwidth Management Service ... Register a Bandwidth Management Service - 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"} - Post /exampleAPI/bwm/v1/bw_allocations ${REQUEST_FOR_BW_REQUIREMENTS} - ${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 - ${etag_value}= ${response['status']['${etag_label}']} - # TODO Extract allocationId - ${allocation_id}= 'todo' - [return] ${allocation_id} ${etag_value} - - - Unregister Bandwidth Management Service - ... Unregister a 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 /exampleAPI/bwm/v1/bw_allocations/${value} - ${output}= Output response - Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 204 + 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"} + Post /exampleAPI/bwm/v1/bw_allocations ${REQUEST_FOR_BW_REQUIREMENTS} + ${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 + ... Unregister a 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 /exampleAPI/bwm/v1/bw_allocations/${value} + ${output}= Output response + Set Suite Variable ${response} ${output} + Check HTTP Response Status Code Is 204 Check AppInstanceId