[dts] [PATCH V1] framework/dts: capture exception generated in finnaly sentence

Haiyang Zhao haiyangx.zhao at intel.com
Tue Nov 17 10:15:10 CET 2020


if exception raised in execute_tear_downall,
the result will not be saved and DTS will be terminated,
capture the exception to fix it.

Signed-off-by: Haiyang Zhao <haiyangx.zhao at intel.com>
---
 framework/dts.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/framework/dts.py b/framework/dts.py
index 8a3790e..8c61385 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -486,8 +486,16 @@ def dts_run_suite(duts, tester, test_suites, target, subtitle):
             settings.report_error("GENERIC_ERR")
             log_handler.error(str(e))
         finally:
-            suite_obj.execute_tear_downall()
-            save_all_results()
+            try:
+                suite_obj.execute_tear_downall()
+            except Exception as e:
+                settings.report_error("GENERIC_ERR")
+                log_handler.error(str(e))
+            try:
+                save_all_results()
+            except Exception as e:
+                settings.report_error("GENERIC_ERR")
+                log_handler.error(str(e))
 
 
 def run_all(config_file, pkgName, git, patch, skip_setup,
-- 
2.17.1



More information about the dts mailing list