[VOL-2577] Disable/Enable OLT PON port for ATT and DT

Change-Id: I2796309e7d431261068238b3611a2ac4f516491c
diff --git a/tests/functional/Voltha_PODTests.robot b/tests/functional/Voltha_PODTests.robot
index 1062c34..392ecce 100644
--- a/tests/functional/Voltha_PODTests.robot
+++ b/tests/functional/Voltha_PODTests.robot
@@ -644,6 +644,43 @@
         ...    ${bng_ip}    ${bng_user}    ${bng_pass}    ${dst['container_type']}    ${dst['container_name']}
     END
 
+Test Disable and Enable OLT PON Port
+    [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 PON Port and validate that the pings do not succeed
+    ...    Perform enable on the OLT PON Port and validate that the pings are successful
+    [Tags]    functional    DisableEnableOltPonPort    VOL-2577
+    [Setup]    Run Keywords    Start Logging    DisableEnableOltPonPort
+    ...        AND    Setup
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Stop Logging    DisableEnableOltPonPort
+    ...           AND             Delete Device and Verify
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
+    ${olt_pon_port_list}=    Retrieve OLT PON Ports    ${olt_device_id}
+    ${olt_pon_port_list_len}=    Get Length    ${olt_pon_port_list}
+    FOR    ${INDEX0}    IN RANGE    0    ${olt_pon_port_list_len}
+        ${olt_pon_port}=    Get From List    ${olt_pon_port_list}    ${INDEX0}
+        ${olt_peer_list}=    Retrieve Peer List From OLT PON Port    ${olt_device_id}    ${olt_pon_port}
+        # Disable the OLT PON Port and Validate OLT Device
+        DisableOrEnable OLT PON Port    disable    ${olt_device_id}    ${olt_pon_port}
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...    Validate OLT PON Port Status    ${olt_device_id}    ${olt_pon_port}
+        ...    DISABLED    DISCOVERED
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...    Validate OLT Device    ENABLED    ACTIVE    REACHABLE
+        ...    ${olt_serial_number}
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...    Validate ONUs for PON OLT Disable    ${olt_peer_list}
+        # Enable the OLT PON Port back, and check ONU status are back to "ACTIVE"
+        DisableOrEnable OLT PON Port    enable    ${olt_device_id}    ${olt_pon_port}
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...    Validate OLT PON Port Status    ${olt_device_id}    ${olt_pon_port}
+        ...    ENABLED    ACTIVE
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...    Validate ONUs for PON OLT Enable    ${olt_peer_list}
+    END
+
 *** Keywords ***
 Setup Suite
     [Documentation]    Set up the test suite