summaryrefslogtreecommitdiffstats
path: root/dovetail
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-05-26 02:52:39 -0400
committerxudan <xudan16@huawei.com>2018-07-22 21:50:10 -0400
commit82bc118989534ae75b5eea0c00f6d793558f3150 (patch)
tree4ff8ae5bfc2e89e87aec66c7af4f5c99e7016857 /dovetail
parent2cbcd586119810b2140d7d20ba72ade35193e504 (diff)
Remove functest_testsuite and functest_testcase in dovetail_config.yml
The 2 sections 'functest_testsuite' and 'functest_testcase' are used by all Functest test cases. They aim to parse the results of Tempest sub test cases. Remove them, and check the sub test case list, 1. if it's empty, that means no need to check sub test cases 2. if it is not empty, check the sub test cases one by one. Additional, remove some useless keys in dovetail_config.yml JIRA: DOVETAIL-658 Change-Id: Ic829264b0c8eaedd8e2b3fa55b38a34644482c20 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail')
-rw-r--r--dovetail/report.py12
-rw-r--r--dovetail/test_runner.py10
-rw-r--r--dovetail/testcase.py6
3 files changed, 7 insertions, 21 deletions
diff --git a/dovetail/report.py b/dovetail/report.py
index c74595cc..8d157559 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -257,14 +257,10 @@ class FunctestCrawler(Crawler):
if not os.path.exists(file_path):
self.logger.error('Result file not found: {}'.format(file_path))
return None
- if testcase_name in dt_cfg.dovetail_config['functest_testcase']:
- complex_testcase = False
- elif testcase_name in dt_cfg.dovetail_config['functest_testsuite']:
- complex_testcase = True
- else:
- self.logger.error(
- "Wrong Functest test case {}.".format(testcase_name))
- return None
+
+ sub_testcase_list = testcase.sub_testcase()
+ complex_testcase = True if sub_testcase_list else False
+
with open(file_path, 'r') as f:
for jsonfile in f:
try:
diff --git a/dovetail/test_runner.py b/dovetail/test_runner.py
index c49182b8..cb5578b0 100644
--- a/dovetail/test_runner.py
+++ b/dovetail/test_runner.py
@@ -62,15 +62,7 @@ class DockerRunner(object):
if not Container.pull_image(docker_image):
self.logger.error("Failed to pull the image.")
return
- # for sdnvpn, there is a need to download needed images to config_dir
- # in dovetail_config.yml first.
- if 'sdnvpn' in str(self.testcase.name()):
- img_name = dt_cfg.dovetail_config['sdnvpn_image']
- img_file = os.path.join(dt_cfg.dovetail_config['images_dir'],
- img_name)
- if not os.path.isfile(img_file):
- self.logger.error('Image {} not found.'.format(img_name))
- return
+
container_id = Container.create(self.testcase.validate_type(),
self.testcase.name(), docker_image)
if not container_id:
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index 69b8ee4c..ff716292 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -71,10 +71,8 @@ class Testcase(object):
return self.testcase['objective']
def sub_testcase(self):
- try:
- return self.testcase['report']['sub_testcase_list']
- except KeyError:
- return []
+ return dt_utils.get_value_from_dict('report.sub_testcase_list',
+ self.testcase)
def sub_testcase_passed(self, name, passed=None):
if passed is not None: