Push yardstick debug log into the artifacts 75/26575/2
authorrexlee8776 <limingjiang@huawei.com>
Thu, 29 Dec 2016 11:03:31 +0000 (11:03 +0000)
committerRex Lee <limingjiang@huawei.com>
Mon, 6 Feb 2017 09:26:57 +0000 (09:26 +0000)
the log directory should be specific yardstick so
it can be easily pushed into artifacts with the
directory.

JIRA: YARDSTICK-507

Change-Id: If28b0c3938e123c8a55272cb98291fb76aaf6f9e
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
yardstick/__init__.py
yardstick/common/constants.py

index 3ae915c..fbbc101 100644 (file)
@@ -13,12 +13,15 @@ import os
 import sys
 
 import yardstick.vTC.apexlake as apexlake
+from yardstick.common import constants
+from yardstick.common import utils as yardstick_utils
 
 # Hack to be able to run apexlake unit tests
 # without having to install apexlake.
 sys.path.append(os.path.dirname(apexlake.__file__))
 
-LOG_FILE = '/tmp/yardstick.log'
+yardstick_utils.makedirs(constants.YARDSTICK_LOG_DIR)
+LOG_FILE = os.path.join(constants.YARDSTICK_LOG_DIR, 'yardstick.log')
 LOG_FORMATTER = ('%(asctime)s '
                  '%(name)s %(filename)s:%(lineno)d '
                  '%(levelname)s %(message)s')
index e6faf68..e068c0b 100644 (file)
@@ -35,6 +35,8 @@ TESTCASE_DIR = join(YARDSTICK_ROOT_PATH, 'tests/opnfv/test_cases/')
 
 YARDSTICK_REPOS_DIR = '/home/opnfv/repos/yardstick'
 
+YARDSTICK_LOG_DIR = '/tmp/yardstick/'
+
 YARDSTICK_CONFIG_DIR = '/etc/yardstick/'
 
 YARDSTICK_CONFIG_FILE = join(YARDSTICK_CONFIG_DIR, 'yardstick.conf')