Commit 5b8ac7d0 authored by Ikram Haq's avatar Ikram Haq
Browse files

Update TrafficManagement test suite and related resources for dynamic allocationId handling

- Modified TrafficManagement.robot to inject allocationId into request bodies at runtime and fixed related test logic
- Updated environment/variables_sandbox.txt for test execution compatibility
- Updated BwInfoApplicationSpecific.json, BwInfoDeltas.json, and BwInfoUpdate.json to align with new runtime requirements
parent efebddd7
Loading
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ Resource ../../../GenericKeywords.robot
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     OperatingSystem    
Library     String
Library     Collections

*** Test Cases ***

@@ -123,6 +124,8 @@ TC_MEC_MEC015_SRV_TM_002_OK
    ...  ETSI GS MEC 015 v3.1.1, clause 8.4.3.4 
     [Setup]   Create new App Instance   CreateAppInstanceRequest 
     Registration for bandwidth services  ${APP_INSTANCE_ID}   BwInfoApplicationSpecific
     ${elements} =  Split String    ${response['headers']['Location']}       /
     Set Suite Variable    ${ALLOCATION_ID}    ${elements}[-1]
     Check HTTP Response Status Code Is    201 
     Check HTTP Response Body Json Schema Is   BwInfo
     ${appInsId}    Get value entry from JSON file    BwInfoApplicationSpecific   appInsId
@@ -133,7 +136,7 @@ TC_MEC_MEC015_SRV_TM_002_OK
     Should Be Equal As Strings  ${response['body']['requestType']}    ${requestType}  
     Should Be Equal As Strings  ${response['body']['fixedAllocation']}    ${fixedAllocation}  
     Should Be Equal As Strings  ${response['body']['allocationDirection']}    ${allocationDirection}  
     [TearDown]    Delete App Instance   ${APP_INSTANCE_ID}    
     [TearDown]    Unregister bw Service And Delete APP Instance    ${ALLOCATION_ID}    ${APP_INSTANCE_ID}    
    

TC_MEC_MEC015_SRV_TM_002_BR_01
@@ -195,7 +198,7 @@ TC_MEC_MEC015_SRV_TM_004_OK
    ...  ETSI GS MEC 015 v3.1.1, clause 6.2.4
    ...  ETSI GS MEC 015 v3.1.1, clause 7.2.2
    ...  ETSI GS MEC 015 v3.1.1, clause 8.3.3.2
    #[Setup]    Create new App Instance and Register for bw service   CreateAppInstanceRequest     BwInfoApplicationSpecific
    [Setup]    Create new App Instance and Register for bw service   CreateAppInstanceRequest     BwInfoApplicationSpecific
    Update a bandwidth allocation   ${ALLOCATION_ID}   BwInfoUpdate
    ${appInsId}    Get value entry from JSON file    BwInfoUpdate   appInsId
    ${fixedAllocation}    Get value entry from JSON file    BwInfoUpdate   fixedAllocation
@@ -205,7 +208,7 @@ TC_MEC_MEC015_SRV_TM_004_OK
    Should Be Equal As Strings  ${response['body']['appInsId']}    ${appInsId} 
    Should Be Equal As Strings  ${response['body']['fixedAllocation']}    ${fixedAllocation}
    Should Be Equal As Strings  ${response['body']['allocationDirection']}   ${allocationDirection}
    #[TearDown]   Unregister bw Service And Delete APP Instance    ${ALLOCATION_ID}    ${APP_INSTANCE_ID}
    [TearDown]   Unregister bw Service And Delete APP Instance    ${ALLOCATION_ID}    ${APP_INSTANCE_ID}


TC_MEC_MEC015_SRV_TM_004_BR_01
@@ -326,7 +329,7 @@ Create new App Instance and Register for bw service
     Create new App Instance     ${appInstancePayload}
     Registration for bandwidth services   ${APP_INSTANCE_ID}    ${bwServicePayload}
     ${elements} =  Split String    ${response['headers']['Location']}       /
     Set Suite Variable    ${ALLOCATION_ID}    ${elements}[3]
     Set Suite Variable    ${ALLOCATION_ID}    ${elements}[-1]
     
       
     
@@ -447,6 +450,9 @@ Request a deltas changes
    ${path}    Catenate    SEPARATOR=      jsons/     ${content}.json
    ${body}    Get File    ${path}
    ${json_object}=    Evaluate    json.loads('''${body}''')    json
    # Inject allocation_id into the JSON object
    Set To Dictionary    ${json_object}    allocationId=${allocation_id}
    ${body}=    Evaluate    json.dumps(${json_object})    json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/bw_allocations/${allocation_id}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
+2 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ ${HOST} try-mec.etsi.org
${PORT}                     443
${response}                         {}
${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
${apiRoot}        /<your_token_here>/mep1 
${apiRoot}        sbxme1qzq4/mep1 
${apiName}        bwm
${apiVersion}     v1

@@ -17,7 +17,7 @@ ${apiVersion} v1

${CORRECT_FILTER}						 app_instance_id
${BAD_FILTER}							 appInsId
${APP_INSTANCE_ID}                       81c51643-8c6f-4781-ad45-f8a457ca549b
${APP_INSTANCE_ID}                       f1e4d448-e277-496b-bf63-98391cfd20fb
${NON_EXISTENT_APP_INSTANCE_ID}          NON_EXISTENT_INSTANCE_ID
${SESSION_ID}                            5
${APP_NAME_FILTER}                       app_name
+3 −2
Original line number Diff line number Diff line
{
 "appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b",
 "appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb",
  "requestType": 0,
  "fixedAllocation": "32",
  "allocationDirection": "00"
  "allocationDirection": "00",
  "appName": "appName"
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
{
"appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b",
"appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb",
  "requestType": 0,
  "fixedAllocation": "32",
  "allocationDirection": "01"
+1 −1
Original line number Diff line number Diff line
{
"appInsId": "81c51643-8c6f-4781-ad45-f8a457ca549b",
"appInsId": "f1e4d448-e277-496b-bf63-98391cfd20fb",
  "requestType": 0,
  "fixedAllocation": "32",
  "allocationDirection": "01"