summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/resources/env_action.py16
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml4
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-noha_daily.yaml4
-rw-r--r--yardstick/__init__.py13
-rw-r--r--yardstick/benchmark/contexts/heat.py15
-rw-r--r--yardstick/cmd/cli.py13
-rw-r--r--yardstick/vTC/apexlake/tests/data/generated_templates/experiment_1.yaml13
-rw-r--r--yardstick/vTC/apexlake/tests/data/generated_templates/experiment_2.yaml13
-rw-r--r--yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml2
9 files changed, 35 insertions, 58 deletions
diff --git a/api/resources/env_action.py b/api/resources/env_action.py
index ea94bc123..9d1686a1d 100644
--- a/api/resources/env_action.py
+++ b/api/resources/env_action.py
@@ -195,6 +195,13 @@ def prepareYardstickEnv(args):
return result_handler('success', {'task_id': task_id})
+def _already_source_openrc():
+ """Check if openrc is sourced already"""
+ return all(os.environ.get(k) for k in ['OS_AUTH_URL', 'OS_USERNAME',
+ 'OS_PASSWORD', 'OS_TENANT_NAME',
+ 'EXTERNAL_NETWORK'])
+
+
def _prepare_env_daemon(task_id):
_create_task(task_id)
@@ -208,11 +215,10 @@ def _prepare_env_daemon(task_id):
rc_file = config.OPENSTACK_RC_FILE
- _get_remote_rc_file(rc_file, installer_ip, installer_type)
-
- _source_file(rc_file)
-
- _append_external_network(rc_file)
+ if not _already_source_openrc():
+ _get_remote_rc_file(rc_file, installer_ip, installer_type)
+ _source_file(rc_file)
+ _append_external_network(rc_file)
# update the external_network
_source_file(rc_file)
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml
index 66fab6142..7ce6f10cc 100644
--- a/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml
@@ -22,3 +22,7 @@ test_cases:
task_args:
ericsson-pod2: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml",
"host": "node1.LF","target": "node2.LF"}'
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-noha_daily.yaml
index 324ba5ca0..24791e23e 100644
--- a/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-noha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-noha_daily.yaml
@@ -22,3 +22,7 @@ test_cases:
task_args:
ericsson-pod2: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml",
"host": "node1.LF","target": "node2.LF"}'
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
diff --git a/yardstick/__init__.py b/yardstick/__init__.py
index 1ad6eb0b1..e19be36fd 100644
--- a/yardstick/__init__.py
+++ b/yardstick/__init__.py
@@ -35,19 +35,18 @@ LOG = logging.getLogger(__name__)
def _init_logging():
- _LOG_STREAM_HDLR.setFormatter(_LOG_FORMATTER)
+ LOG.setLevel(logging.DEBUG)
+ _LOG_STREAM_HDLR.setFormatter(_LOG_FORMATTER)
+ if os.environ.get('CI_DEBUG', '').lower() in {'1', 'y', "yes", "true"}:
+ _LOG_STREAM_HDLR.setLevel(logging.DEBUG)
+ else:
+ _LOG_STREAM_HDLR.setLevel(logging.INFO)
# don't append to log file, clobber
_LOG_FILE_HDLR.setFormatter(_LOG_FORMATTER)
- # set log file to store debug info
_LOG_FILE_HDLR.setLevel(logging.DEBUG)
del logging.root.handlers[:]
logging.root.addHandler(_LOG_STREAM_HDLR)
logging.root.addHandler(_LOG_FILE_HDLR)
logging.debug("logging.root.handlers = %s", logging.root.handlers)
-
- if os.environ.get('CI_DEBUG', '').lower() in {'1', 1, 'y', "yes", "true"}:
- LOG.setLevel(logging.DEBUG)
- else:
- LOG.setLevel(logging.INFO)
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index c5c127966..479548b34 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -62,22 +62,19 @@ class HeatContext(Context):
"""initializes itself from the supplied arguments"""
self.name = attrs["name"]
- if "user" in attrs:
- self._user = attrs["user"]
+ self._user = attrs.get("user")
- if "heat_template" in attrs:
- self.template_file = attrs["heat_template"]
- self.heat_parameters = attrs.get("heat_parameters", None)
+ self.template_file = attrs.get("heat_template")
+ if self.template_file:
+ self.heat_parameters = attrs.get("heat_parameters")
return
self.keypair_name = self.name + "-key"
self.secgroup_name = self.name + "-secgroup"
- if "image" in attrs:
- self._image = attrs.get("image")
+ self._image = attrs.get("image")
- if "flavor" in attrs:
- self._flavor = attrs.get("flavor")
+ self._flavor = attrs.get("flavor")
self.placement_groups = [PlacementGroup(name, self, pgattrs["policy"])
for name, pgattrs in attrs.get(
diff --git a/yardstick/cmd/cli.py b/yardstick/cmd/cli.py
index 6281bb813..1f8dfee2d 100644
--- a/yardstick/cmd/cli.py
+++ b/yardstick/cmd/cli.py
@@ -20,7 +20,7 @@ from pkg_resources import get_distribution
from argparse import RawDescriptionHelpFormatter
from oslo_config import cfg
-from yardstick import _init_logging, LOG
+from yardstick import _init_logging, _LOG_STREAM_HDLR
from yardstick.cmd.commands import task
from yardstick.cmd.commands import runner
from yardstick.cmd.commands import scenario
@@ -33,11 +33,7 @@ cli_opts = [
cfg.BoolOpt('debug',
short='d',
default=False,
- help='increase output verbosity to debug'),
- cfg.BoolOpt('verbose',
- short='v',
- default=False,
- help='increase output verbosity to info')
+ help='increase output verbosity to debug')
]
CONF.register_cli_opts(cli_opts)
@@ -132,11 +128,8 @@ class YardstickCLI():
def _handle_global_opts(self):
_init_logging()
- if CONF.verbose:
- LOG.setLevel(logging.INFO)
-
if CONF.debug:
- LOG.setLevel(logging.DEBUG)
+ _LOG_STREAM_HDLR.setLevel(logging.DEBUG)
def _dispath_func_notask(self):
diff --git a/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_1.yaml b/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_1.yaml
index 20fcb6718..5788980b0 100644
--- a/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_1.yaml
+++ b/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_1.yaml
@@ -1,16 +1,3 @@
-# Copyright (c) 2016-2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
heat_template_version: 2014-10-16
description: HOT template to create a DPI
diff --git a/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_2.yaml b/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_2.yaml
index 493d81b7a..44a81d081 100644
--- a/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_2.yaml
+++ b/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_2.yaml
@@ -1,16 +1,3 @@
-# Copyright (c) 2016-2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
heat_template_version: 2014-10-16
description: HOT template to create a DPI
diff --git a/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml b/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml
index 4cb8c1a62..39dc095c1 100644
--- a/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml
+++ b/yardstick/vTC/apexlake/tests/data/generated_templates/vTC.yaml
@@ -1,5 +1,5 @@
##############################################################################
-# Copyright (c) 2017 user@TRAFCLASS-PACKET1.fuel.local and others.
+# Copyright (c) 2016-2017 Intel Corporation
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0