[VOL-2052] Bandwidth Profile Validation

Change-Id: Icdf6ab05435d5359158dabb704e5cecb7f7d4b37
diff --git a/libraries/onos.robot b/libraries/onos.robot
index 4d10af5..69ee7e2 100644
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -361,3 +361,30 @@
     ${targetFlows}=     Calculate flows by workflow     ${workflow}    ${uni_count}    ${olt_count}     ${provisioned}
     Wait Until Keyword Succeeds     10m     5s      Count ADDED flows
     ...     ${onos_ip}    ${onos_port}  ${targetFlows}
+
+Get Bandwidth Details
+    [Arguments]    ${bandwidth_profile_name}
+    [Documentation]    Collects the bandwidth profile details for the given bandwidth profile and
+    ...    returns the limiting bandwidth
+    ${bandwidth_profile_values}=    Execute ONOS CLI Command    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+    ...    bandwidthprofile ${bandwidth_profile_name}
+    @{bandwidth_profile_array}=    Split String    ${bandwidth_profile_values}    ,
+    @{parameter_value_pair}=    Split String    ${bandwidth_profile_array[1]}    =
+    ${bandwidthparameter}=    Set Variable    ${parameter_value_pair[0]}
+    ${value}=    Set Variable    ${parameter_value_pair[1]}
+    ${cir_value}    Run Keyword If    '${bandwidthparameter}' == ' committedInformationRate'
+    ...    Set Variable    ${value}
+    @{parameter_value_pair}=    Split String    ${bandwidth_profile_array[2]}    =
+    ${bandwidthparameter}=    Set Variable    ${parameter_value_pair[0]}
+    ${value}=    Set Variable    ${parameter_value_pair[1]}
+    ${cbs_value}    Run Keyword If    '${bandwidthparameter}' == ' committedBurstSize'    Set Variable    ${value}
+    @{parameter_value_pair}=    Split String    ${bandwidth_profile_array[3]}    =
+    ${bandwidthparameter}=    Set Variable    ${parameter_value_pair[0]}
+    ${value}=    Set Variable    ${parameter_value_pair[1]}
+    ${eir_value}    Run Keyword If    '${bandwidthparameter}' == ' exceededInformationRate'   Set Variable    ${value}
+    @{parameter_value_pair}=    Split String    ${bandwidth_profile_array[4]}    =
+    ${bandwidthparameter}=    Set Variable    ${parameter_value_pair[0]}
+    ${value}=    Set Variable    ${parameter_value_pair[1]}
+    ${ebs_value}    Run Keyword If    '${bandwidthparameter}' == ' exceededBurstSize'    Set Variable    ${value}
+    ${limiting_BW}=    Evaluate    ${cir_value}+${eir_value}
+    [Return]    ${limiting_BW}