From 5f563a9b99378362a11d9cf1b0fb6c544a9fc077 Mon Sep 17 00:00:00 2001 From: xudan Date: Fri, 21 Apr 2017 06:31:33 +0000 Subject: use Functest tempest_custom test cases to run all Ipv6 test cases JIRA: DOVETAIL-401 1. modify all Ipv6 test cases, change tempest_smoke_serial/tempest_full_parallel into tempest_custom, add ID of each sub-testcases. 2. Some sub-testcases in ipv6.tc002, ipv6.tc003, ipv6.tc004 and ipv6.tc005 can not be found in the full tempest test case list. 2. disable testcases' script_result_acquired to enable tempest_custom run multiple times. 3. use build_tag-testcase_name(such as daily-master-79a6e392-28bb-4c40-9d88-a03bed99da2d-dovetail.ipv6.tc025) as the unique ID of each testcase. 4. comment out the progress bar, because it has some problems when print the report text. 5. Functest has changed the TEST_DB_URL from http://:/apv/v1 to http://:/apv/v1/results. 6. Functest has changed the TEST_DB_URL to file:///. see https://gerrit.opnfv.org/gerrit/#/c/33511/ Change-Id: I524f6702377f215f526158214842481eb44565be Signed-off-by: xudan --- dovetail/report.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'dovetail/report.py') diff --git a/dovetail/report.py b/dovetail/report.py index 3dd636c7..c7eff3d2 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -110,7 +110,12 @@ class Report(object): for testcase in report_data['testcases_list']: pattern = re.compile( '|'.join(dt_cfg.dovetail_config['testarea_supported'])) - area = pattern.findall(testcase['name'])[0] + area = pattern.findall(testcase['name']) + if not area: + cls.logger.error("testcase %s not in supported testarea", + testcase['name']) + return None + area = area[0] testarea_scope.append(area) sub_report[area] += '-%-25s %s\n' %\ (testcase['name'], testcase['result']) @@ -178,14 +183,14 @@ class Report(object): cls.logger.error('crawler is None:%s', testcase.name()) return None - if validate_testcase in cls.results[type]: - return cls.results[type][validate_testcase] + # if validate_testcase in cls.results[type]: + # return cls.results[type][validate_testcase] result = crawler.crawl(testcase) if result is not None: cls.results[type][validate_testcase] = result - testcase.script_result_acquired(True) + # testcase.script_result_acquired(True) cls.logger.debug('testcase: %s -> result acquired', validate_testcase) else: @@ -224,6 +229,7 @@ class FunctestCrawler(object): timestop = 0 duration = 0 testcase_name = testcase.validate_testcase() + build_tag = '%s-%s' % (dovetail_config['build_tag'], testcase.name()) file_path = \ os.path.join(dovetail_config['result_dir'], dovetail_config[self.type]['result']['file_path']) @@ -241,7 +247,8 @@ class FunctestCrawler(object): for jsonfile in f: try: data = json.loads(jsonfile) - if testcase_name == data['case_name']: + if testcase_name == data['case_name'] and \ + build_tag == data['build_tag']: criteria = data['criteria'] timestart = data['start_date'] timestop = data['stop_date'] @@ -270,7 +277,7 @@ class FunctestCrawler(object): return json_results def crawl_from_url(self, testcase=None): - url = "%s/results?case=%s&last=1" % \ + url = "%s?case=%s&last=1" % \ (dt_cfg.dovetail_config['report_dest'], testcase.validate_testcase()) self.logger.debug("Query to rest api: %s", url) @@ -377,6 +384,8 @@ class FunctestChecker(object): @staticmethod def get_sub_testcase(sub_testcase, result): + if not result: + return False reg = sub_testcase + '[\s+\d+]' find_reg = re.compile(reg) match = find_reg.findall(result) -- cgit 1.2.3-korg