X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fcommon%2Fconstants.py;h=69485a4e4fdf986fb53d65cd706a226d86fe59d5;hb=c1a4f5028f88e7e97e3ae2cc3f8aae6bf67c07b2;hp=d251341fc823fbcd1c2be79603e1fa57be368fa0;hpb=14bc98f0e810e37f4600cb0b16d227e8290e1db2;p=yardstick.git diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py index d251341fc..69485a4e4 100644 --- a/yardstick/common/constants.py +++ b/yardstick/common/constants.py @@ -26,7 +26,15 @@ except KeyError: SERVER_IP = '172.17.0.1' else: with IPDB() as ip: - SERVER_IP = ip.routes['default'].gateway + try: + SERVER_IP = ip.routes['default'].gateway + except KeyError: + # during unittests ip.routes['default'] can be invalid + SERVER_IP = '127.0.0.1' + +if not SERVER_IP: + SERVER_IP = '127.0.0.1' + # dir CONF_DIR = get_param('dir.conf', '/etc/yardstick') @@ -40,12 +48,15 @@ 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/') DOCS_DIR = join(REPOS_DIR, 'docs/testing/user/userguide/') +OPENSTACK_CONF_DIR = '/etc/openstack' # file OPENRC = get_param('file.openrc', '/etc/yardstick/openstack.creds') ETC_HOSTS = get_param('file.etc_hosts', '/etc/hosts') CONF_FILE = join(CONF_DIR, 'yardstick.conf') POD_FILE = join(CONF_DIR, 'pod.yaml') +CLOUDS_CONF = join(OPENSTACK_CONF_DIR, 'clouds.yml') +K8S_CONF_FILE = join(CONF_DIR, 'admin.conf') CONF_SAMPLE_FILE = join(CONF_SAMPLE_DIR, 'yardstick.conf.sample') FETCH_SCRIPT = get_param('file.fetch_script', 'utils/fetch_os_creds.sh') FETCH_SCRIPT = join(RELENG_DIR, FETCH_SCRIPT) @@ -76,6 +87,7 @@ GRAFANA_IMAGE = get_param('grafana.image', 'grafana/grafana') GRAFANA_TAG = get_param('grafana.tag', '3.1.1') # api +API_PORT = 5000 DOCKER_URL = 'unix://var/run/docker.sock' INSTALLERS = ['apex', 'compass', 'fuel', 'joid'] SQLITE = 'sqlite:////tmp/yardstick.db'