aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common/constants.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/common/constants.py')
-rw-r--r--yardstick/common/constants.py51
1 files changed, 41 insertions, 10 deletions
diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py
index 32ed746df..03733b6da 100644
--- a/yardstick/common/constants.py
+++ b/yardstick/common/constants.py
@@ -6,19 +6,16 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from __future__ import absolute_import
-import os
-import errno
+import errno
+import os
from functools import reduce
import pkg_resources
-# this module must only import other modules that do
-# not require loggers to be created, so this cannot
-# include yardstick.common.utils
from yardstick.common.yaml_loader import yaml_load
+
dirname = os.path.dirname
abspath = os.path.abspath
join = os.path.join
@@ -40,10 +37,8 @@ def get_param(key, default=''):
try:
with open(conf_file) as f:
value = yaml_load(f)
- except IOError:
- pass
- except OSError as e:
- if e.errno != errno.EEXIST:
+ except (IOError, OSError) as e:
+ if e.errno != errno.ENOENT:
raise
else:
CONF.update(value)
@@ -85,6 +80,7 @@ YARDSTICK_ROOT_PATH = dirname(
TASK_LOG_DIR = get_param('dir.tasklog', '/var/log/yardstick/')
CONF_SAMPLE_DIR = join(REPOS_DIR, 'etc/yardstick/')
ANSIBLE_DIR = join(REPOS_DIR, 'ansible')
+ANSIBLE_ROLES_PATH = join(REPOS_DIR, 'ansible/roles/')
SAMPLE_CASE_DIR = join(REPOS_DIR, 'samples')
TESTCASE_DIR = join(YARDSTICK_ROOT_PATH, 'tests/opnfv/test_cases/')
TESTSUITE_DIR = join(YARDSTICK_ROOT_PATH, 'tests/opnfv/test_suites/')
@@ -120,6 +116,7 @@ INFLUXDB_DB_NAME = get_param('influxdb.db_name', 'yardstick')
INFLUXDB_IMAGE = get_param('influxdb.image', 'tutum/influxdb')
INFLUXDB_TAG = get_param('influxdb.tag', '0.13')
INFLUXDB_DASHBOARD_PORT = 8083
+QUEUE_PUT_TIMEOUT = 10
# grafana
GRAFANA_IP = get_param('grafana.ip', SERVER_IP)
@@ -146,6 +143,40 @@ BASE_URL = 'http://localhost:5000'
ENV_ACTION_API = BASE_URL + '/yardstick/env/action'
ASYNC_TASK_API = BASE_URL + '/yardstick/asynctask'
+API_ERRORS = {
+ 'UploadOpenrcError': {
+ 'message': "Upload openrc ERROR!",
+ 'status': API_ERROR,
+ },
+ 'UpdateOpenrcError': {
+ 'message': "Update openrc ERROR!",
+ 'status': API_ERROR,
+ },
+ 'ApiServerError': {
+ 'message': "An unkown exception happened to Api Server!",
+ 'status': API_ERROR,
+ },
+}
+
+# flags
+IS_EXISTING = 'is_existing'
+IS_PUBLIC = 'is_public'
+
# general
TESTCASE_PRE = 'opnfv_yardstick_'
TESTSUITE_PRE = 'opnfv_'
+
+# OpenStack cloud default config parameters
+OS_CLOUD_DEFAULT_CONFIG = {'verify': False}
+
+# Kubernetes
+SCOPE_NAMESPACED = 'Namespaced'
+SCOPE_CLUSTER = 'Cluster'
+
+# VNF definition
+SSH_PORT = 22
+LUA_PORT = 22022
+
+# IMIX mode
+DISTRIBUTION_IN_PACKETS = 'mode_DIP'
+DISTRIBUTION_IN_BYTES = 'mode_DIB'