OLT status checks

Change-Id: I9884e051a12e28b2b10a4325db19199c0544c3ad
diff --git a/src/test/cord-api/Framework/OLT.robot b/src/test/cord-api/Framework/OLT.robot
index 0e208b0..bb397bc 100644
--- a/src/test/cord-api/Framework/OLT.robot
+++ b/src/test/cord-api/Framework/OLT.robot
@@ -27,3 +27,20 @@
     [Arguments]    ${ip}    ${user}    ${pass}    ${prompt}=~#
     [Documentation]    Verify that openolt process is started and ready to connect to voltha
     Check Remote File Contents    True    /var/log/openolt.log    oper_state: up    ${ip}    ${user}    ${pass}    prompt=${prompt}
+
+OLT Status Check
+    [Arguments]    ${olt_device}
+    [Documentation]    Returns "operational_status" and "admin_status" of a particular OLT device from "olt device list"
+    ${json_result}=    restApi.ApiGet    VOLT_DEVICE
+    Log    ${json_result}
+    ${json_result_list}=    Get From dictionary    ${json_result}    items
+    ${getJsonDict}=    utils.getDictFromListOfDict    ${json_result_list}    host    ${olt_device}
+    ${operational_status}=  Get From Dictionary    ${getJsonDict}   oper_status
+    ${admin_status}=  Get From Dictionary    ${getJsonDict}   admin_state
+    [Return]    ${operational_status}    ${admin_status}
+
+Validate OLT States
+    [Arguments]    ${expected_op_status}    ${expected_admin_status}    ${olt_device}
+    ${operational_status}    ${admin_status}    OLT Status Check    ${olt_device}
+    Should Be Equal    ${operational_status}    ${expected_op_status}
+    Should Be Equal    ${admin_status}    ${expected_admin_status}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot
index 5a9d8e0..856f436 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot
@@ -372,6 +372,7 @@
     Create Whitelist
     Create Subscriber
     Create VOLT
+    Wait Until Keyword Succeeds    200s    15s    Validate ONU States    ACTIVE    ENABLED    ${onu_device}
 
 Teardown Test
     [Documentation]    Delete xos objects, kills processes and cleans up interfaces on src+dst servers