From 4ac123951f5571d44ec01b680941b95203653c64 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Tue, 18 Dec 2018 18:26:23 +0000 Subject: Add ability to get data from different DBs in influx In order to get data from Barometer, the influx helper need to be updated to recognise different DBs. This patch adds an optional arg to specify which database to use. By default, the configured dispatcher for Yardstick is used. Limitation: The new change hard codes barometer DB name to be used, and assumes that it is in the same instance of Influx as the Yardstick dispatcher. This can be extended later to make it configurable, however, a new config option would have to be introduced. JIRA: YARDSTICK-1593 Change-Id: Idee9c3491d6bf7b549e014edd9ff031312cf0ec2 Signed-off-by: Emma Foley --- yardstick/tests/unit/apiserver/utils/test_influx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'yardstick') diff --git a/yardstick/tests/unit/apiserver/utils/test_influx.py b/yardstick/tests/unit/apiserver/utils/test_influx.py index 6021d35df..3a97ff292 100644 --- a/yardstick/tests/unit/apiserver/utils/test_influx.py +++ b/yardstick/tests/unit/apiserver/utils/test_influx.py @@ -1,5 +1,6 @@ ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# Copyright (c) 2019 Intel Corporation. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -29,7 +30,7 @@ class GetDataDbClientTestCase(base.BaseUnitTestCase): self.assertEqual('fake_client', influx.get_data_db_client()) _mock_parser.read.assert_called_once_with(constants.CONF_FILE) - mock_get_client.assert_called_once_with(_mock_parser) + mock_get_client.assert_called_once_with(_mock_parser, None) @mock.patch.object(influx.logger, 'error') @mock.patch.object(influx, '_get_influxdb_client', @@ -46,7 +47,7 @@ class GetDataDbClientTestCase(base.BaseUnitTestCase): influx.get_data_db_client() _mock_parser.read.assert_called_once_with(constants.CONF_FILE) - mock_get_client.assert_called_once_with(_mock_parser) + mock_get_client.assert_called_once_with(_mock_parser, None) class GetIpTestCase(base.BaseUnitTestCase): -- cgit 1.2.3-korg