Adding logs to setup and teardown to better debug cleanup issues
Change-Id: I4972fd0057c125f63790a40aa7117db06912ed16
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 544d40c..db2346f 100755
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -712,9 +712,11 @@
Teardown Suite
[Documentation] Clean up device if desired
+ Start Logging Setup or Teardown Teardown-${SUITE NAME}
Run Keyword If ${teardown_device} Delete All Devices and Verify
Run Keyword And Continue On Failure Collect Logs
Close All ONOS SSH Connections
+ Stop Logging Setup or Teardown Teardown-${SUITE NAME}
Delete Device and Verify
[Arguments] ${olt_serial_number}
@@ -1107,6 +1109,23 @@
Set Test Variable ${kail_process}
Run Keyword If ${has_dataplane} Echo Message to OLT Logs START ${label}
+Start Logging Setup or Teardown
+ [Arguments] ${label}
+ [Documentation] Start logging for suite ${label}
+ ${kail_process}= Run Keyword If "${container_log_dir}" != "${None}" Start Process kail -n ${NAMESPACE}
+ ... -n ${INFRA_NAMESPACE} cwd=${container_log_dir} stdout=${label}-combined.log
+ Set Suite Variable ${kail_process}
+ Run Keyword If ${has_dataplane} Echo Message to OLT Logs START ${label}
+
+Stop Logging Setup or Teardown
+ [Arguments] ${label}
+ [Documentation] End logging for suite;
+ Run sync
+ Run Keyword If ${kail_process} Terminate Process ${kail_process}
+ ${test_logfile}= Run Keyword If "${container_log_dir}" != "${None}"
+ ... Join Path ${container_log_dir} ${label}-combined.log
+ Run Keyword If ${has_dataplane} Echo Message to OLT Logs END ${label}
+
Stop Logging
[Arguments] ${label}
[Documentation] End logging for test; remove logfile if test passed and ${logging} is set to False