summaryrefslogtreecommitdiffstats
path: root/dovetail/report.py
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-03-22 07:51:37 +0000
committerxudan <xudan16@huawei.com>2017-03-25 08:59:53 +0000
commit223806ad2a5d60c9909f32f35b8cea16bf703a69 (patch)
treedfcd9c27f2876c3b185a5afb2266ca78e0e155d8 /dovetail/report.py
parent02d44a030687100d0ebf68d1645536536d42cbb9 (diff)
dovetail tool: Add an option cmd for pushing results into DB
JIRA: DOVETAIL-373 1. add an option --report/-r to choose the report type. 2. "-r file" will store results with files. 3. "-r http://192.168.135.2:8000/api/v1" will push results into DB. The DB url can replaced by user's local DB or official DB. 4. Default report type is defined as "report_dest" in dovetail_config.yml. 5. Yardstick can't push results of one testcase into DB now, so both "-r file" and "-r http://..." will be regarded as "file". Change-Id: Ieaa017ab59c5b15235bf306ef57cdc56beb22af8 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/report.py')
-rw-r--r--dovetail/report.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/dovetail/report.py b/dovetail/report.py
index d4be67c6..f2210cb7 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -287,9 +287,9 @@ class FunctestCrawler(object):
return json_results
def crawl_from_url(self, testcase=None):
- url = \
- dt_cfg.dovetail_config[self.type]['result']['db_url'] % \
- testcase.validate_testcase()
+ url = "%s/results?case=%s&last=1" % \
+ (dt_cfg.dovetail_config['report_dest'],
+ testcase.validate_testcase())
self.logger.debug("Query to rest api: %s", url)
try:
data = json.load(urllib2.urlopen(url))