Make sure that ONOS knows about the OLT before running scale test

Change-Id: I680bb2302d9a481f4704fba12dafb9736efa2fde
diff --git a/libraries/onos.robot b/libraries/onos.robot
index ffc30da..a5e3f10 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -538,6 +538,20 @@
     Log    ${onu_port_disabled}
     Should Not Be Empty    ${onu_port_disabled}
 
+Assert Olts in ONOS
+    [Arguments]    ${onos_ssh_connection}     ${count}
+    [Documentation]    Check that a certain number of olts are known to ONOS
+    ${olts}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+        ...    volt-olts | wc -l
+    Log     Found ${olts} of ${count} expected Olts
+    Should Be Equal As Integers    ${olts}    ${count}
+
+Wait for Olts in ONOS
+    [Arguments]    ${onos_ssh_connection}    ${count}   ${max_wait_time}=10m
+    [Documentation]    Waits untill a certain number of ports are enabled in ONOS for a particular deviceId
+    Wait Until Keyword Succeeds     ${max_wait_time}     5s      Assert Olts in ONOS
+    ...     ${onos_ssh_connection}     ${count}
+
 Assert Ports in ONOS
     [Arguments]    ${onos_ssh_connection}     ${count}     ${deviceId}    ${filter}
     [Documentation]    Check that a certain number of ports are enabled in ONOS
diff --git a/tests/scale/Voltha_Scale_Tests.robot b/tests/scale/Voltha_Scale_Tests.robot
index 11c9abb..3537b36 100644
--- a/tests/scale/Voltha_Scale_Tests.robot
+++ b/tests/scale/Voltha_Scale_Tests.robot
@@ -100,6 +100,11 @@
 
     Set Suite Variable    ${olt_device_ids}
 
+OLTs in ONOS
+    [Documentation]  Check that ONOS recognize the correct number of OLTs
+    [Tags]  activation  plot-onos-olts
+    Wait for Olts in ONOS   ${onos_ssh_connection}  ${olt}
+
 Onu Activation in VOLTHA
     [Documentation]    Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
     [Tags]      non-critical    activation    plot-voltha-onus