import logging
import logging.config
+import sys
+import os
+import yardstick.vTC.apexlake as apexlake
+
+# Hack to be able to run apexlake unit tests
+# without having to install apexlake.
+sys.path.append(os.path.dirname(apexlake.__file__))
logging.basicConfig(
level=logging.WARNING,
'%(levelname)s %(message)s', # noqa
datefmt='%m/%d/%y %H:%M:%S')
logging.getLogger(__name__).setLevel(logging.INFO)
-
-# Hack to be able to run apexlake unit tests
-# without having to install apexlake.
-import sys
-import os
-import yardstick.vTC.apexlake as apexlake
-sys.path.append(os.path.dirname(apexlake.__file__))
sla_action = scenario_cfg["sla"].get("action", "assert")
# To both be able to include the stop value and handle backwards stepping
- margin = lambda start, stop: -1 if start > stop else 1
+ def margin(start, stop):
+ return -1 if start > stop else 1
param_iters = \
[xrange(d['start'], d['stop'] + margin(d['start'], d['stop']),
import time
import traceback
-log = logging.getLogger(__name__)
-
from oslo_config import cfg
import yardstick.common.utils as utils
from yardstick.benchmark.scenarios import base as base_scenario
from yardstick.dispatcher.base import Base as DispatcherBase
+log = logging.getLogger(__name__)
+
CONF = cfg.CONF
if "sla" in self.scenario_cfg:
sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"])
- assert result["rtt"] <= sla_max_rtt, "rtt %f > sla:max_rtt(%f); " % \
- (result["rtt"], sla_max_rtt)
+ assert result["rtt"] <= sla_max_rtt, \
+ "rtt %f > sla:max_rtt(%f); " % (result["rtt"], sla_max_rtt)
else:
LOG.error("ping '%s' '%s' timeout", options, destination)
if "sla" in self.scenario_cfg:
sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"])
- assert result["rtt"] <= sla_max_rtt, "rtt %f > sla:max_rtt(%f); " % \
- (result["rtt"], sla_max_rtt)
+ assert result["rtt"] <= sla_max_rtt, \
+ "rtt %f > sla:max_rtt(%f); " % (result["rtt"], sla_max_rtt)
else:
LOG.error("ping6 timeout")
self.run_done = True
'''run the command line interface'''
# register subcommands to parse additional command line arguments
- parser = lambda subparsers: self._add_command_parsers(
- YardstickCLI.categories, subparsers)
+ def parser(subparsers):
+ self._add_command_parsers(YardstickCLI.categories, subparsers)
+
category_opt = cfg.SubCommandOpt("category",
title="Command categories",
help="Available categories",
if tpl is None:
tpl = {}
# Looking for supported version keys in the loaded template
- if not ('HeatTemplateFormatVersion' in tpl
- or 'heat_template_version' in tpl
- or 'AWSTemplateFormatVersion' in tpl):
+ if not ('HeatTemplateFormatVersion' in tpl or
+ 'heat_template_version' in tpl or
+ 'AWSTemplateFormatVersion' in tpl):
raise ValueError("Template format version not found.")
return tpl
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'vmriccox'
-
-
from keystoneclient.v2_0 import client as keystoneClient
from heatclient import client as heatClient
from heatclient.common import template_utils
import experimental_framework.common as common
+__author__ = 'vmriccox'
+
class HeatManager:
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'vmriccox'
-
-
import unittest
import mock
from experimental_framework.benchmarking_unit import BenchmarkingUnit
from experimental_framework.benchmarks.rfc2544_throughput_benchmark import \
RFC2544ThroughputBenchmark
+__author__ = 'vmriccox'
+
# class DummyDataManager(DataManager):
#
-__author__ = 'vmricco'
-
import unittest
import mock
import os
import experimental_framework.common as common
import experimental_framework.constants.conf_file_sections as cf
+__author__ = 'vmricco'
+
def reset_common():
common.LOG = None
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'vmriccox'
-
-
import unittest
from experimental_framework.constants import conf_file_sections as cfs
+__author__ = 'vmriccox'
+
class TestConfFileSection(unittest.TestCase):
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'vmriccox'
-
-
import unittest
import mock
import experimental_framework.deployment_unit as mut
+__author__ = 'vmriccox'
+
class DummyHeatManager:
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'gpetralx'
-
-
import unittest
import experimental_framework.heat_template_generation as heat_gen
import mock
import os
import experimental_framework.common as common
+__author__ = 'gpetralx'
+
def reset_common():
common.LOG = None
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'gpetralx'
-
-
import unittest
from experimental_framework import heat_manager
import mock
+__author__ = 'gpetralx'
+
def get_mock_heat(version, *args, **kwargs):
return MockHeat()
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'gpetralx'
-
-
import unittest
import mock
import os
from experimental_framework.benchmarks \
import multi_tenancy_throughput_benchmark as bench
+__author__ = 'gpetralx'
+
class MockDeploymentUnit(object):
def deploy_heat_template(self, temp_file, stack_name, heat_param):
# See the License for the specific language governing permissions and
# limitations under the License.
-__author__ = 'gpetralx'
-
-
import unittest
import experimental_framework.heat_template_generation as heat_gen
+__author__ = 'gpetralx'
+
class TestTreeNode(unittest.TestCase):
def setUp(self):