summaryrefslogtreecommitdiffstats
path: root/testsuites/vstf/vstf_collector.py
diff options
context:
space:
mode:
authorliyin <liyin11@huawei.com>2017-05-08 09:04:32 +0000
committerYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>2017-05-19 07:58:49 +0000
commitfb9e1a726d3a598494fd38330848ef676219a47a (patch)
treebfb2d60c1ce3f6688b92e5787818f222d620f52e /testsuites/vstf/vstf_collector.py
parent6dff90faee27dc5569255f5cb6ba72ae5e22b924 (diff)
Delete testcase of rubbos and vstf.
JIRA:BOTTLENECK-167 This patch will delete vstf and rubbos testcase code. Include some testcase config file, if there will be someone who want to use this testcase maybe B or C version code will contain those testcase. if you use the D version code to run this two testcase we will info you that: Rubbos testsuite is not updating anymore. This entrance for running Rubbos within Bottlenecks is no longer supported. Change-Id: I04e4042ff3998b3696df2ed47a9ffab6f1620ec3 Signed-off-by: liyin <liyin11@huawei.com> (cherry picked from commit 6a8257127b3dce1f18a650afe6921a34b6c6f5b8)
Diffstat (limited to 'testsuites/vstf/vstf_collector.py')
-rwxr-xr-xtestsuites/vstf/vstf_collector.py80
1 files changed, 0 insertions, 80 deletions
diff --git a/testsuites/vstf/vstf_collector.py b/testsuites/vstf/vstf_collector.py
deleted file mode 100755
index af11bc66..00000000
--- a/testsuites/vstf/vstf_collector.py
+++ /dev/null
@@ -1,80 +0,0 @@
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd. and others
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import argparse
-import json
-import requests
-import logging
-
-LOG = logging.getLogger(__name__)
-
-
-class Uploader(object):
-
- def __init__(self, conf):
- self.headers = {'Content-type': 'application/json'}
- self.timeout = 5
- self.result = {
- "project_name": "bottlenecks",
- "description": "bottlenecks test cases result"}
-
- with open(conf) as stream:
- dashboard_conf = json.load(stream)
- self.result['pod_name'] = dashboard_conf['pod_name']
- self.result['installer'] = dashboard_conf['installer']
- self.result['version'] = dashboard_conf['version']
- self.target = dashboard_conf['target']
-
- def upload_result(self, case_name, raw_data):
- if self.target == '':
- LOG.error('No target was set, so no data will be posted.')
- return
- self.result["case_name"] = case_name
- self.result["details"] = raw_data
- try:
- LOG.debug(
- 'Result to be uploaded:\n %s' %
- json.dumps(
- self.result,
- indent=4))
- res = requests.post(self.target,
- data=json.dumps(self.result),
- headers=self.headers,
- timeout=self.timeout)
- print(
- 'Test result posting finished with status code %d.' %
- res.status_code)
- except Exception as err:
- LOG.error('Failed to record result data: %s', err)
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.DEBUG)
- parser = argparse.ArgumentParser()
- parser.add_argument(
- '--config',
- required=True,
- help="basic config file for uploader, json format.")
- parser.add_argument(
- '--dir',
- required=True,
- help="result files for test cases")
- args = parser.parse_args()
- realpath = os.path.realpath(args.dir)
- for filename in os.listdir(args.dir):
- filepath = os.path.join(realpath, filename)
- LOG.debug("uploading test result from file:%s", filepath)
- with open(filepath) as stream:
- result = eval(stream.read())
- Uploader(
- args.config).upload_result(
- filename.lower().replace(
- '-',
- ''),
- result)