test suite reviews and discussions
 help / color / 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

* Re: [dts] [PATCH V1] framework: add support config test case in execution.cfg
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-07-20  7:10 UTC (permalink / raw)
  To: Ma, LihongX, dts; +Cc: Chen, Zhaoyan, Ma, LihongX

Applied, thanks

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of lihong
> Sent: 2020^[$BG/^[(B7^[$B7n^[(B9^[$BF|^[(B 11:23
> To: dts@dpdk.org
> Cc: Chen, Zhaoyan <zhaoyan.chen@intel.com>; Ma, LihongX
> <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V1] framework: add support config test case in
> execution.cfg
> 
> 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, back to index

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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox