Merge "Update release note for Colorado 2.0"
authorliang gao <jean.gaoliang@huawei.com>
Tue, 18 Oct 2016 01:57:18 +0000 (01:57 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Tue, 18 Oct 2016 01:57:18 +0000 (01:57 +0000)
etc/__init__.py [new file with mode: 0644]
setup.py
tests/unit/dispatcher/test_influxdb_line_protocol.py
third_party/__init__.py [new file with mode: 0644]
third_party/influxdb/__init__.py [new file with mode: 0644]
third_party/influxdb/influxdb_line_protocol.py [moved from yardstick/dispatcher/influxdb_line_protocol.py with 100% similarity]
yardstick/benchmark/contexts/node.py
yardstick/cmd/commands/testcase.py
yardstick/definitions.py [new file with mode: 0644]
yardstick/dispatcher/influxdb.py

diff --git a/etc/__init__.py b/etc/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index a2131cf..ba7316d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -23,6 +23,12 @@ setup(
             'resources/files/*',
             'resources/scripts/install/*.bash',
             'resources/scripts/remove/*.bash'
+        ],
+        'etc': [
+            'yardstick/nodes/*/*.yaml'
+        ],
+        'tests': [
+            'opnfv/*/*.yaml'
         ]
     },
     url="https://www.opnfv.org",
index cb05bf4..42553c4 100644 (file)
@@ -4,7 +4,7 @@
 # influxdb-python/influxdb/tests/test_line_protocol.py
 
 import unittest
-from yardstick.dispatcher.influxdb_line_protocol import make_lines
+from third_party.influxdb.influxdb_line_protocol import make_lines
 
 
 class TestLineProtocol(unittest.TestCase):
diff --git a/third_party/__init__.py b/third_party/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/third_party/influxdb/__init__.py b/third_party/influxdb/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index c3d6521..c4e603a 100644 (file)
@@ -8,10 +8,12 @@
 ##############################################################################
 
 import sys
+import os
 import yaml
 import logging
 
 from yardstick.benchmark.contexts.base import Context
+from yardstick.definitions import YARDSTICK_ROOT_PATH
 
 LOG = logging.getLogger(__name__)
 
@@ -33,7 +35,9 @@ class NodeContext(Context):
     def init(self, attrs):
         '''initializes itself from the supplied arguments'''
         self.name = attrs["name"]
-        self.file_path = attrs.get("file", "/etc/yardstick/nodes/pod.yaml")
+        self.file_path = attrs.get("file", "")
+        if not os.path.exists(self.file_path):
+            self.file_path = YARDSTICK_ROOT_PATH + self.file_path
 
         LOG.info("Parsing pod file: %s", self.file_path)
 
index 5205eb9..cb76c7a 100644 (file)
@@ -8,13 +8,15 @@
 ##############################################################################
 
 """ Handler for yardstick command 'testcase' """
-from yardstick.cmd import print_hbar
-from yardstick.common.task_template import TaskTemplate
-from yardstick.common.utils import cliargs
 import os
 import yaml
 import sys
 
+from yardstick.cmd import print_hbar
+from yardstick.common.task_template import TaskTemplate
+from yardstick.common.utils import cliargs
+from yardstick.definitions import YARDSTICK_ROOT_PATH
+
 
 class TestcaseCommands(object):
     '''Testcase commands.
@@ -22,7 +24,7 @@ class TestcaseCommands(object):
        Set of commands to discover and display test cases.
     '''
     def __init__(self):
-        self.test_case_path = 'tests/opnfv/test_cases/'
+        self.test_case_path = YARDSTICK_ROOT_PATH + 'tests/opnfv/test_cases/'
         self.testcase_list = []
 
     def do_list(self, args):
diff --git a/yardstick/definitions.py b/yardstick/definitions.py
new file mode 100644 (file)
index 0000000..300a78e
--- /dev/null
@@ -0,0 +1,5 @@
+import os
+
+dirname = os.path.dirname
+YARDSTICK_ROOT_PATH = dirname(dirname(os.path.abspath(__file__)))
+YARDSTICK_ROOT_PATH += os.path.sep
index e431f2c..8673253 100644 (file)
@@ -16,7 +16,7 @@ import time
 from oslo_config import cfg
 
 from yardstick.dispatcher.base import Base as DispatchBase
-from yardstick.dispatcher.influxdb_line_protocol import make_lines
+from third_party.influxdb.influxdb_line_protocol import make_lines
 
 LOG = logging.getLogger(__name__)