From 5befaac4be341e9856fb4ed40c28e29782d7ad23 Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Thu, 14 Jan 2021 15:31:01 +0800 Subject: [PATCH] ttfw: fix get dut failed when dut port is set as env variable --- tools/ci/python_packages/tiny_test_fw/Env.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci/python_packages/tiny_test_fw/Env.py b/tools/ci/python_packages/tiny_test_fw/Env.py index 9752c29ffa..d3fefd8c77 100644 --- a/tools/ci/python_packages/tiny_test_fw/Env.py +++ b/tools/ci/python_packages/tiny_test_fw/Env.py @@ -85,9 +85,14 @@ class Env(object): dut_class = self.default_dut_cls if app_class is None: app_class = self.app_cls + + app_target = dut_class.TARGET detected_target = None + try: port = self.config.get_variable(dut_name) + if not app_target: + result, detected_target = dut_class.confirm_dut(port) except ValueError: # try to auto detect ports allocated_ports = [self.allocated_duts[x]["port"] for x in self.allocated_duts] @@ -100,7 +105,6 @@ class Env(object): else: port = None - app_target = dut_class.TARGET if not app_target: app_target = detected_target if not app_target: