[VOL-4133] Checking that the OLT is listed as unavailable in ONOS during a reboot cycle

Change-Id: I9dd76497f9136743ad2b6577fe4c5a4e45ecd4f8
diff --git a/libraries/onos.robot b/libraries/onos.robot
index 3137373..fefa21a 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -583,13 +583,13 @@
     Should Not Be Empty    ${allocations}    ONU port ${onu_port} not found in dhcpl2relay-allocations
 
 Device Is Available In ONOS
-    [Arguments]    ${url}    ${dpid}
-    [Documentation]    Validates the device exists and it available in ONOS
+    [Arguments]    ${url}    ${dpid}    ${available}=true
+    [Documentation]    Validates the device exists and it has the expected availability in ONOS
     ${rc}    ${json}    Run And Return Rc And Output    curl --fail -sSL ${url}/onos/v1/devices/${dpid}
     Should Be Equal As Integers    0    ${rc}
     ${rc}    ${value}    Run And Return Rc And Output    echo '${json}' | jq -r .available
     Should Be Equal As Integers    0    ${rc}
-    Should Be Equal    'true'    '${value}'
+    Should Be Equal    ${available}    ${value}
 
 Remove All Devices From ONOS
     [Arguments]    ${url}
diff --git a/tests/bbsim/Voltha_BBSimTests.robot b/tests/bbsim/Voltha_BBSimTests.robot
index 4e94976..567a4bc 100644
--- a/tests/bbsim/Voltha_BBSimTests.robot
+++ b/tests/bbsim/Voltha_BBSimTests.robot
@@ -163,6 +163,8 @@
     # Perform OLT SoftReboot test
     ${olt_device_id}=    Get OLTDeviceID From OLT List    ${olt_serial_number}
     Reboot Device    ${olt_device_id}
+    Wait Until Keyword Succeeds    ${timeout}    2s    Device Is Available In ONOS
+        ...    http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT}    ${of_id}     false
     Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    360s    5s
     ...    Validate OLT Device    ENABLED    ACTIVE
     ...    REACHABLE    ${olt_serial_number}