summaryrefslogtreecommitdiffstats
path: root/dovetail/testcase.py
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-09-25 23:30:08 -0400
committerxudan <xudan16@huawei.com>2017-09-25 23:30:08 -0400
commit186cdc71bf9bdd00be1df87d90d1a4c57790208c (patch)
tree7849337a1bd5da7f036183903189000dba741bbb /dovetail/testcase.py
parent6f47c82d4b6f830863ff1330163d869baa6c7eec (diff)
Support to run mandatory or optional test cases separately
1. Currently, dovetail can run a test suite or a test area in that test suite. 2. The test areas in one test suite are not divided into optional and mandatory. 3. Split them and support to run just mandatory or optional. 4. Support to run multiple test areas. JIRA: DOVETAIL-505 Change-Id: I42cd7b4e11c3e3674c806e9bc999b782bf5c85c6 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/testcase.py')
-rw-r--r--dovetail/testcase.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index b6819964..99845484 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -243,6 +243,44 @@ class Testcase(object):
return cls.testcase_list[testcase_name]
return None
+ @classmethod
+ def check_testarea(cls, testarea):
+ area_no_duplicate = []
+ area_full = ['full']
+
+ # testarea is empty, run full testsuite
+ if not testarea:
+ return True, area_full
+
+ mandatory_list = dt_cfg.dovetail_config['mandatory']
+ optional_list = dt_cfg.dovetail_config['optional']
+ for area in testarea:
+ if area not in dt_cfg.dovetail_config['testarea_supported']:
+ return False, None
+ if area == 'full':
+ return True, area_full
+ if area == 'mandatory':
+ for mandatory_area in mandatory_list:
+ area_no_duplicate.append(mandatory_area)
+ continue
+ if area == 'optional':
+ for optional_area in optional_list:
+ area_no_duplicate.append(optional_area)
+ continue
+ area_no_duplicate.append(area)
+ area_no_duplicate = list(set(area_no_duplicate))
+ return True, area_no_duplicate
+
+ @classmethod
+ def get_testcase_list(cls, testsuite, testarea):
+ testcase_list = []
+ for value in testsuite['testcases_list']:
+ for area in testarea:
+ if value is not None and (area == 'full' or area in value):
+ testcase_list.append(value)
+ break
+ return testcase_list
+
class FunctestTestcase(Testcase):