[VOL-2778] Support for TT workflow in the scale test

Change-Id: I76b850593e17ffb2781fbc169f20ecb611937811
diff --git a/libraries/flows.robot b/libraries/flows.robot
index 8772e63..e5f28b5 100644
--- a/libraries/flows.robot
+++ b/libraries/flows.robot
@@ -120,7 +120,7 @@
     ...     ELSE
     ...     Evaluate     0
     ${flow_count}=  Run Keyword If  $provisioned=='false'
-        ...     Evaluate    (${olt_count} * ${dhcpFlowsCount}) + (${olt_count} * ${lldpFlowsCount})
-        ...     ELSE
-        ...     Evaluate    (${uni_count} * 6) + (${olt_count} * ${dhcpFlowsCount}) + (${olt_count} * ${lldpFlowsCount})
+    ...     Evaluate    (${olt_count} * ${dhcpFlowsCount}) + (${olt_count} * ${lldpFlowsCount})
+    ...     ELSE
+    ...     Evaluate    (${uni_count} * 15) + (${olt_count} * ${dhcpFlowsCount}) + (${olt_count} * ${lldpFlowsCount})
     Return From Keyword     ${flow_count}
\ No newline at end of file
diff --git a/libraries/onos.robot b/libraries/onos.robot
index 2121a50..11aa85d 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -380,11 +380,14 @@
     Should Be Equal As Integers    ${aaa_users}    ${expected_onus}
 
 Validate DHCP Allocations
-    [Arguments]    ${onos_ssh_connection}    ${expected_onus}
+    [Arguments]    ${onos_ssh_connection}    ${count}   ${workflow}
     [Documentation]    Matches for number of dhcpacks based on number of onus
     ${allocations}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
     ...     dhcpl2relay-allocations | grep DHCPACK | wc -l
-    Should Be Equal As Integers    ${allocations}    ${expected_onus}
+    # if the workflow is TT we'll have 2 allocations for each ONU
+    ${ttAllocations}=     Evaluate   (${count} * 2)
+    ${count}=    Set Variable If  $workflow=='tt'    ${ttAllocations}   ${count}
+    Should Be Equal As Integers    ${allocations}    ${count}
 
 Validate Subscriber DHCP Allocation
     [Arguments]    ${ip}    ${port}    ${onu_port}
@@ -437,9 +440,10 @@
     Wait Until Keyword Succeeds     10m     5s      Assert Number of AAA-Users      ${onos_ssh_connection}     ${count}
 
 Wait for DHCP Ack
-    [Arguments]    ${onos_ssh_connection}     ${count}
+    [Arguments]    ${onos_ssh_connection}     ${count}  ${workflow}
     [Documentation]    Waits untill a certain number of subscribers have received a DHCP_ACK
-    Wait Until Keyword Succeeds     10m     5s      Validate DHCP Allocations      ${onos_ssh_connection}     ${count}
+    Wait Until Keyword Succeeds     10m     5s      Validate DHCP Allocations
+        ...     ${onos_ssh_connection}     ${count}  ${workflow}
 
 Provision subscriber
     [Documentation]  Calls volt-add-subscriber-access in ONOS
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 8016b56..ac249eb 100755
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -726,10 +726,14 @@
     [Documentation]  Waits until the flows have been provisioned in the openolt devices
     [Arguments]  ${workflow}    ${uni_count}    ${olt_count}    ${provisioned}
     ...     ${withEapol}    ${withDhcp}     ${withIgmp}     ${withLldp}
-    # In the physical device we only have 2 data plane flows (on the PON) instead of 4
     ${beforeFlows}=     Calculate flows by workflow     ${workflow}    ${uni_count}    ${olt_count}     ${provisioned}
     ...     ${withEapol}    ${withDhcp}     ${withIgmp}     ${withLldp}
+    # In the physical device we only have 2 data plane flows (on the PON) instead of 4
     ${afterFlows}=      Evaluate    ${beforeFlows} - (${uni_count} * 2)
+    # In the TT workflow we have multiple service,
+    # so we need to remove 6 flows per each UNI that are only on the ONU device
+    ${ttFlows}=     Evaluate    ${beforeFlows} - (${uni_count} * 6)
+    ${afterFlows}=    Set Variable If  $workflow=='tt'    ${ttFlows}   ${afterFlows}
     ${targetFlows}=    Set Variable If  $provisioned=='true'    ${afterFlows}   ${beforeFlows}
     Log     ${targetFlows}
     Wait Until Keyword Succeeds     10m     5s  Count OpenOLT Device Flows     ${targetFlows}
diff --git a/tests/scale/Voltha_Scale_Tests.robot b/tests/scale/Voltha_Scale_Tests.robot
index e5f7153..b649378 100644
--- a/tests/scale/Voltha_Scale_Tests.robot
+++ b/tests/scale/Voltha_Scale_Tests.robot
@@ -164,7 +164,7 @@
 Wait for subscribers to have an IP
     [Documentation]    Check that all subscribers have received a DHCP_ACK
     [Tags]      non-critical    dhcp  plot-onos-dhcp
-    Wait for DHCP Ack     ${onos_ssh_connection}  ${total_onus}
+    Wait for DHCP Ack     ${onos_ssh_connection}  ${total_onus}     ${workflow}
 
 Disable and Delete devices
     [Documentation]  Disable and delete the OLTs in VOLTHA