[VOL-4095] Updated keyword Get Bandwidth Profile Name For Given Subscriber to also use Service Type as input
Change-Id: I9c082dd7bcf96bac218cf608ff1c38fa8fca8110
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 6680a34..20437c0 100755
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -1189,9 +1189,15 @@
[return] ${output}
Get Bandwidth Profile Name For Given Subscriber
- [Arguments] ${subscriber_id} ${stream_type}=upstreamBandwidthProfile
+ [Arguments] ${subscriber_id} ${stream_type}=upstreamBandwidthProfile ${service_type}=${EMPTY}
[Documentation] Keyword to get the bandwidth details of the given subscriber
- ${bandwidth_profile_output}= Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
+ ${service_type_upper}= Run Keyword If '${service_type}' != '${EMPTY}'
+ ... Convert To Upper Case ${service_type}
+ ${bandwidth_profile_output}= Run Keyword If '${service_type}' != '${EMPTY}'
+ ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
+ ... volt-programmed-subscribers | grep ${subscriber_id} | grep '${service_type_upper}'
+ ... ELSE
+ ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
... volt-programmed-subscribers | grep ${subscriber_id}
@{bandwidth_profile_array}= Split String ${bandwidth_profile_output} ,
Log ${bandwidth_profile_array}
diff --git a/tests/tt-workflow/Voltha_TT_MultiTcontTests.robot b/tests/tt-workflow/Voltha_TT_MultiTcontTests.robot
index 2166a6d..0d6c730 100755
--- a/tests/tt-workflow/Voltha_TT_MultiTcontTests.robot
+++ b/tests/tt-workflow/Voltha_TT_MultiTcontTests.robot
@@ -69,6 +69,7 @@
... AND Setup
[Teardown] Run Keywords Collect Logs
... AND Stop Logging TcontType1Onu1
+ ... AND Delete All Devices and Verify
Run Keyword If ${has_dataplane} Clean Up Linux
Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
# Find the ONU as required for this test
@@ -113,6 +114,7 @@
${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} ${of_id}
${subscriber_id}= Set Variable ${of_id}/${onu_port}
${us_bw} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
+ ... ${service_type}
${matched}= Set Variable If
... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and ${us_bw} == '${us_bw_profile}'
... True False