Log START and END of tests in combined container logs

Change-Id: I4aaee399d0289a497d6400466cdc193d5eaf57e4
diff --git a/tests/functional/Voltha_PODTests.robot b/tests/functional/Voltha_PODTests.robot
index 09e1434..b0497b0 100644
--- a/tests/functional/Voltha_PODTests.robot
+++ b/tests/functional/Voltha_PODTests.robot
@@ -57,10 +57,12 @@
     [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
     ...    Validate successful authentication/DHCP/E2E ping for the tech profile that is used
     [Tags]    sanity    test1
-    [Teardown]    NONE
+    [Setup]    Run Keywords    Announce Message    START TEST SanityTest
+    ...        AND             Setup
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST SanityTest
     Run Keyword If    ${has_dataplane}    Clean Up Linux
     Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
-    Run Keyword and Ignore Error    Collect Logs
 
 Test Disable and Enable OLT
     [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
@@ -68,8 +70,9 @@
     ...    Perform disable on the OLT and validate that the pings do not succeed
     ...    Perform enable on the OLT and validate that the pings are successful
     [Tags]    VOL-2410    DisableEnableOLT    notready
-    [Setup]    None
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST DisableEnableOLT
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST DisableEnableOLT
     #Disable the OLT and verify the OLT/ONUs are disabled properly
     ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
     Should Be Equal As Integers    ${rc}    0
@@ -114,8 +117,9 @@
     ...    Perform disable on the ONUs and validate that the pings do not succeed
     ...    Perform enable on the ONUs and validate that the pings are successful
     [Tags]    functional    DisableEnableONU    released
-    [Setup]    None
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST DisableEnableONU
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST DisableEnableONU
     FOR    ${I}    IN RANGE    0    ${num_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
         ${dst}=    Set Variable    ${hosts.dst[${I}]}
@@ -138,7 +142,6 @@
         Run Keyword and Ignore Error    Get Device Output from Voltha    ${onu_device_id}
         Run Keyword and Ignore Error    Collect Logs
     END
-    Run Keyword and Ignore Error    Collect Logs
 
 Test Subscriber Delete and Add
     [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
@@ -146,8 +149,9 @@
     ...    Delete a subscriber and validate that the pings do not succeed
     ...    Re-add the subscriber and validate that the pings are successful
     [Tags]    functional    SubAddDelete    released
-    [Setup]    None
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST SubAddDelete
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST SubAddDelete
     FOR    ${I}    IN RANGE    0    ${num_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
         ${dst}=    Set Variable    ${hosts.dst[${I}]}
@@ -173,7 +177,6 @@
         Run Keyword and Ignore Error    Get Device Output from Voltha    ${onu_device_id}
         Run Keyword and Ignore Error    Collect Logs
     END
-    Run Keyword and Ignore Error    Collect Logs
 
 Check OLT/ONU Authentication After Radius Pod Restart
     [Documentation]    After radius restart, triggers reassociation, checks status and
@@ -182,8 +185,9 @@
     ...    teardown from previous test or uncomment 'Teardown    None'.
     ...    Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
     [Tags]    functional    RadiusRestart    released
-    [Setup]    None
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST RadiusRestart
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST RadiusRestart
     Wait Until Keyword Succeeds    ${timeout}    15s    Restart Pod    ${NAMESPACE}    ${RESTART_POD_NAME}
     FOR    ${I}    IN RANGE    0    ${num_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
@@ -211,15 +215,15 @@
         Run Keyword and Ignore Error    Get Device Output from Voltha    ${onu_device_id}
         Run Keyword and Ignore Error    Collect Logs
     END
-    Run Keyword and Ignore Error    Collect Logs
 
 Check DHCP attempt fails when subscriber is not added
     [Documentation]    Validates when removed subscriber access, DHCP attempt, ping fails and
     ...    when again added subscriber access, DHCP attempt, ping succeeds
     ...    Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
     [Tags]    functional    SubsRemoveDHCP    released
-    [Setup]    None
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST SubsRemoveDHCP
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST SubsRemoveDHCP
     FOR    ${I}    IN RANGE    0    ${num_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
         ${dst}=    Set Variable    ${hosts.dst[${I}]}
@@ -255,15 +259,15 @@
         ...    ${dst['container_name']}
         Run Keyword and Ignore Error    Collect Logs
     END
-    Run Keyword and Ignore Error    Collect Logs
 
 Check ONU adapter crash not forcing authentication again
     [Documentation]    After ONU adapter restart, checks wpa log for 'authentication started'
     ...    message count to make sure auth not started again and validates EAP status and ping.
     ...    Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
     [Tags]    functional    ONUAdaptCrash    notready
-    [Setup]    None
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST ONUAdaptCrash
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST ONUAdaptCrash
     @{before_list}=    Create List
     @{after_list}=    Create List
     FOR    ${I}    IN RANGE    0    ${num_onus}
@@ -302,7 +306,7 @@
     Lists Should Be Equal    ${after_list}    ${before_list}
     Log    ${after_list}
     Log    ${before_list}
-    Run Keyword and Ignore Error    Collect Logs
+
 
 Test Disable and Enable ONU scenario for ATT workflow
     [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
@@ -312,8 +316,9 @@
     ...    validate that the pings are successful
     ...    VOL-2284
     [Tags]    functional    ATT_DisableEnableONU
-    [Setup]    None
-    #[Teardown]    None
+    [Setup]    Announce Message    START TEST ATT_DisableEnableONU
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST ATT_DisableEnableONU
     FOR    ${I}    IN RANGE    0    ${num_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
         ${dst}=    Set Variable    ${hosts.dst[${I}]}
@@ -350,7 +355,6 @@
         ...    Validate Subscriber DHCP Allocation    ${k8s_node_ip}    ${ONOS_SSH_PORT}    ${onu_port}
         Run Keyword and Ignore Error    Collect Logs
     END
-    Run Keyword and Ignore Error    Collect Logs
 
 Delete OLT, ReAdd OLT and Perform Sanity Test
     [Documentation]    Validates E2E Ping Connectivity and object states for the given scenario:
@@ -358,15 +362,15 @@
     ...    Create/Enable the same OLT again
     ...    Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
     [Tags]    functional    DeleteOLT
-    [Setup]    None
-    [Teardown]    NONE
+    [Setup]    Announce Message    START TEST DeleteOLT
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST DeleteOLT
     Run Keyword If    ${has_dataplane}    Clean Up Linux
     Run Keyword If    ${has_dataplane}    Delete Device and Verify
     Run Keyword and Ignore Error    Collect Logs
     # Recreate the OLT
     Run Keyword If    ${has_dataplane}    Setup
     Wait Until Keyword Succeeds    ${timeout}   2s    Perform Sanity Test
-    Run Keyword and Ignore Error    Collect Logs
 
 Test disable ONUs and OLT then delete ONUs and OLT
     [Documentation]    On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
@@ -374,8 +378,9 @@
     ...    Devices will be removed during the execution of this TC
     ...    so calling setup at the end to add the devices back to avoid the confusion.
     [Tags]    functional    VOL-2354    DisableDeleteONUandOLT
-    [Setup]    NONE
-    [Teardown]    None
+    [Setup]    Announce Message    START TEST DisableDeleteONUandOLT
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Announce Message    END TEST DisableDeleteONUandOLT
     ${olt_device_id}=    Get Device ID From SN    ${olt_serial_number}
     FOR    ${I}    IN RANGE    0    ${num_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
@@ -415,7 +420,6 @@
     Run Keyword If    ${has_dataplane}    sleep    180s
     setup
 
-
 Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
     [Documentation]    Deploys an device instance and waits for it to authenticate. After
     ...    authentication is successful the rw-core deployment is scaled to 0 instances to
@@ -423,7 +427,10 @@
     ...    and configures ONOS for access. The test succeeds if the device is able to
     ...    complete the DHCP sequence.
     [Tags]    bbsim    rwcore-restart
-    [Setup]    Clear All Devices Then Create New Device
+    [Setup]    Run Keywords    Announce Message    START TEST RwCoreFailAndRestart
+    ...        AND             Clear All Devices Then Create New Device
+    [Teardown]   Run Keywords    Collect Logs
+    ...          AND             Announce Message    END TEST RwCoreFailAndRestart
     ${of_id}=    Wait Until Keyword Succeeds    ${timeout}    15s    Validate OLT Device in ONOS    ${olt_serial_number}
     Set Global Variable    ${of_id}
     FOR    ${I}    IN RANGE    0    ${num_onus}
@@ -544,13 +551,6 @@
     # Execute normal test Setup Keyword
     Setup
 
-Collect Logs
-    [Documentation]    Collect Logs from voltha and onos cli for various commands
-    Run Keyword and Ignore Error    Get Device List from Voltha
-    Run Keyword and Ignore Error    Get Device Output from Voltha    ${olt_device_id}
-    Run Keyword and Ignore Error    Get Logical Device Output from Voltha    ${logical_id}
-    Run Keyword If    ${external_libs}    Get ONOS Status    ${k8s_node_ip}
-
 Clean Up Linux
     [Documentation]    Kill processes and clean up interfaces on src+dst servers
     FOR    ${I}    IN RANGE    0    ${num_onus}
@@ -569,4 +569,3 @@
         ...    ${dst['dp_iface_name']}.${src['s_tag']}    ${dst['ip']}    ${dst['user']}    ${dst['pass']}
         ...    ${dst['container_type']}    ${dst['container_name']}
     END
-