[VOL-2550] DT: Functional TC: Disable-Delete OLT

Change-Id: I31e2711ecc8e30eee971ab2c2245592a6ea8498f
diff --git a/tests/dt-workflow/Voltha_DT_PODTests.robot b/tests/dt-workflow/Voltha_DT_PODTests.robot
index 7bb8f04..68fa5e0 100644
--- a/tests/dt-workflow/Voltha_DT_PODTests.robot
+++ b/tests/dt-workflow/Voltha_DT_PODTests.robot
@@ -186,6 +186,44 @@
         Run Keyword and Ignore Error    Collect Logs
     END
 
+Test Disable and Delete OLT for DT
+    [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
+    ...    Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
+    ...    Perform disable on the OLT and validate ONUs state and that the pings do not succeed
+    ...    Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
+    [Tags]    functionalDt    DisableDeleteOLTDt    bbsim    released
+    [Setup]    Run Keywords    Announce Message    START TEST DisableDeleteOLTDt
+    ...        AND             Start Logging    DisableDeleteOLTDt
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Stop Logging    DisableDeleteOLTDt
+    ...           AND             Announce Message    END TEST DisableDeleteOLTDt
+    # Disable and Validate OLT Device
+    Disable Device    ${olt_device_id}
+    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+    ...    Validate OLT Device    DISABLED    UNKNOWN    REACHABLE
+    ...    ${olt_serial_number}
+    # Validate ONUs
+    Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate ONUs After OLT Disable
+    # Verify VOLTHA Flows (TODO: Add verification for ONOS Flows)
+    # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
+    ${olt_flows}=    Evaluate    2 * ${num_onus} + 1
+    # Number of per ONU Flows equals 2 (one each for downstream and upstream)
+    ${onu_flows}=    Set Variable    2
+    Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Flows    ${olt_flows}
+    ${List_ONU_Serial}    Create List
+    Set Suite Variable    ${List_ONU_Serial}
+    Build ONU SN List    ${List_ONU_Serial}
+    Log    ${List_ONU_Serial}
+    Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate ONU Flows
+    ...    ${List_ONU_Serial}    ${onu_flows}
+    # Delete OLT and Validate Empty Device List
+    Delete Device    ${olt_device_id}
+    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s    Test Empty Device List
+    Run Keyword and Ignore Error    Collect Logs
+    # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
+    Run Keyword    Setup
+    Wait Until Keyword Succeeds    ${timeout}   2s    Perform Sanity Test DT
+
 *** Keywords ***
 Setup Suite
     [Documentation]    Set up the test suite