summaryrefslogtreecommitdiffstats
path: root/testsuites/posca/testcase_dashboard/posca_moon_tenants.py
diff options
context:
space:
mode:
authorAce Lee <liyin11@huawei.com>2018-01-09 03:19:09 +0000
committerliyin <liyin11@huawei.com>2018-02-26 08:58:07 +0000
commit06db2e37272bb3a030c2b5f2e255ec6a61f17472 (patch)
treee858fe31ec183eb4ff326f16763856db543e9d83 /testsuites/posca/testcase_dashboard/posca_moon_tenants.py
parentc79a7da0de95b42f66c2a6f214372514c9c246db (diff)
Moon testcase bug fix
JIRA: BOTTLENECK-220 The JIRA ticket is to suit moon version 4.3. There are some bugs to fix. Change-Id: Idf8b9a2b4dea6508738283e76457b8d1d25ceae9 Signed-off-by: Ace Lee <liyin11@huawei.com>
Diffstat (limited to 'testsuites/posca/testcase_dashboard/posca_moon_tenants.py')
-rw-r--r--testsuites/posca/testcase_dashboard/posca_moon_tenants.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuites/posca/testcase_dashboard/posca_moon_tenants.py b/testsuites/posca/testcase_dashboard/posca_moon_tenants.py
new file mode 100644
index 00000000..446faccc
--- /dev/null
+++ b/testsuites/posca/testcase_dashboard/posca_moon_tenants.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+##############################################################################
+# 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
+##############################################################################
+'''This file realize a function of creating dashboard of stress ping test'''
+import ConfigParser
+from elasticsearch import Elasticsearch
+import os
+import utils.logger as log
+from utils.parser import Parser as conf_parser
+
+LOG = log.Logger(__name__).getLogger()
+config = ConfigParser.ConfigParser()
+es = Elasticsearch()
+dashboard_path = os.path.join(conf_parser.test_dir,
+ "posca",
+ "testcase_dashboard")
+dashboard_dir = dashboard_path + "/"
+
+
+def dashboard_send_data(runner_config, test_data):
+ global es
+ print runner_config
+ es_ip = runner_config['dashboard_ip'].split(':')
+ es = Elasticsearch([{'host': es_ip[0]}])
+ print test_data["test_body"]
+ res = es.index(index="bottlenecks",
+ doc_type=test_data["testcase"],
+ body=test_data["test_body"][0])
+ if res['created'] == "False":
+ LOG.error("date send to kibana have errors ", test_data["data_body"])