test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] framework: add support config test case in execution.cfg
@ 2020-07-09  3:22 lihong
  2020-07-20  7:10 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: lihong @ 2020-07-09  3:22 UTC (permalink / raw)
  To: dts; +Cc: zhaoyan.chen, lihong

can config which test_case you want to run in file execution.cfg,
the format is:
suite_name:test_case_1/test_case_2/test_case_3,

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 framework/dts.py       | 7 +++++++
 framework/test_case.py | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/framework/dts.py b/framework/dts.py
index d6c4fe5..05cc012 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -432,6 +432,12 @@ def dts_run_suite(duts, tester, test_suites, target, subtitle):
     """
     for suite_name in test_suites:
         try:
+            # check whether config the test cases
+            append_requested_case_list = None
+            if ':' in suite_name:
+                case_list = suite_name[suite_name.find(':')+1:]
+                append_requested_case_list = case_list.split('\\')
+                suite_name = suite_name[:suite_name.find(':')]
             result.test_suite = suite_name
             suite_module = __import__('TestSuite_' + suite_name)
             for test_classname, test_class in get_subclasses(suite_module, TestCase):
@@ -439,6 +445,7 @@ def dts_run_suite(duts, tester, test_suites, target, subtitle):
                 suite_obj = test_class(duts, tester, target, suite_name)
                 suite_obj.init_log()
                 suite_obj.set_requested_cases(requested_tests)
+                suite_obj.set_requested_cases(append_requested_case_list)
                 suite_obj.set_check_inst(check=check_case_inst)
                 suite_obj.set_subtitle(subtitle)
                 result.nic = suite_obj.nic
diff --git a/framework/test_case.py b/framework/test_case.py
index 282c96d..110dafb 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -221,7 +221,10 @@ class TestCase(object):
         """
         Pass down input cases list for check
         """
-        self._requested_tests = case_list
+        if self._requested_tests is None:
+            self._requested_tests = case_list
+        elif case_list is not None:
+            self._requested_tests += case_list
 
     def set_subtitle(self, subtitle):
         """
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-20  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09  3:22 [dts] [PATCH V1] framework: add support config test case in execution.cfg lihong
2020-07-20  7:10 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).