[VOL-3246] Added RebootONUs before the test executions, and ONURestore towards end of executions

Change-Id: Ie228afdd8656e15d89711ea5415bd9960fdc1a22
diff --git a/tests/dt-workflow/Voltha_DT_PODTests.robot b/tests/dt-workflow/Voltha_DT_PODTests.robot
index 304ebac..e542352 100644
--- a/tests/dt-workflow/Voltha_DT_PODTests.robot
+++ b/tests/dt-workflow/Voltha_DT_PODTests.robot
@@ -31,6 +31,7 @@
 Resource          ../../libraries/utils.robot
 Resource          ../../libraries/k8s.robot
 Resource          ../../variables/variables.robot
+Resource          ../../libraries/power_switch.robot
 
 *** Variables ***
 ${POD_NAME}       flex-ocp-cord
@@ -61,6 +62,24 @@
 ${container_log_dir}    ${None}
 
 *** Test Cases ***
+Reboot DT ONUs Physically
+    [Documentation]   This test reboots ONUs physically before execution all the tests
+    ...    Test case runs only on the PODs that are configured with PowerSwitch that
+    ...    controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
+    [Tags]    functional   PowerSwitch    RebootAllDTONUs
+    [Setup]    Start Logging    RebootAllDTONUs
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Stop Logging    RebootAllDTONUs
+    Power Switch Connection Suite    ${web_power_switch.ip}    ${web_power_switch.user}    ${web_power_switch.password}
+    FOR    ${I}    IN RANGE    0    ${num_onus}
+        ${src}=    Set Variable    ${hosts.src[${I}]}
+        ${dst}=    Set Variable    ${hosts.dst[${I}]}
+        Disable Switch Outlet    ${src['power_switch_port']}
+        Sleep    60s
+        Enable Switch Outlet    ${src['power_switch_port']}
+        Sleep    60s
+    END
+
 Sanity E2E Test for OLT/ONU on POD for DT
     [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
     ...    Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
@@ -475,7 +494,10 @@
     [Documentation]    Set up the test suite
     Common Test Suite Setup
     #Restore all ONUs
-    Run Keyword If    ${has_dataplane}    RestoreONUs    ${num_onus}
+    #Run Keyword If    ${has_dataplane}    RestoreONUs    ${num_onus}
+    #power_switch.robot needs it to support different vendor's power switch
+    ${switch_type}=    Get Variable Value    ${web_power_switch.type}
+    Run Keyword If  "${switch_type}"!=""    Set Global Variable    ${powerswitch_type}    ${switch_type}
 
 Clear All Devices Then Create New Device
     [Documentation]    Remove any devices from VOLTHA and ONOS