[VOL-3058][VOL-3059][VOL-3615] Multi-OLT framework changes and updated ATT, DT, TT existing tests accordingly

Change-Id: Iad0a6d4fba3c2bf647b8a844413e8d16405cd121
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 57ec5c8..ddafe65 100755
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -213,6 +213,16 @@
     ...    as either its serial numbner or device ID. Match on OLT Serial number or Device Id and inspect states
     Validate Device    ${admin_state}    ${oper_status}    ${connect_status}    ${id}
 
+Validate OLT Devices
+    [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}    ${ids}=${EMPTY}
+    [Documentation]    Parses the output of "voltctl device list" and inspects device ${id}, specified
+    ...    as either its serial numbner or device ID. Match on OLT Serial number or Device Id and inspect states
+    FOR   ${I}    IN RANGE    0    ${olt_count}
+        ${olt_serial_number}=    Get From Dictionary    ${olt_ids}[${I}]    sn
+        ${olt_device_id}=    Get OLTDeviceID From OLT List    ${olt_serial_number}
+        Validate Device    ${admin_state}    ${oper_status}    ${connect_status}    ${olt_device_id}
+    END
+
 Validate ONU Devices
     [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}    ${List_ONU_Serial}
     ...    ${onu_reason}=omci-flows-pushed
@@ -285,7 +295,7 @@
     ...    Number of flows for ${device_id} was not ${flow_count}
 
 Validate OLT Flows
-    [Arguments]    ${flow_count}=${EMPTY}
+    [Arguments]    ${flow_count}=${EMPTY}    ${olt_device_id}=${EMPTY}
     [Documentation]    Parses the output of voltctl device flows ${olt_device_id}
     ...    and expects flow count == ${flow_count}
     Validate Device Flows    ${olt_device_id}    ${flow_count}
@@ -378,50 +388,6 @@
     END
     Should Be Empty    ${List_ONU_Serial}    List ${List_ONU_Serial} not empty
 
-Validate ONU Device By Device Id
-    [Documentation]
-    ...    Parses the output of "voltctl device list" filtered by device id and inspects states including reason.
-    [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}    ${onu_reason}    ${onu_id}
-    ${cmd}    Catenate    ${VOLTCTL_CONFIG}; voltctl device list --filter=Id=${onu_id} -m 8MB -o json
-    ${rc}    ${output}=    Run and Return Rc and Output    ${cmd}
-    Should Be Equal As Integers    ${rc}    0
-    ${jsondata}=    To Json    ${output}
-    ${length}=    Get Length    ${jsondata}
-    Should Be Equal As Integers    ${length}    1    No match found for ${onu_id} to validate device
-    ${value}=    Get From List    ${jsondata}    0
-    Log    ${value}
-    ${jsonCamelCaseFieldnames}=    Run Keyword And Return Status
-    ...    Dictionary Should Contain Key       ${value}      adminState
-    ${astate}=    Run Keyword If     ${jsonCamelCaseFieldNames}
-    ...    Get From Dictionary    ${value}    adminState
-    ...    ELSE
-    ...    Get From Dictionary    ${value}    adminstate
-    ${opstatus}=    Run Keyword If     ${jsonCamelCaseFieldNames}
-    ...    Get From Dictionary    ${value}    operStatus
-    ...    ELSE
-    ...    Get From Dictionary    ${value}    operstatus
-    ${cstatus}=    Run Keyword If     ${jsonCamelCaseFieldNames}
-    ...    Get From Dictionary    ${value}    connectStatus
-    ...    ELSE
-    ...    Get From Dictionary    ${value}    connectstatus
-    ${sn}=    Run Keyword If     ${jsonCamelCaseFieldNames}
-    ...    Get From Dictionary    ${value}    serialNumber
-    ...    ELSE
-    ...    Get From Dictionary    ${value}    serialnumber
-    ${devId}=    Get From Dictionary    ${value}    id
-    ${mib_state}=    Get From Dictionary    ${value}    reason
-    Should Be Equal    '${devId}'    '${onu_id}'    No match found for ${onu_id} to validate device
-    ...    values=False
-    Should Be Equal    '${astate}'    '${admin_state}'    Device ${sn} admin_state != ${admin_state}
-    ...    values=False
-    Should Be Equal    '${opstatus}'    '${oper_status}'    Device ${sn} oper_status != ${oper_status}
-    ...    values=False
-    Should Be Equal    '${cstatus}'    '${connect_status}'    Device ${sn} conn_status != ${connect_status}
-    ...    values=False
-    Should Be Equal    '${mib_state}'    '${onu_reason}'
-    ...    Device ${sn} mib_state incorrect (${mib_state}) values=False
-
-
 Compare Lists
     [Documentation]
     ...    Compares both lists and put all matches in the returned list
@@ -661,7 +627,7 @@
     [Return]    ${id}
 
 Build ONU SN List
-    [Arguments]    ${serial_numbers}
+    [Arguments]    ${serial_numbers}    ${num_onus}=${num_all_onus}
     [Documentation]    Appends all ONU SNs to the ${serial_numbers} list
     FOR    ${INDEX}    IN RANGE    0    ${num_onus}
         Append To List    ${serial_numbers}    ${hosts.src[${INDEX}].onu}
@@ -702,12 +668,12 @@
     List Should Not Contain Value    ${ids}    ${id}
 
 Reboot ONU
-    [Arguments]    ${onu_id}    ${validate_device}=True
+    [Arguments]    ${onu_id}    ${src}   ${dst}
     [Documentation]   Using voltctl command reboot ONU and verify that ONU comes up to running state
     ${rc}    ${devices}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device reboot ${onu_id}
     Should Be Equal As Integers    ${rc}    0
-    Run Keyword If    ${validate_device}    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds
-    ...    60s   1s    Validate ONU Device By Device Id    ENABLED    DISCOVERED    REACHABLE    rebooting   ${onu_id}
+    Run Keyword and Ignore Error    Wait Until Keyword Succeeds    60s   1s    Validate Device
+    ...    ENABLED    DISCOVERED    UNREACHABLE   ${onu_id}    onu=True
 
 Assert ONUs in Voltha
     [Arguments]    ${count}