Update requirements and release 2.2.0
+ remove ceilometer plugins since they require python-ceilometerclient that was deprecated long time ago and we cannot keep our requirements compatible with it anymore + update murano ctx to do not leave open file Change-Id: Ic344ce0dcc791375438c20b2751da8ca3e24f242
This commit is contained in:
parent
d52e165320
commit
20590f3071
@ -17,8 +17,22 @@ Changelog
|
|||||||
was missed or can be improved, feel free to change it!
|
was missed or can be improved, feel free to change it!
|
||||||
|
|
||||||
|
|
||||||
unreleased
|
[2.2.0] - 2021-10-21
|
||||||
----------
|
--------------------
|
||||||
|
|
||||||
|
Changed
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
|
* Switch docker image to rally 3.3.0 base.
|
||||||
|
* Update upper-constraints file
|
||||||
|
|
||||||
|
Removed
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
|
Ceilometer service was splitted into Gnocchi, Aodh, Panko long time ago.
|
||||||
|
We kept ceilometer api plugins for backward compatibility, but it is time to
|
||||||
|
go forward (ceilometerclient was deprecated and is not compatible with modern
|
||||||
|
python libraries).
|
||||||
|
|
||||||
Fixed
|
Fixed
|
||||||
~~~~~
|
~~~~~
|
||||||
|
@ -10,8 +10,8 @@ Rally-OpenStack is a package of Rally plugins for OpenStack platform.
|
|||||||
First of all, you need to pull the container. We suggest to use the last
|
First of all, you need to pull the container. We suggest to use the last
|
||||||
tagged version:
|
tagged version:
|
||||||
|
|
||||||
# pull the 2.1.0 image (the latest release at the point of writing the note)
|
# pull the 2.2.0 image (the latest release at the point of writing the note)
|
||||||
$ docker pull xrally/xrally-openstack:2.1.0
|
$ docker pull xrally/xrally-openstack:2.2.0
|
||||||
|
|
||||||
**WARNING: never attach folders and volumes to `/rally` inside the container. It can break everything.**
|
**WARNING: never attach folders and volumes to `/rally` inside the container. It can break everything.**
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ docker volumes or mount the directory.
|
|||||||
* use docker volumes. It is the easiest way. You just need to do something like:
|
* use docker volumes. It is the easiest way. You just need to do something like:
|
||||||
|
|
||||||
$ docker volume create --name rally_volume
|
$ docker volume create --name rally_volume
|
||||||
$ docker run -v rally_volume:/home/rally/.rally xrally/xrally-openstack:2.1.0 env create --name "foo"
|
$ docker run -v rally_volume:/home/rally/.rally xrally/xrally-openstack:2.2.0 env create --name "foo"
|
||||||
|
|
||||||
* mount outer directory inside the container
|
* mount outer directory inside the container
|
||||||
|
|
||||||
@ -44,17 +44,17 @@ docker volumes or mount the directory.
|
|||||||
$ sudo chown 65500 /var/lib/rally_container
|
$ sudo chown 65500 /var/lib/rally_container
|
||||||
|
|
||||||
# As opposed to mounting docker image, you must initialize rally database*
|
# As opposed to mounting docker image, you must initialize rally database*
|
||||||
$ docker run -v /var/lib/rally_container:/home/rally/.rally xrally/xrally-openstack:2.1.0 db create
|
$ docker run -v /var/lib/rally_container:/home/rally/.rally xrally/xrally-openstack:2.2.0 db create
|
||||||
|
|
||||||
# And finally, you can start doing your things.*
|
# And finally, you can start doing your things.*
|
||||||
$ docker run -v /var/lib/rally_container:/home/rally/.rally xrally/xrally-openstack:2.1.0 env create --name "foo"
|
$ docker run -v /var/lib/rally_container:/home/rally/.rally xrally/xrally-openstack:2.2.0 env create --name "foo"
|
||||||
|
|
||||||
Have fun!
|
Have fun!
|
||||||
|
|
||||||
# Links
|
# Links
|
||||||
|
|
||||||
* Free software: Apache license
|
* Free software: Apache license
|
||||||
* Documentation: https://xrally.org
|
* Documentation: https://rally.readthedocs.io
|
||||||
* Source: https://github.com/openstack/rally-openstack
|
* Source: https://github.com/openstack/rally-openstack
|
||||||
* Bugs: https://bugs.launchpad.net/rally
|
* Bugs: https://bugs.launchpad.net/rally
|
||||||
* Gitter chat: https://gitter.im/xRally/Lobby
|
* Gitter chat: https://gitter.im/xRally/Lobby
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM xrally/xrally:3.2.0
|
FROM xrally/xrally:3.3.0
|
||||||
|
|
||||||
# "rally" user (which is selected by-default) is owner of "/rally" directory,
|
# "rally" user (which is selected by-default) is owner of "/rally" directory,
|
||||||
# so there is no need to call chown or switch the user
|
# so there is no need to call chown or switch the user
|
||||||
@ -8,7 +8,7 @@ WORKDIR /rally/xrally_openstack
|
|||||||
# to install package system-wide, we need to temporary switch to root user
|
# to install package system-wide, we need to temporary switch to root user
|
||||||
USER root
|
USER root
|
||||||
# ensure that we have all system packages installed
|
# ensure that we have all system packages installed
|
||||||
RUN pip3 install --no-cache-dir -U bindep && apt update && apt install --yes $(bindep -b | tr '\n' ' ') && apt clean
|
RUN pip3 install --no-cache-dir -U bindep && apt update && DEBIAN_FRONTEND=noninteractive apt install --yes $(bindep -b | tr '\n' ' ') && apt clean
|
||||||
# disabling cache since we do not expect to install other packages
|
# disabling cache since we do not expect to install other packages
|
||||||
RUN pip3 install . --no-cache-dir --constraint ./upper-constraints.txt
|
RUN pip3 install . --no-cache-dir --constraint ./upper-constraints.txt
|
||||||
|
|
||||||
|
@ -550,24 +550,6 @@ class Manila(OSClient):
|
|||||||
return manila_client
|
return manila_client
|
||||||
|
|
||||||
|
|
||||||
@configure("ceilometer", default_version="2", default_service_type="metering",
|
|
||||||
supported_versions=["1", "2"])
|
|
||||||
class Ceilometer(OSClient):
|
|
||||||
"""Wrapper for CeilometerClient which returns authenticated native client.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
def create_client(self, version=None, service_type=None):
|
|
||||||
"""Return ceilometer client."""
|
|
||||||
from ceilometerclient import client as ceilometer
|
|
||||||
|
|
||||||
client = ceilometer.get_client(
|
|
||||||
self.choose_version(version),
|
|
||||||
session=self.keystone.get_session()[0],
|
|
||||||
endpoint_override=self._get_endpoint(service_type))
|
|
||||||
return client
|
|
||||||
|
|
||||||
|
|
||||||
@configure("gnocchi", default_service_type="metric", default_version="1",
|
@configure("gnocchi", default_service_type="metric", default_version="1",
|
||||||
supported_versions=["1"])
|
supported_versions=["1"])
|
||||||
class Gnocchi(OSClient):
|
class Gnocchi(OSClient):
|
||||||
|
@ -1,176 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
import time
|
|
||||||
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import validation
|
|
||||||
from rally import exceptions
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import context
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceilo_utils
|
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@context.configure(name="ceilometer", platform="openstack", order=450)
|
|
||||||
class CeilometerSampleGenerator(context.OpenStackContext):
|
|
||||||
"""Creates ceilometer samples and resources."""
|
|
||||||
|
|
||||||
CONFIG_SCHEMA = {
|
|
||||||
"type": "object",
|
|
||||||
"$schema": consts.JSON_SCHEMA,
|
|
||||||
"properties": {
|
|
||||||
"counter_name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"counter_type": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"counter_unit": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"counter_volume": {
|
|
||||||
"type": "number",
|
|
||||||
"minimum": 0
|
|
||||||
},
|
|
||||||
"resources_per_tenant": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"samples_per_resource": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"timestamp_interval": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"metadata_list": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"status": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"deleted": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"created_at": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": False
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"batch_size": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"batches_allow_lose": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["counter_name", "counter_type", "counter_unit",
|
|
||||||
"counter_volume"],
|
|
||||||
"additionalProperties": False
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFAULT_CONFIG = {
|
|
||||||
"resources_per_tenant": 5,
|
|
||||||
"samples_per_resource": 5,
|
|
||||||
"timestamp_interval": 60
|
|
||||||
}
|
|
||||||
|
|
||||||
def _store_batch_samples(self, scenario, batches, batches_allow_lose):
|
|
||||||
batches_allow_lose = batches_allow_lose or 0
|
|
||||||
unsuccess = 0
|
|
||||||
for i, batch in enumerate(batches, start=1):
|
|
||||||
try:
|
|
||||||
samples = scenario._create_samples(batch)
|
|
||||||
except Exception:
|
|
||||||
unsuccess += 1
|
|
||||||
LOG.warning("Failed to store batch %d of Ceilometer samples"
|
|
||||||
" during context creation" % i)
|
|
||||||
if unsuccess > batches_allow_lose:
|
|
||||||
raise exceptions.ContextSetupFailure(
|
|
||||||
ctx_name=self.get_name(),
|
|
||||||
msg="Context failed to store too many batches of samples")
|
|
||||||
|
|
||||||
return samples
|
|
||||||
|
|
||||||
def setup(self):
|
|
||||||
new_sample = {
|
|
||||||
"counter_name": self.config["counter_name"],
|
|
||||||
"counter_type": self.config["counter_type"],
|
|
||||||
"counter_unit": self.config["counter_unit"],
|
|
||||||
"counter_volume": self.config["counter_volume"],
|
|
||||||
}
|
|
||||||
resources = []
|
|
||||||
|
|
||||||
for user, tenant_id in self._iterate_per_tenants():
|
|
||||||
self.context["tenants"][tenant_id]["samples"] = []
|
|
||||||
self.context["tenants"][tenant_id]["resources"] = []
|
|
||||||
scenario = ceilo_utils.CeilometerScenario(
|
|
||||||
context={"user": user, "task": self.context["task"]}
|
|
||||||
)
|
|
||||||
for _ in range(self.config["resources_per_tenant"]):
|
|
||||||
samples_to_create = scenario._make_samples(
|
|
||||||
count=self.config["samples_per_resource"],
|
|
||||||
interval=self.config["timestamp_interval"],
|
|
||||||
metadata_list=self.config.get("metadata_list"),
|
|
||||||
batch_size=self.config.get("batch_size"),
|
|
||||||
**new_sample)
|
|
||||||
samples = self._store_batch_samples(
|
|
||||||
scenario, samples_to_create,
|
|
||||||
self.config.get("batches_allow_lose")
|
|
||||||
)
|
|
||||||
for sample in samples:
|
|
||||||
self.context["tenants"][tenant_id]["samples"].append(
|
|
||||||
sample.to_dict())
|
|
||||||
self.context["tenants"][tenant_id]["resources"].append(
|
|
||||||
samples[0].resource_id)
|
|
||||||
resources.append((user, samples[0].resource_id))
|
|
||||||
|
|
||||||
# NOTE(boris-42): Context should wait until samples are processed
|
|
||||||
from ceilometerclient import exc
|
|
||||||
|
|
||||||
for user, resource_id in resources:
|
|
||||||
scenario = ceilo_utils.CeilometerScenario(
|
|
||||||
context={"user": user, "task": self.context["task"]})
|
|
||||||
|
|
||||||
success = False
|
|
||||||
for i in range(60):
|
|
||||||
try:
|
|
||||||
scenario._get_resource(resource_id)
|
|
||||||
success = True
|
|
||||||
break
|
|
||||||
except exc.HTTPNotFound:
|
|
||||||
time.sleep(3)
|
|
||||||
if not success:
|
|
||||||
raise exceptions.ContextSetupFailure(
|
|
||||||
ctx_name=self.get_name(),
|
|
||||||
msg="Ceilometer Resource %s is not found" % resource_id)
|
|
||||||
|
|
||||||
def cleanup(self):
|
|
||||||
# We don't have API for removal of samples and resources
|
|
||||||
pass
|
|
@ -13,6 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
@ -62,9 +63,11 @@ class PackageGenerator(context.OpenStackContext):
|
|||||||
if is_config_app_dir:
|
if is_config_app_dir:
|
||||||
self.context["tenants"][tenant_id]["murano_ctx"] = zip_name
|
self.context["tenants"][tenant_id]["murano_ctx"] = zip_name
|
||||||
# TODO(astudenov): use self.generate_random_name()
|
# TODO(astudenov): use self.generate_random_name()
|
||||||
|
with open(zip_name, "rb") as f:
|
||||||
|
file = io.BytesIO(f.read())
|
||||||
package = clients.murano().packages.create(
|
package = clients.murano().packages.create(
|
||||||
{"categories": ["Web"], "tags": ["tag"]},
|
{"categories": ["Web"], "tags": ["tag"]},
|
||||||
{"file": open(zip_name, "rb")})
|
{"file": file})
|
||||||
|
|
||||||
self.context["tenants"][tenant_id]["packages"].append(package)
|
self.context["tenants"][tenant_id]["packages"].append(package)
|
||||||
|
|
||||||
|
@ -1,197 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceiloutils
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerAlarms.create_alarm",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateAlarm(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, **kwargs):
|
|
||||||
"""Create an alarm.
|
|
||||||
|
|
||||||
This scenarios test POST /v2/alarms.
|
|
||||||
meter_name and threshold are required parameters for alarm creation.
|
|
||||||
kwargs stores other optional parameters like 'ok_actions',
|
|
||||||
'project_id' etc that may be passed while creating an alarm.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param kwargs: specifies optional arguments for alarm creation.
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerAlarms.list_alarms", platform="openstack")
|
|
||||||
class ListAlarms(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Fetch all alarms.
|
|
||||||
|
|
||||||
This scenario fetches list of all alarms using GET /v2/alarms.
|
|
||||||
"""
|
|
||||||
self._list_alarms()
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerAlarms.create_and_list_alarm",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateAndListAlarm(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, **kwargs):
|
|
||||||
"""Create and get the newly created alarm.
|
|
||||||
|
|
||||||
This scenarios test GET /v2/alarms/(alarm_id)
|
|
||||||
Initially alarm is created and then the created alarm is fetched using
|
|
||||||
its alarm_id. meter_name and threshold are required parameters
|
|
||||||
for alarm creation. kwargs stores other optional parameters like
|
|
||||||
'ok_actions', 'project_id' etc. that may be passed while creating
|
|
||||||
an alarm.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param kwargs: specifies optional arguments for alarm creation.
|
|
||||||
"""
|
|
||||||
alarm = self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
self._list_alarms(alarm.alarm_id)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerAlarms.create_and_get_alarm",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateAndGetAlarm(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, **kwargs):
|
|
||||||
"""Create and get the newly created alarm.
|
|
||||||
|
|
||||||
These scenarios test GET /v2/alarms/(alarm_id)
|
|
||||||
Initially an alarm is created and then its detailed information is
|
|
||||||
fetched using its alarm_id. meter_name and threshold are required
|
|
||||||
parameters for alarm creation. kwargs stores other optional parameters
|
|
||||||
like 'ok_actions', 'project_id' etc. that may be passed while creating
|
|
||||||
an alarm.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param kwargs: specifies optional arguments for alarm creation.
|
|
||||||
"""
|
|
||||||
alarm = self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
self._get_alarm(alarm.alarm_id)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerAlarms.create_and_update_alarm",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateAndUpdateAlarm(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, **kwargs):
|
|
||||||
"""Create and update the newly created alarm.
|
|
||||||
|
|
||||||
This scenarios test PUT /v2/alarms/(alarm_id)
|
|
||||||
Initially alarm is created and then the created alarm is updated using
|
|
||||||
its alarm_id. meter_name and threshold are required parameters
|
|
||||||
for alarm creation. kwargs stores other optional parameters like
|
|
||||||
'ok_actions', 'project_id' etc that may be passed while alarm creation.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param kwargs: specifies optional arguments for alarm creation.
|
|
||||||
"""
|
|
||||||
alarm = self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
alarm_dict_diff = {"description": "Changed Test Description"}
|
|
||||||
self._update_alarm(alarm.alarm_id, alarm_dict_diff)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerAlarms.create_and_delete_alarm",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateAndDeleteAlarm(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, **kwargs):
|
|
||||||
"""Create and delete the newly created alarm.
|
|
||||||
|
|
||||||
This scenarios test DELETE /v2/alarms/(alarm_id)
|
|
||||||
Initially alarm is created and then the created alarm is deleted using
|
|
||||||
its alarm_id. meter_name and threshold are required parameters
|
|
||||||
for alarm creation. kwargs stores other optional parameters like
|
|
||||||
'ok_actions', 'project_id' etc that may be passed while alarm creation.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param kwargs: specifies optional arguments for alarm creation.
|
|
||||||
"""
|
|
||||||
alarm = self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
self._delete_alarm(alarm.alarm_id)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerAlarms.create_alarm_and_get_history",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateAlarmAndGetHistory(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, state, timeout=60, **kwargs):
|
|
||||||
"""Create an alarm, get and set the state and get the alarm history.
|
|
||||||
|
|
||||||
This scenario makes following queries:
|
|
||||||
|
|
||||||
* GET /v2/alarms/{alarm_id}/history
|
|
||||||
* GET /v2/alarms/{alarm_id}/state
|
|
||||||
* PUT /v2/alarms/{alarm_id}/state
|
|
||||||
|
|
||||||
Initially alarm is created and then get the state of the created alarm
|
|
||||||
using its alarm_id. Then get the history of the alarm. And finally the
|
|
||||||
state of the alarm is updated using given state. meter_name and
|
|
||||||
threshold are required parameters for alarm creation. kwargs stores
|
|
||||||
other optional parameters like 'ok_actions', 'project_id' etc that may
|
|
||||||
be passed while alarm creation.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param state: an alarm state to be set
|
|
||||||
:param timeout: The number of seconds for which to attempt a
|
|
||||||
successful check of the alarm state
|
|
||||||
:param kwargs: specifies optional arguments for alarm creation.
|
|
||||||
"""
|
|
||||||
alarm = self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
self._get_alarm_state(alarm.alarm_id)
|
|
||||||
self._get_alarm_history(alarm.alarm_id)
|
|
||||||
self._set_alarm_state(alarm, state, timeout)
|
|
@ -1,98 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
"""
|
|
||||||
Scenarios for Ceilometer Events API.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as cutils
|
|
||||||
from rally_openstack.task.scenarios.keystone import basic as kbasic
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE(idegtiarov): to work with event we need to create it, there are
|
|
||||||
# no other way except emit suitable notification from one of services,
|
|
||||||
# for example create new user in keystone.
|
|
||||||
|
|
||||||
@validation.add("required_services", services=[consts.Service.CEILOMETER,
|
|
||||||
consts.Service.KEYSTONE])
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True)
|
|
||||||
@scenario.configure(context={"admin_cleanup@openstack": ["keystone"],
|
|
||||||
"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerEvents.create_user_and_list_events",
|
|
||||||
platform="openstack")
|
|
||||||
class CeilometerEventsCreateUserAndListEvents(cutils.CeilometerScenario,
|
|
||||||
kbasic.KeystoneBasic):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Create user and fetch all events.
|
|
||||||
|
|
||||||
This scenario creates user to store new event and
|
|
||||||
fetches list of all events using GET /v2/events.
|
|
||||||
"""
|
|
||||||
self.admin_keystone.create_user()
|
|
||||||
events = self._list_events()
|
|
||||||
msg = ("Events list is empty, but it should include at least one "
|
|
||||||
"event about user creation")
|
|
||||||
self.assertTrue(events, msg)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services", services=[consts.Service.CEILOMETER,
|
|
||||||
consts.Service.KEYSTONE])
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True)
|
|
||||||
@scenario.configure(context={"admin_cleanup@openstack": ["keystone"],
|
|
||||||
"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerEvents.create_user_and_list_event_types",
|
|
||||||
platform="openstack")
|
|
||||||
class CeilometerEventsCreateUserAndListEventTypes(cutils.CeilometerScenario,
|
|
||||||
kbasic.KeystoneBasic):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Create user and fetch all event types.
|
|
||||||
|
|
||||||
This scenario creates user to store new event and
|
|
||||||
fetches list of all events types using GET /v2/event_types.
|
|
||||||
"""
|
|
||||||
self.admin_keystone.create_user()
|
|
||||||
event_types = self._list_event_types()
|
|
||||||
msg = ("Event types list is empty, but it should include at least one"
|
|
||||||
" type about user creation")
|
|
||||||
self.assertTrue(event_types, msg)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services", services=[consts.Service.CEILOMETER,
|
|
||||||
consts.Service.KEYSTONE])
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True)
|
|
||||||
@scenario.configure(context={"admin_cleanup@openstack": ["keystone"],
|
|
||||||
"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerEvents.create_user_and_get_event",
|
|
||||||
platform="openstack")
|
|
||||||
class CeilometerEventsCreateUserAndGetEvent(cutils.CeilometerScenario,
|
|
||||||
kbasic.KeystoneBasic):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Create user and gets event.
|
|
||||||
|
|
||||||
This scenario creates user to store new event and
|
|
||||||
fetches one event using GET /v2/events/<message_id>.
|
|
||||||
"""
|
|
||||||
self.admin_keystone.create_user()
|
|
||||||
events = self._list_events()
|
|
||||||
msg = ("Events list is empty, but it should include at least one "
|
|
||||||
"event about user creation")
|
|
||||||
self.assertTrue(events, msg)
|
|
||||||
self._get_event(event_id=events[0].message_id)
|
|
@ -1,72 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceiloutils
|
|
||||||
|
|
||||||
|
|
||||||
"""Scenarios for Ceilometer Meters API."""
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerMeters.list_meters", platform="openstack")
|
|
||||||
class ListMeters(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, metadata_query=None, limit=None):
|
|
||||||
"""Check all available queries for list resource request.
|
|
||||||
|
|
||||||
:param metadata_query: dict with metadata fields and values
|
|
||||||
:param limit: limit of meters in response
|
|
||||||
"""
|
|
||||||
|
|
||||||
scenario = ListMatchedMeters(self.context)
|
|
||||||
scenario.run(filter_by_project_id=True)
|
|
||||||
scenario.run(filter_by_user_id=True)
|
|
||||||
scenario.run(filter_by_resource_id=True)
|
|
||||||
if metadata_query:
|
|
||||||
scenario.run(metadata_query=metadata_query)
|
|
||||||
if limit:
|
|
||||||
scenario.run(limit=limit)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerMeters.list_matched_meters",
|
|
||||||
platform="openstack")
|
|
||||||
class ListMatchedMeters(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, filter_by_user_id=False, filter_by_project_id=False,
|
|
||||||
filter_by_resource_id=False, metadata_query=None, limit=None):
|
|
||||||
"""Get meters that matched fields from context and args.
|
|
||||||
|
|
||||||
:param filter_by_user_id: flag for query by user_id
|
|
||||||
:param filter_by_project_id: flag for query by project_id
|
|
||||||
:param filter_by_resource_id: flag for query by resource_id
|
|
||||||
:param metadata_query: dict with metadata fields and values for query
|
|
||||||
:param limit: count of resources in response
|
|
||||||
"""
|
|
||||||
|
|
||||||
query = self._make_general_query(filter_by_project_id,
|
|
||||||
filter_by_user_id,
|
|
||||||
filter_by_resource_id,
|
|
||||||
metadata_query)
|
|
||||||
self._list_meters(query, limit)
|
|
@ -1,113 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceiloutils
|
|
||||||
|
|
||||||
|
|
||||||
"""Scenarios for Ceilometer Queries API."""
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerQueries.create_and_query_alarms",
|
|
||||||
platform="openstack")
|
|
||||||
class CeilometerQueriesCreateAndQueryAlarms(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, filter=None, orderby=None,
|
|
||||||
limit=None, **kwargs):
|
|
||||||
"""Create an alarm and then query it with specific parameters.
|
|
||||||
|
|
||||||
This scenario tests POST /v2/query/alarms
|
|
||||||
An alarm is first created and then fetched using the input query.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param filter: optional filter query dictionary
|
|
||||||
:param orderby: optional param for specifying ordering of results
|
|
||||||
:param limit: optional param for maximum number of results returned
|
|
||||||
:param kwargs: optional parameters for alarm creation
|
|
||||||
"""
|
|
||||||
if filter:
|
|
||||||
filter = json.dumps(filter)
|
|
||||||
|
|
||||||
self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
self._query_alarms(filter, orderby, limit)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerQueries.create_and_query_alarm_history",
|
|
||||||
platform="openstack")
|
|
||||||
class CeilometerQueriesCreateAndQueryAlarmHistory(ceiloutils
|
|
||||||
.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, threshold, orderby=None, limit=None, **kwargs):
|
|
||||||
"""Create an alarm and then query for its history.
|
|
||||||
|
|
||||||
This scenario tests POST /v2/query/alarms/history
|
|
||||||
An alarm is first created and then its alarm_id is used to fetch the
|
|
||||||
history of that specific alarm.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param orderby: optional param for specifying ordering of results
|
|
||||||
:param limit: optional param for maximum number of results returned
|
|
||||||
:param kwargs: optional parameters for alarm creation
|
|
||||||
"""
|
|
||||||
alarm = self._create_alarm(meter_name, threshold, kwargs)
|
|
||||||
alarm_filter = json.dumps({"=": {"alarm_id": alarm.alarm_id}})
|
|
||||||
self._query_alarm_history(alarm_filter, orderby, limit)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(context={"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerQueries.create_and_query_samples",
|
|
||||||
platform="openstack")
|
|
||||||
class CeilometerQueriesCreateAndQuerySamples(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, counter_name, counter_type, counter_unit, counter_volume,
|
|
||||||
resource_id, filter=None, orderby=None, limit=None, **kwargs):
|
|
||||||
"""Create a sample and then query it with specific parameters.
|
|
||||||
|
|
||||||
This scenario tests POST /v2/query/samples
|
|
||||||
A sample is first created and then fetched using the input query.
|
|
||||||
|
|
||||||
:param counter_name: specifies name of the counter
|
|
||||||
:param counter_type: specifies type of the counter
|
|
||||||
:param counter_unit: specifies unit of the counter
|
|
||||||
:param counter_volume: specifies volume of the counter
|
|
||||||
:param resource_id: specifies resource id for the sample created
|
|
||||||
:param filter: optional filter query dictionary
|
|
||||||
:param orderby: optional param for specifying ordering of results
|
|
||||||
:param limit: optional param for maximum number of results returned
|
|
||||||
:param kwargs: parameters for sample creation
|
|
||||||
"""
|
|
||||||
self._create_sample(counter_name, counter_type, counter_unit,
|
|
||||||
counter_volume, resource_id, **kwargs)
|
|
||||||
|
|
||||||
if filter:
|
|
||||||
filter = json.dumps(filter)
|
|
||||||
self._query_samples(filter, orderby, limit)
|
|
@ -1,108 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceiloutils
|
|
||||||
|
|
||||||
|
|
||||||
"""Scenarios for Ceilometer Resource API."""
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerResource.list_resources",
|
|
||||||
platform="openstack")
|
|
||||||
class ListResources(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, metadata_query=None, start_time=None,
|
|
||||||
end_time=None, limit=None):
|
|
||||||
"""Check all available queries for list resource request.
|
|
||||||
|
|
||||||
This scenario fetches list of all resources using GET /v2/resources.
|
|
||||||
|
|
||||||
:param metadata_query: dict with metadata fields and values for query
|
|
||||||
:param start_time: lower bound of resource timestamp in isoformat
|
|
||||||
:param end_time: upper bound of resource timestamp in isoformat
|
|
||||||
:param limit: count of resources in response
|
|
||||||
"""
|
|
||||||
scenario = ListMatchedResources(self.context)
|
|
||||||
scenario.run(filter_by_project_id=True)
|
|
||||||
scenario.run(filter_by_user_id=True)
|
|
||||||
scenario.run(filter_by_resource_id=True)
|
|
||||||
if metadata_query:
|
|
||||||
scenario.run(metadata_query=metadata_query)
|
|
||||||
if start_time:
|
|
||||||
scenario.run(start_time=start_time)
|
|
||||||
if end_time:
|
|
||||||
scenario.run(end_time=end_time)
|
|
||||||
if start_time and end_time:
|
|
||||||
scenario.run(start_time=start_time, end_time=end_time)
|
|
||||||
if limit:
|
|
||||||
scenario.run(limit=limit)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerResource.get_tenant_resources",
|
|
||||||
platform="openstack")
|
|
||||||
class GetTenantResources(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Get all tenant resources.
|
|
||||||
|
|
||||||
This scenario retrieves information about tenant resources using
|
|
||||||
GET /v2/resources/(resource_id)
|
|
||||||
"""
|
|
||||||
resources = self.context["tenant"].get("resources", [])
|
|
||||||
msg = ("No resources found for tenant: %s"
|
|
||||||
% self.context["tenant"].get("name"))
|
|
||||||
self.assertTrue(resources, msg)
|
|
||||||
for res_id in resources:
|
|
||||||
self._get_resource(res_id)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerResource.list_matched_resources",
|
|
||||||
platform="openstack")
|
|
||||||
class ListMatchedResources(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, filter_by_user_id=False, filter_by_project_id=False,
|
|
||||||
filter_by_resource_id=False, metadata_query=None, start_time=None,
|
|
||||||
end_time=None, limit=None):
|
|
||||||
"""Get resources that matched fields from context and args.
|
|
||||||
|
|
||||||
:param filter_by_user_id: flag for query by user_id
|
|
||||||
:param filter_by_project_id: flag for query by project_id
|
|
||||||
:param filter_by_resource_id: flag for query by resource_id
|
|
||||||
:param metadata_query: dict with metadata fields and values for query
|
|
||||||
:param start_time: lower bound of resource timestamp in isoformat
|
|
||||||
:param end_time: upper bound of resource timestamp in isoformat
|
|
||||||
:param limit: count of resources in response
|
|
||||||
"""
|
|
||||||
|
|
||||||
query = self._make_general_query(filter_by_project_id,
|
|
||||||
filter_by_user_id,
|
|
||||||
filter_by_resource_id,
|
|
||||||
metadata_query)
|
|
||||||
query += self._make_timestamp_query(start_time, end_time)
|
|
||||||
self._list_resources(query, limit)
|
|
@ -1,72 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceiloutils
|
|
||||||
|
|
||||||
|
|
||||||
"""Scenarios for Ceilometer Samples API."""
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerSamples.list_matched_samples",
|
|
||||||
platform="openstack")
|
|
||||||
class ListMatchedSamples(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, filter_by_resource_id=False, filter_by_project_id=False,
|
|
||||||
filter_by_user_id=False, metadata_query=None, limit=None):
|
|
||||||
"""Get list of samples that matched fields from context and args.
|
|
||||||
|
|
||||||
:param filter_by_user_id: flag for query by user_id
|
|
||||||
:param filter_by_project_id: flag for query by project_id
|
|
||||||
:param filter_by_resource_id: flag for query by resource_id
|
|
||||||
:param metadata_query: dict with metadata fields and values for query
|
|
||||||
:param limit: count of samples in response
|
|
||||||
"""
|
|
||||||
query = self._make_general_query(filter_by_project_id,
|
|
||||||
filter_by_user_id,
|
|
||||||
filter_by_resource_id,
|
|
||||||
metadata_query)
|
|
||||||
self._list_samples(query, limit)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerSamples.list_samples",
|
|
||||||
platform="openstack")
|
|
||||||
class ListSamples(ceiloutils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, metadata_query=None, limit=None):
|
|
||||||
"""Fetch all available queries for list sample request.
|
|
||||||
|
|
||||||
:param metadata_query: dict with metadata fields and values for query
|
|
||||||
:param limit: count of samples in response
|
|
||||||
"""
|
|
||||||
|
|
||||||
scenario = ListMatchedSamples(self.context)
|
|
||||||
scenario.run(filter_by_project_id=True)
|
|
||||||
scenario.run(filter_by_user_id=True)
|
|
||||||
scenario.run(filter_by_resource_id=True)
|
|
||||||
if metadata_query:
|
|
||||||
scenario.run(metadata_query=metadata_query)
|
|
||||||
if limit:
|
|
||||||
scenario.run(limit=limit)
|
|
@ -1,77 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils
|
|
||||||
|
|
||||||
|
|
||||||
"""Scenarios for Ceilometer Stats API."""
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerStats.create_meter_and_get_stats",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateMeterAndGetStats(utils.CeilometerScenario):
|
|
||||||
|
|
||||||
@logging.log_deprecated("Use 'get_stats' method, now samples are created "
|
|
||||||
"in context", "0.1.2")
|
|
||||||
def run(self, **kwargs):
|
|
||||||
"""Create a meter and fetch its statistics.
|
|
||||||
|
|
||||||
Meter is first created and then statistics is fetched for the same
|
|
||||||
using GET /v2/meters/(meter_name)/statistics.
|
|
||||||
|
|
||||||
:param kwargs: contains optional arguments to create a meter
|
|
||||||
"""
|
|
||||||
meter = self._create_meter(**kwargs)
|
|
||||||
self._get_stats(meter.counter_name)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services",
|
|
||||||
services=[consts.Service.CEILOMETER])
|
|
||||||
@validation.add("required_contexts", contexts=("ceilometer"))
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
|
||||||
@scenario.configure(name="CeilometerStats.get_stats", platform="openstack")
|
|
||||||
class GetStats(utils.CeilometerScenario):
|
|
||||||
|
|
||||||
def run(self, meter_name, filter_by_user_id=False,
|
|
||||||
filter_by_project_id=False, filter_by_resource_id=False,
|
|
||||||
metadata_query=None, period=None, groupby=None, aggregates=None):
|
|
||||||
"""Fetch statistics for certain meter.
|
|
||||||
|
|
||||||
Statistics is fetched for the using
|
|
||||||
GET /v2/meters/(meter_name)/statistics.
|
|
||||||
|
|
||||||
:param meter_name: meter to take statistic for
|
|
||||||
:param filter_by_user_id: flag for query by user_id
|
|
||||||
:param filter_by_project_id: flag for query by project_id
|
|
||||||
:param filter_by_resource_id: flag for query by resource_id
|
|
||||||
:param metadata_query: dict with metadata fields and values for query
|
|
||||||
:param period: the length of the time range covered by these stats
|
|
||||||
:param groupby: the fields used to group the samples
|
|
||||||
:param aggregates: name of function for samples aggregation
|
|
||||||
|
|
||||||
:returns: list of statistics data
|
|
||||||
"""
|
|
||||||
query = self._make_general_query(filter_by_project_id,
|
|
||||||
filter_by_user_id,
|
|
||||||
filter_by_resource_id,
|
|
||||||
metadata_query)
|
|
||||||
self._get_stats(meter_name, query, period, groupby, aggregates)
|
|
@ -1,75 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from rally.task import validation
|
|
||||||
|
|
||||||
from rally_openstack.common import consts
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as cutils
|
|
||||||
from rally_openstack.task.scenarios.keystone import basic as kbasic
|
|
||||||
|
|
||||||
|
|
||||||
"""Scenarios for Ceilometer Events API."""
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE(idegtiarov): to work with traits we need to create event firstly,
|
|
||||||
# there are no other way except emit suitable notification from one of
|
|
||||||
# services, for example create new user in keystone.
|
|
||||||
|
|
||||||
@validation.add("required_services", services=[consts.Service.CEILOMETER,
|
|
||||||
consts.Service.KEYSTONE])
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True)
|
|
||||||
@scenario.configure(
|
|
||||||
context={"admin_cleanup@openstack": ["keystone"],
|
|
||||||
"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerTraits.create_user_and_list_traits",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateUserAndListTraits(cutils.CeilometerScenario,
|
|
||||||
kbasic.KeystoneBasic):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Create user and fetch all event traits.
|
|
||||||
|
|
||||||
This scenario creates user to store new event and
|
|
||||||
fetches list of all traits for certain event type and
|
|
||||||
trait name using GET /v2/event_types/<event_type>/traits/<trait_name>.
|
|
||||||
"""
|
|
||||||
self.admin_keystone.create_user()
|
|
||||||
event = self._list_events()[0]
|
|
||||||
trait_name = event.traits[0]["name"]
|
|
||||||
self._list_event_traits(event_type=event.event_type,
|
|
||||||
trait_name=trait_name)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_services", services=[consts.Service.CEILOMETER,
|
|
||||||
consts.Service.KEYSTONE])
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True)
|
|
||||||
@scenario.configure(
|
|
||||||
context={"admin_cleanup@openstack": ["keystone"],
|
|
||||||
"cleanup@openstack": ["ceilometer"]},
|
|
||||||
name="CeilometerTraits.create_user_and_list_trait_descriptions",
|
|
||||||
platform="openstack")
|
|
||||||
class CreateUserAndListTraitDescriptions(
|
|
||||||
cutils.CeilometerScenario, kbasic.KeystoneBasic):
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
"""Create user and fetch all trait descriptions.
|
|
||||||
|
|
||||||
This scenario creates user to store new event and
|
|
||||||
fetches list of all traits for certain event type using
|
|
||||||
GET /v2/event_types/<event_type>/traits.
|
|
||||||
"""
|
|
||||||
self.admin_keystone.create_user()
|
|
||||||
event = self._list_events()[0]
|
|
||||||
self._list_event_trait_descriptions(event_type=event.event_type)
|
|
@ -1,466 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
import datetime as dt
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from rally import exceptions
|
|
||||||
from rally.task import atomic
|
|
||||||
from rally.task import utils as bench_utils
|
|
||||||
|
|
||||||
from rally_openstack.task import scenario
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerScenario(scenario.OpenStackScenario):
|
|
||||||
"""Base class for Ceilometer scenarios with basic atomic actions."""
|
|
||||||
|
|
||||||
def _make_samples(self, count=1, interval=0, counter_name="cpu_util",
|
|
||||||
counter_type="gauge", counter_unit="%", counter_volume=1,
|
|
||||||
project_id=None, user_id=None, source=None,
|
|
||||||
timestamp=None, metadata_list=None, batch_size=None):
|
|
||||||
"""Prepare and return a list of samples.
|
|
||||||
|
|
||||||
:param count: specifies number of samples in array
|
|
||||||
:param interval: specifies interval between timestamps of near-by
|
|
||||||
samples
|
|
||||||
:param counter_name: specifies name of the counter
|
|
||||||
:param counter_type: specifies type of the counter
|
|
||||||
:param counter_unit: specifies unit of the counter
|
|
||||||
:param counter_volume: specifies volume of the counter
|
|
||||||
:param project_id: specifies project id for samples
|
|
||||||
:param user_id: specifies user id for samples
|
|
||||||
:param source: specifies source for samples
|
|
||||||
:param timestamp: specifies timestamp for samples
|
|
||||||
:param metadata_list: specifies list of resource metadata
|
|
||||||
:param batch_size: specifies number of samples to store in one query
|
|
||||||
:returns: generator that produces lists of samples
|
|
||||||
"""
|
|
||||||
batch_size = batch_size or count
|
|
||||||
sample = {
|
|
||||||
"counter_name": counter_name,
|
|
||||||
"counter_type": counter_type,
|
|
||||||
"counter_unit": counter_unit,
|
|
||||||
"counter_volume": counter_volume,
|
|
||||||
"resource_id": str(uuid.uuid4())
|
|
||||||
}
|
|
||||||
opt_fields = {
|
|
||||||
"project_id": project_id,
|
|
||||||
"user_id": user_id,
|
|
||||||
"source": source,
|
|
||||||
"timestamp": timestamp,
|
|
||||||
}
|
|
||||||
for k, v in opt_fields.items():
|
|
||||||
if v:
|
|
||||||
sample.update({k: v})
|
|
||||||
len_meta = len(metadata_list) if metadata_list else 0
|
|
||||||
now = timestamp or dt.datetime.utcnow()
|
|
||||||
samples = []
|
|
||||||
for i in range(count):
|
|
||||||
if i and not (i % batch_size):
|
|
||||||
yield samples
|
|
||||||
samples = []
|
|
||||||
sample_item = dict(sample)
|
|
||||||
sample_item["timestamp"] = (
|
|
||||||
now - dt.timedelta(seconds=(interval * i))
|
|
||||||
).isoformat()
|
|
||||||
if metadata_list:
|
|
||||||
# NOTE(idegtiarov): Adding more than one template of metadata
|
|
||||||
# required it's proportional distribution among whole samples.
|
|
||||||
sample_item["resource_metadata"] = metadata_list[
|
|
||||||
i * len_meta // count
|
|
||||||
]
|
|
||||||
samples.append(sample_item)
|
|
||||||
yield samples
|
|
||||||
|
|
||||||
def _make_query_item(self, field, op="eq", value=None):
|
|
||||||
"""Create a SimpleQuery item for requests.
|
|
||||||
|
|
||||||
:param field: filtered field
|
|
||||||
:param op: operator for filtering
|
|
||||||
:param value: matched value
|
|
||||||
|
|
||||||
:returns: dict with field, op and value keys for query
|
|
||||||
"""
|
|
||||||
return {"field": field, "op": op, "value": value}
|
|
||||||
|
|
||||||
def _make_general_query(self, filter_by_project_id=None,
|
|
||||||
filter_by_user_id=None,
|
|
||||||
filter_by_resource_id=None,
|
|
||||||
metadata_query=None):
|
|
||||||
"""Create a SimpleQuery used by samples list API.
|
|
||||||
|
|
||||||
:param filter_by_project_id: add a project id to query
|
|
||||||
:param filter_by_user_id: add a user id to query
|
|
||||||
:param filter_by_resource_id: add a resource id to query
|
|
||||||
:param metadata_query: metadata dict that will add to query
|
|
||||||
|
|
||||||
:returns: SimpleQuery with specified items
|
|
||||||
|
|
||||||
"""
|
|
||||||
query = []
|
|
||||||
metadata_query = metadata_query or {}
|
|
||||||
|
|
||||||
if filter_by_user_id:
|
|
||||||
query.append(self._make_query_item("user_id", "eq",
|
|
||||||
self.context["user"]["id"]))
|
|
||||||
if filter_by_project_id:
|
|
||||||
query.append(self._make_query_item(
|
|
||||||
"project_id", "eq", self.context["tenant"]["id"]))
|
|
||||||
if filter_by_resource_id:
|
|
||||||
query.append(self._make_query_item(
|
|
||||||
"resource_id", "eq", self.context["tenant"]["resources"][0]))
|
|
||||||
|
|
||||||
for key, value in metadata_query.items():
|
|
||||||
query.append(self._make_query_item("metadata.%s" % key,
|
|
||||||
value=value))
|
|
||||||
return query
|
|
||||||
|
|
||||||
def _make_timestamp_query(self, start_time=None, end_time=None):
|
|
||||||
"""Create ceilometer query for timestamp range.
|
|
||||||
|
|
||||||
:param start_time: start datetime in isoformat
|
|
||||||
:param end_time: end datetime in isoformat
|
|
||||||
:returns: query with timestamp range
|
|
||||||
"""
|
|
||||||
query = []
|
|
||||||
if end_time and start_time and end_time < start_time:
|
|
||||||
msg = "End time should be great or equal than start time"
|
|
||||||
raise exceptions.InvalidArgumentsException(msg)
|
|
||||||
if start_time:
|
|
||||||
query.append(self._make_query_item("timestamp", ">=", start_time))
|
|
||||||
if end_time:
|
|
||||||
query.append(self._make_query_item("timestamp", "<=", end_time))
|
|
||||||
return query
|
|
||||||
|
|
||||||
def _make_profiler_key(self, method, query=None, limit=None):
|
|
||||||
"""Create key for profiling method with query.
|
|
||||||
|
|
||||||
:param method: Original profiler tag for method
|
|
||||||
:param query: ceilometer query which fields will be added to key
|
|
||||||
:param limit: if it exists `limit` will be added to key
|
|
||||||
:returns: profiler key that includes method and queried fields
|
|
||||||
"""
|
|
||||||
query = query or []
|
|
||||||
limit_line = limit and "limit" or ""
|
|
||||||
fields_line = "&".join("%s" % a["field"] for a in query)
|
|
||||||
key_identifiers = "&".join(x for x in (limit_line, fields_line) if x)
|
|
||||||
key = ":".join(x for x in (method, key_identifiers) if x)
|
|
||||||
return key
|
|
||||||
|
|
||||||
def _get_alarm_dict(self, **kwargs):
|
|
||||||
"""Prepare and return an alarm dict for creating an alarm.
|
|
||||||
|
|
||||||
:param kwargs: optional parameters to create alarm
|
|
||||||
:returns: alarm dictionary used to create an alarm
|
|
||||||
"""
|
|
||||||
alarm_id = self.generate_random_name()
|
|
||||||
alarm = {"alarm_id": alarm_id,
|
|
||||||
"name": alarm_id,
|
|
||||||
"description": "Test Alarm"}
|
|
||||||
|
|
||||||
alarm.update(kwargs)
|
|
||||||
return alarm
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.list_alarms")
|
|
||||||
def _list_alarms(self, alarm_id=None):
|
|
||||||
"""List alarms.
|
|
||||||
|
|
||||||
List alarm matching alarm_id. It fetches all alarms
|
|
||||||
if alarm_id is None.
|
|
||||||
|
|
||||||
:param alarm_id: specifies id of the alarm
|
|
||||||
:returns: list of alarms
|
|
||||||
"""
|
|
||||||
if alarm_id:
|
|
||||||
return self.clients("ceilometer").alarms.get(alarm_id)
|
|
||||||
else:
|
|
||||||
return self.clients("ceilometer").alarms.list()
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.get_alarm")
|
|
||||||
def _get_alarm(self, alarm_id):
|
|
||||||
"""Get detailed information of an alarm.
|
|
||||||
|
|
||||||
:param alarm_id: Specifies id of the alarm
|
|
||||||
:returns: If alarm_id is existed and correct, returns
|
|
||||||
detailed information of an alarm, else returns None
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").alarms.get(alarm_id)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.create_alarm")
|
|
||||||
def _create_alarm(self, meter_name, threshold, kwargs):
|
|
||||||
"""Create an alarm.
|
|
||||||
|
|
||||||
:param meter_name: specifies meter name of the alarm
|
|
||||||
:param threshold: specifies alarm threshold
|
|
||||||
:param kwargs: contains optional features of alarm to be created
|
|
||||||
:returns: alarm
|
|
||||||
"""
|
|
||||||
alarm_dict = self._get_alarm_dict(**kwargs)
|
|
||||||
alarm_dict.update({"meter_name": meter_name,
|
|
||||||
"threshold": threshold})
|
|
||||||
alarm = self.clients("ceilometer").alarms.create(**alarm_dict)
|
|
||||||
return alarm
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.delete_alarm")
|
|
||||||
def _delete_alarm(self, alarm_id):
|
|
||||||
"""Delete an alarm.
|
|
||||||
|
|
||||||
:param alarm_id: specifies id of the alarm
|
|
||||||
"""
|
|
||||||
self.clients("ceilometer").alarms.delete(alarm_id)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.update_alarm")
|
|
||||||
def _update_alarm(self, alarm_id, alarm_dict_delta):
|
|
||||||
"""Update an alarm.
|
|
||||||
|
|
||||||
:param alarm_id: specifies id of the alarm
|
|
||||||
:param alarm_dict_delta: features of alarm to be updated
|
|
||||||
"""
|
|
||||||
self.clients("ceilometer").alarms.update(alarm_id, **alarm_dict_delta)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.get_alarm_history")
|
|
||||||
def _get_alarm_history(self, alarm_id):
|
|
||||||
"""Assemble the alarm history requested.
|
|
||||||
|
|
||||||
:param alarm_id: specifies id of the alarm
|
|
||||||
:returns: list of alarm changes
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").alarms.get_history(alarm_id)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.get_alarm_state")
|
|
||||||
def _get_alarm_state(self, alarm_id):
|
|
||||||
"""Get the state of the alarm.
|
|
||||||
|
|
||||||
:param alarm_id: specifies id of the alarm
|
|
||||||
:returns: state of the alarm
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").alarms.get_state(alarm_id)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.set_alarm_state")
|
|
||||||
def _set_alarm_state(self, alarm, state, timeout):
|
|
||||||
"""Set the state of the alarm.
|
|
||||||
|
|
||||||
:param alarm: alarm instance
|
|
||||||
:param state: an alarm state to be set
|
|
||||||
:param timeout: The number of seconds for which to attempt a
|
|
||||||
successful check of the alarm state.
|
|
||||||
:returns: alarm in the set state
|
|
||||||
"""
|
|
||||||
self.clients("ceilometer").alarms.set_state(alarm.alarm_id, state)
|
|
||||||
return bench_utils.wait_for_status(alarm,
|
|
||||||
ready_statuses=[state],
|
|
||||||
update_resource=bench_utils
|
|
||||||
.get_from_manager(),
|
|
||||||
timeout=timeout, check_interval=1)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.list_events")
|
|
||||||
def _list_events(self):
|
|
||||||
"""Get list of user's events.
|
|
||||||
|
|
||||||
It fetches all events.
|
|
||||||
:returns: list of events
|
|
||||||
"""
|
|
||||||
return self.admin_clients("ceilometer").events.list()
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.get_event")
|
|
||||||
def _get_event(self, event_id):
|
|
||||||
"""Get event with specific id.
|
|
||||||
|
|
||||||
Get event matching event_id.
|
|
||||||
|
|
||||||
:param event_id: specifies id of the event
|
|
||||||
:returns: event
|
|
||||||
"""
|
|
||||||
return self.admin_clients("ceilometer").events.get(event_id)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.list_event_types")
|
|
||||||
def _list_event_types(self):
|
|
||||||
"""Get list of all event types.
|
|
||||||
|
|
||||||
:returns: list of event types
|
|
||||||
"""
|
|
||||||
return self.admin_clients("ceilometer").event_types.list()
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.list_event_traits")
|
|
||||||
def _list_event_traits(self, event_type, trait_name):
|
|
||||||
"""Get list of event traits.
|
|
||||||
|
|
||||||
:param event_type: specifies the type of event
|
|
||||||
:param trait_name: specifies trait name
|
|
||||||
:returns: list of event traits
|
|
||||||
"""
|
|
||||||
return self.admin_clients("ceilometer").traits.list(event_type,
|
|
||||||
trait_name)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.list_event_trait_descriptions")
|
|
||||||
def _list_event_trait_descriptions(self, event_type):
|
|
||||||
"""Get list of event trait descriptions.
|
|
||||||
|
|
||||||
:param event_type: specifies the type of event
|
|
||||||
:returns: list of event trait descriptions
|
|
||||||
"""
|
|
||||||
return self.admin_clients("ceilometer").trait_descriptions.list(
|
|
||||||
event_type)
|
|
||||||
|
|
||||||
def _list_samples(self, query=None, limit=None):
|
|
||||||
"""List all Samples.
|
|
||||||
|
|
||||||
:param query: optional param that specify query
|
|
||||||
:param limit: optional param for maximum number of samples returned
|
|
||||||
:returns: list of samples
|
|
||||||
"""
|
|
||||||
key = self._make_profiler_key("ceilometer.list_samples", query,
|
|
||||||
limit)
|
|
||||||
with atomic.ActionTimer(self, key):
|
|
||||||
return self.clients("ceilometer").new_samples.list(q=query,
|
|
||||||
limit=limit)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.get_resource")
|
|
||||||
def _get_resource(self, resource_id):
|
|
||||||
"""Retrieve details about one resource."""
|
|
||||||
return self.clients("ceilometer").resources.get(resource_id)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.get_stats")
|
|
||||||
def _get_stats(self, meter_name, query=None, period=None, groupby=None,
|
|
||||||
aggregates=None):
|
|
||||||
"""Get stats for a specific meter.
|
|
||||||
|
|
||||||
:param meter_name: Name of ceilometer meter
|
|
||||||
:param query: list of queries
|
|
||||||
:param period: the length of the time range covered by these stats
|
|
||||||
:param groupby: the fields used to group the samples
|
|
||||||
:param aggregates: function for samples aggregation
|
|
||||||
|
|
||||||
:returns: list of statistics data
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").statistics.list(meter_name, q=query,
|
|
||||||
period=period,
|
|
||||||
groupby=groupby,
|
|
||||||
aggregates=aggregates
|
|
||||||
)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.create_meter")
|
|
||||||
def _create_meter(self, **kwargs):
|
|
||||||
"""Create a new meter.
|
|
||||||
|
|
||||||
:param kwargs: Contains the optional attributes for meter creation
|
|
||||||
:returns: Newly created meter
|
|
||||||
"""
|
|
||||||
name = self.generate_random_name()
|
|
||||||
samples = self.clients("ceilometer").samples.create(
|
|
||||||
counter_name=name, **kwargs)
|
|
||||||
return samples[0]
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.query_alarms")
|
|
||||||
def _query_alarms(self, filter, orderby, limit):
|
|
||||||
"""Query alarms with specific parameters.
|
|
||||||
|
|
||||||
If no input params are provided, it returns all the results
|
|
||||||
in the database.
|
|
||||||
|
|
||||||
:param limit: optional param for maximum number of results returned
|
|
||||||
:param orderby: optional param for specifying ordering of results
|
|
||||||
:param filter: optional filter query
|
|
||||||
:returns: queried alarms
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").query_alarms.query(
|
|
||||||
filter, orderby, limit)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.query_alarm_history")
|
|
||||||
def _query_alarm_history(self, filter, orderby, limit):
|
|
||||||
"""Query history of an alarm.
|
|
||||||
|
|
||||||
If no input params are provided, it returns all the results
|
|
||||||
in the database.
|
|
||||||
|
|
||||||
:param limit: optional param for maximum number of results returned
|
|
||||||
:param orderby: optional param for specifying ordering of results
|
|
||||||
:param filter: optional filter query
|
|
||||||
:returns: alarm history
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").query_alarm_history.query(
|
|
||||||
filter, orderby, limit)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.create_sample")
|
|
||||||
def _create_sample(self, counter_name, counter_type, counter_unit,
|
|
||||||
counter_volume, resource_id=None, **kwargs):
|
|
||||||
"""Create a Sample with specified parameters.
|
|
||||||
|
|
||||||
:param counter_name: specifies name of the counter
|
|
||||||
:param counter_type: specifies type of the counter
|
|
||||||
:param counter_unit: specifies unit of the counter
|
|
||||||
:param counter_volume: specifies volume of the counter
|
|
||||||
:param resource_id: specifies resource id for the sample created
|
|
||||||
:param kwargs: contains optional parameters for creating a sample
|
|
||||||
:returns: created sample
|
|
||||||
"""
|
|
||||||
kwargs.update({"counter_name": counter_name,
|
|
||||||
"counter_type": counter_type,
|
|
||||||
"counter_unit": counter_unit,
|
|
||||||
"counter_volume": counter_volume,
|
|
||||||
"resource_id": resource_id if resource_id
|
|
||||||
else self.generate_random_name()})
|
|
||||||
return self.clients("ceilometer").samples.create(**kwargs)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.create_samples")
|
|
||||||
def _create_samples(self, samples):
|
|
||||||
"""Create Samples with specified parameters.
|
|
||||||
|
|
||||||
:param samples: a list of samples to create
|
|
||||||
:returns: created list samples
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").samples.create_list(samples)
|
|
||||||
|
|
||||||
@atomic.action_timer("ceilometer.query_samples")
|
|
||||||
def _query_samples(self, filter, orderby, limit):
|
|
||||||
"""Query samples with specified parameters.
|
|
||||||
|
|
||||||
If no input params are provided, it returns all the results
|
|
||||||
in the database.
|
|
||||||
|
|
||||||
:param limit: optional param for maximum number of results returned
|
|
||||||
:param orderby: optional param for specifying ordering of results
|
|
||||||
:param filter: optional filter query
|
|
||||||
:returns: queried samples
|
|
||||||
"""
|
|
||||||
return self.clients("ceilometer").query_samples.query(
|
|
||||||
filter, orderby, limit)
|
|
||||||
|
|
||||||
def _list_resources(self, query=None, limit=None):
|
|
||||||
"""List all resources.
|
|
||||||
|
|
||||||
:param query: query list for Ceilometer api
|
|
||||||
:param limit: count of returned resources
|
|
||||||
:returns: list of all resources
|
|
||||||
"""
|
|
||||||
|
|
||||||
key = self._make_profiler_key("ceilometer.list_resources", query,
|
|
||||||
limit)
|
|
||||||
with atomic.ActionTimer(self, key):
|
|
||||||
return self.clients("ceilometer").resources.list(q=query,
|
|
||||||
limit=limit)
|
|
||||||
|
|
||||||
def _list_meters(self, query=None, limit=None):
|
|
||||||
"""Get list of user's meters.
|
|
||||||
|
|
||||||
:param query: query list for Ceilometer api
|
|
||||||
:param limit: count of returned meters
|
|
||||||
:returns: list of all meters
|
|
||||||
"""
|
|
||||||
|
|
||||||
key = self._make_profiler_key("ceilometer.list_meters", query,
|
|
||||||
limit)
|
|
||||||
with atomic.ActionTimer(self, key):
|
|
||||||
return self.clients("ceilometer").meters.list(q=query,
|
|
||||||
limit=limit)
|
|
@ -12,7 +12,6 @@ kubernetes # Apache License Version
|
|||||||
os-faults>=0.2.0 # Apache Software License
|
os-faults>=0.2.0 # Apache Software License
|
||||||
osprofiler # Apache Software License
|
osprofiler # Apache Software License
|
||||||
python-barbicanclient # Apache Software License
|
python-barbicanclient # Apache Software License
|
||||||
python-ceilometerclient # Apache Software License
|
|
||||||
python-cinderclient!=4.0.0 # Apache Software License
|
python-cinderclient!=4.0.0 # Apache Software License
|
||||||
python-designateclient # Apache License, Version 2.0
|
python-designateclient # Apache License, Version 2.0
|
||||||
python-heatclient # Apache Software License
|
python-heatclient # Apache Software License
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"Dummy.openstack": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"sleep": 0.1
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 4,
|
|
||||||
"concurrency": 2
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 1,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "instance",
|
|
||||||
"counter_volume": 1.0,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 60,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "fake_resource",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-04T12:34:19.000000"},
|
|
||||||
{"status": "not_active", "name": "fake_resource_1",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-10T06:55:12.000000"}
|
|
||||||
],
|
|
||||||
"batch_size": 5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
Dummy.openstack:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
sleep: 0.1
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 4
|
|
||||||
concurrency: 2
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 1
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "cpu_util"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "instance"
|
|
||||||
counter_volume: 1.0
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 60
|
|
||||||
metadata_list:
|
|
||||||
- status: "active"
|
|
||||||
name: "fake_resource"
|
|
||||||
deleted: "False"
|
|
||||||
created_at: "2015-09-04T12:34:19.000000"
|
|
||||||
- status: "not_active"
|
|
||||||
name: "fake_resource_1"
|
|
||||||
deleted: "False"
|
|
||||||
created_at: "2015-09-10T06:55:12.000000"
|
|
||||||
batch_size: 5
|
|
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerMeters.list_meters": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "rally_meter",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 10,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "rally on",
|
|
||||||
"deleted": "false"},
|
|
||||||
{"status": "terminated", "name": "rally off",
|
|
||||||
"deleted": "true"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": {
|
|
||||||
"limit": 50,
|
|
||||||
"metadata_query": {"status": "terminated"}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerMeters.list_meters:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: constant
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "rally_meter"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "%"
|
|
||||||
counter_volume: 100
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 10
|
|
||||||
metadata_list:
|
|
||||||
-
|
|
||||||
status: "active"
|
|
||||||
name: "rally on"
|
|
||||||
deleted: "false"
|
|
||||||
-
|
|
||||||
status: "terminated"
|
|
||||||
name: "rally off"
|
|
||||||
deleted: "true"
|
|
||||||
args:
|
|
||||||
limit: 50
|
|
||||||
metadata_query:
|
|
||||||
status: "terminated"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerResource.list_resources": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "rally_meter",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 10,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "rally on",
|
|
||||||
"deleted": "false"},
|
|
||||||
{"status": "terminated", "name": "rally off",
|
|
||||||
"deleted": "true"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": {
|
|
||||||
"limit":50,
|
|
||||||
"metadata_query": {"status": "terminated"}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerResource.list_resources:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "rally_meter"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "%"
|
|
||||||
counter_volume: 100
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 10
|
|
||||||
metadata_list:
|
|
||||||
-
|
|
||||||
status: "active"
|
|
||||||
name: "rally on"
|
|
||||||
deleted: "false"
|
|
||||||
-
|
|
||||||
status: "terminated"
|
|
||||||
name: "rally off"
|
|
||||||
deleted: "true"
|
|
||||||
args:
|
|
||||||
limit: 50
|
|
||||||
metadata_query:
|
|
||||||
status: "terminated"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.create_alarm_and_get_history": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"state": "ok",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 5
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.create_alarm_and_get_history:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
state: "ok"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 5
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.create_alarm": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.create_alarm:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.create_and_delete_alarm": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.create_and_delete_alarm:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.create_and_get_alarm": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 2
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.create_and_get_alarm:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 2
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.create_and_list_alarm": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.create_and_list_alarm:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerQueries.create_and_query_alarm_history": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"orderby": null,
|
|
||||||
"limit": null,
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 100,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerQueries.create_and_query_alarm_history:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
orderby: !!null
|
|
||||||
limit: !!null
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 100
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerQueries.create_and_query_alarms": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"filter": {"and": [{"!=": {"state": "dummy_state"}},{"=": {"type": "threshold"}}]},
|
|
||||||
"orderby": null,
|
|
||||||
"limit": 10,
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 100,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerQueries.create_and_query_alarms:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
filter: {"and": [{"!=": {"state": "dummy_state"}},{"=": {"type": "threshold"}}]}
|
|
||||||
orderby: !!null
|
|
||||||
limit: 10
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 100
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerQueries.create_and_query_samples": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"filter": {"=": {"counter_unit": "instance"}},
|
|
||||||
"orderby": null,
|
|
||||||
"limit": 10,
|
|
||||||
"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "instance",
|
|
||||||
"counter_volume": 1.0,
|
|
||||||
"resource_id": "resource_id"
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 100,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerQueries.create_and_query_samples:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
filter: {"=": {"counter_unit": "instance"}}
|
|
||||||
orderby: !!null
|
|
||||||
limit: 10
|
|
||||||
counter_name: "cpu_util"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "instance"
|
|
||||||
counter_volume: 1.0
|
|
||||||
resource_id: "resource_id"
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 100
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.create_and_update_alarm": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"meter_name": "ram_util",
|
|
||||||
"threshold": 10.0,
|
|
||||||
"type": "threshold",
|
|
||||||
"statistic": "avg",
|
|
||||||
"alarm_actions": ["http://localhost:8776/alarm"],
|
|
||||||
"ok_actions": ["http://localhost:8776/ok"],
|
|
||||||
"insufficient_data_actions": ["http://localhost:8776/notok"]
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.create_and_update_alarm:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
meter_name: "ram_util"
|
|
||||||
threshold: 10.0
|
|
||||||
type: "threshold"
|
|
||||||
statistic: "avg"
|
|
||||||
alarm_actions: ["http://localhost:8776/alarm"]
|
|
||||||
ok_actions: ["http://localhost:8776/ok"]
|
|
||||||
insufficient_data_actions: ["http://localhost:8776/notok"]
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerStats.create_meter_and_get_stats": [
|
|
||||||
{
|
|
||||||
"args": {
|
|
||||||
"user_id": "user-id",
|
|
||||||
"resource_id": "resource-id",
|
|
||||||
"counter_volume": 1.0,
|
|
||||||
"counter_unit": "",
|
|
||||||
"counter_type": "cumulative"
|
|
||||||
},
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 200,
|
|
||||||
"concurrency": 5
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerStats.create_meter_and_get_stats:
|
|
||||||
-
|
|
||||||
args:
|
|
||||||
user_id: "user-id"
|
|
||||||
resource_id: "resource-id"
|
|
||||||
counter_volume: 1.0
|
|
||||||
counter_unit: ""
|
|
||||||
counter_type: "cumulative"
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 200
|
|
||||||
concurrency: 5
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerEvents.create_user_and_get_event": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerEvents.create_user_and_get_event:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerEvents.create_user_and_list_event_types": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerEvents.create_user_and_list_event_types:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerEvents.create_user_and_list_events": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerEvents.create_user_and_list_events:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerTraits.create_user_and_list_trait_descriptions": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerTraits.create_user_and_list_trait_descriptions:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerTraits.create_user_and_list_traits": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 10
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerTraits.create_user_and_list_traits:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 10
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerStats.get_stats": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "rally_meter",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 10,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "rally on",
|
|
||||||
"deleted": "false"},
|
|
||||||
{"status": "terminated", "name": "rally off",
|
|
||||||
"deleted": "true"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": {
|
|
||||||
"meter_name": "rally_meter",
|
|
||||||
"filter_by_user_id": true,
|
|
||||||
"filter_by_project_id": true,
|
|
||||||
"filter_by_resource_id": true,
|
|
||||||
"metadata_query": {"status": "terminated"},
|
|
||||||
"period": 300,
|
|
||||||
"groupby": "resource_id"
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerStats.get_stats:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: constant
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "rally_meter"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "%"
|
|
||||||
counter_volume: 100
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 10
|
|
||||||
metadata_list:
|
|
||||||
-
|
|
||||||
status: "active"
|
|
||||||
name: "rally on"
|
|
||||||
deleted: "false"
|
|
||||||
-
|
|
||||||
status: "terminated"
|
|
||||||
name: "rally off"
|
|
||||||
deleted: "true"
|
|
||||||
args:
|
|
||||||
meter_name: "rally_meter"
|
|
||||||
filter_by_user_id: true
|
|
||||||
filter_by_project_id: true
|
|
||||||
filter_by_resource_id: true
|
|
||||||
metadata_query:
|
|
||||||
status: "terminated"
|
|
||||||
period: 300
|
|
||||||
groupby: "resource_id"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerResource.get_tenant_resources": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 5
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "instance",
|
|
||||||
"counter_volume": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerResource.get_tenant_resources:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 5
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "cpu_util"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_volume: 1.0
|
|
||||||
counter_unit: "instance"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerAlarms.list_alarms": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerAlarms.list_alarms:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerSamples.list_matched_samples": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 2
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "instance",
|
|
||||||
"counter_volume": 1.0,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 60,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "fake_resource",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-04T12:34:19.000000"},
|
|
||||||
{"status": "not_active", "name": "fake_resource_1",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-10T06:55:12.000000"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args":{
|
|
||||||
"filter_by_user_id": true,
|
|
||||||
"filter_by_project_id": true,
|
|
||||||
"filter_by_resource_id": true,
|
|
||||||
"limit": 50,
|
|
||||||
"metadata_query": {"status": "not_active"}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerSamples.list_matched_samples:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 2
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "cpu_util"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "instance"
|
|
||||||
counter_volume: 1.0
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 60
|
|
||||||
metadata_list:
|
|
||||||
- status: "active"
|
|
||||||
name: "fake_resource"
|
|
||||||
deleted: "False"
|
|
||||||
created_at: "2015-09-04T12:34:19.000000"
|
|
||||||
- status: "not_active"
|
|
||||||
name: "fake_resource_1"
|
|
||||||
deleted: "False"
|
|
||||||
created_at: "2015-09-10T06:55:12.000000"
|
|
||||||
args:
|
|
||||||
limit: 50
|
|
||||||
filter_by_user_id: true
|
|
||||||
filter_by_project_id: true
|
|
||||||
filter_by_resource_id: true
|
|
||||||
metadata_query:
|
|
||||||
status: "not_active"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerMeters.list_matched_meters": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "rally_meter",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 10,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "rally on",
|
|
||||||
"deleted": "false"},
|
|
||||||
{"status": "terminated", "name": "rally off",
|
|
||||||
"deleted": "true"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": {
|
|
||||||
"filter_by_user_id": true,
|
|
||||||
"filter_by_project_id": true,
|
|
||||||
"filter_by_resource_id": true,
|
|
||||||
"limit": 50,
|
|
||||||
"metadata_query": {"status": "terminated"}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerMeters.list_matched_meters:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: constant
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "rally_meter"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "%"
|
|
||||||
counter_volume: 100
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 10
|
|
||||||
metadata_list:
|
|
||||||
-
|
|
||||||
status: "active"
|
|
||||||
name: "rally on"
|
|
||||||
deleted: "false"
|
|
||||||
-
|
|
||||||
status: "terminated"
|
|
||||||
name: "rally off"
|
|
||||||
deleted: "true"
|
|
||||||
args:
|
|
||||||
limit: 50
|
|
||||||
filter_by_user_id: true
|
|
||||||
filter_by_project_id: true
|
|
||||||
filter_by_resource_id: true
|
|
||||||
metadata_query:
|
|
||||||
status: "terminated"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerResource.list_matched_resources": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 1
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "rally_meter",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 10,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "rally on",
|
|
||||||
"deleted": "false"},
|
|
||||||
{"status": "terminated", "name": "rally off",
|
|
||||||
"deleted": "true"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": {
|
|
||||||
"limit":50,
|
|
||||||
"metadata_query": {"status": "terminated"},
|
|
||||||
"filter_by_user_id": true,
|
|
||||||
"filter_by_project_id": true
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerResource.list_matched_resources:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 1
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "rally_meter"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "%"
|
|
||||||
counter_volume: 100
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 10
|
|
||||||
metadata_list:
|
|
||||||
-
|
|
||||||
status: "active"
|
|
||||||
name: "rally on"
|
|
||||||
deleted: "false"
|
|
||||||
-
|
|
||||||
status: "terminated"
|
|
||||||
name: "rally off"
|
|
||||||
deleted: "true"
|
|
||||||
args:
|
|
||||||
limit: 50
|
|
||||||
filter_by_user_id: true
|
|
||||||
filter_by_project_id: true
|
|
||||||
metadata_query:
|
|
||||||
status: "terminated"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"CeilometerSamples.list_samples": [
|
|
||||||
{
|
|
||||||
"runner": {
|
|
||||||
"type": "constant",
|
|
||||||
"times": 10,
|
|
||||||
"concurrency": 2
|
|
||||||
},
|
|
||||||
"context": {
|
|
||||||
"users": {
|
|
||||||
"tenants": 2,
|
|
||||||
"users_per_tenant": 2
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "instance",
|
|
||||||
"counter_volume": 1.0,
|
|
||||||
"resources_per_tenant": 100,
|
|
||||||
"samples_per_resource": 100,
|
|
||||||
"timestamp_interval": 60,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "fake_resource",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-04T12:34:19.000000"},
|
|
||||||
{"status": "not_active", "name": "fake_resource_1",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-10T06:55:12.000000"}
|
|
||||||
],
|
|
||||||
"batch_size": 5
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args":{
|
|
||||||
"limit": 50,
|
|
||||||
"metadata_query": {"status": "not_active"}
|
|
||||||
},
|
|
||||||
"sla": {
|
|
||||||
"failure_rate": {
|
|
||||||
"max": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
CeilometerSamples.list_samples:
|
|
||||||
-
|
|
||||||
runner:
|
|
||||||
type: "constant"
|
|
||||||
times: 10
|
|
||||||
concurrency: 2
|
|
||||||
context:
|
|
||||||
users:
|
|
||||||
tenants: 2
|
|
||||||
users_per_tenant: 2
|
|
||||||
ceilometer:
|
|
||||||
counter_name: "cpu_util"
|
|
||||||
counter_type: "gauge"
|
|
||||||
counter_unit: "instance"
|
|
||||||
counter_volume: 1.0
|
|
||||||
resources_per_tenant: 100
|
|
||||||
samples_per_resource: 100
|
|
||||||
timestamp_interval: 60
|
|
||||||
metadata_list:
|
|
||||||
- status: "active"
|
|
||||||
name: "fake_resource"
|
|
||||||
deleted: "False"
|
|
||||||
created_at: "2015-09-04T12:34:19.000000"
|
|
||||||
- status: "not_active"
|
|
||||||
name: "fake_resource_1"
|
|
||||||
deleted: "False"
|
|
||||||
created_at: "2015-09-10T06:55:12.000000"
|
|
||||||
batch_size: 5
|
|
||||||
args:
|
|
||||||
limit: 50
|
|
||||||
metadata_query:
|
|
||||||
status: "not_active"
|
|
||||||
sla:
|
|
||||||
failure_rate:
|
|
||||||
max: 0
|
|
@ -71,9 +71,10 @@ class Rally(object):
|
|||||||
|
|
||||||
def __init__(self, force_new_db=False, plugin_path=None, config_opts=None):
|
def __init__(self, force_new_db=False, plugin_path=None, config_opts=None):
|
||||||
if not os.path.exists(self.ENV_FILE):
|
if not os.path.exists(self.ENV_FILE):
|
||||||
|
with open(self.ENV_FILE, "w") as f:
|
||||||
subprocess.call(["rally", "--log-file", "/dev/null",
|
subprocess.call(["rally", "--log-file", "/dev/null",
|
||||||
"env", "show", "--only-spec"],
|
"env", "show", "--only-spec"],
|
||||||
stdout=open(self.ENV_FILE, "w"))
|
stdout=f)
|
||||||
with open(self.ENV_FILE) as f:
|
with open(self.ENV_FILE) as f:
|
||||||
self.env_spec = json.loads(f.read())
|
self.env_spec = json.loads(f.read())
|
||||||
print(self.env_spec)
|
print(self.env_spec)
|
||||||
|
@ -676,29 +676,6 @@ class OSClientsTestCase(test.TestCase):
|
|||||||
self.assertRaises(exceptions.RallyException,
|
self.assertRaises(exceptions.RallyException,
|
||||||
osclients.Manila.validate_version, "foo")
|
osclients.Manila.validate_version, "foo")
|
||||||
|
|
||||||
@mock.patch("%s.Ceilometer._get_endpoint" % PATH)
|
|
||||||
def test_ceilometer(self, mock_ceilometer__get_endpoint):
|
|
||||||
fake_ceilometer = fakes.FakeCeilometerClient()
|
|
||||||
mock_ceilometer = mock.MagicMock()
|
|
||||||
mock_ceilometer__get_endpoint.return_value = "http://fake.to:2/fake"
|
|
||||||
mock_keystoneauth1 = mock.MagicMock()
|
|
||||||
mock_ceilometer.client.get_client = mock.MagicMock(
|
|
||||||
return_value=fake_ceilometer)
|
|
||||||
self.assertNotIn("ceilometer", self.clients.cache)
|
|
||||||
with mock.patch.dict("sys.modules",
|
|
||||||
{"ceilometerclient": mock_ceilometer,
|
|
||||||
"keystoneauth1": mock_keystoneauth1}):
|
|
||||||
client = self.clients.ceilometer()
|
|
||||||
self.assertEqual(fake_ceilometer, client)
|
|
||||||
kw = {
|
|
||||||
"session": mock_keystoneauth1.session.Session(),
|
|
||||||
"endpoint_override": mock_ceilometer__get_endpoint.return_value
|
|
||||||
}
|
|
||||||
mock_ceilometer.client.get_client.assert_called_once_with("2",
|
|
||||||
**kw)
|
|
||||||
self.assertEqual(fake_ceilometer,
|
|
||||||
self.clients.cache["ceilometer"])
|
|
||||||
|
|
||||||
def test_gnocchi(self):
|
def test_gnocchi(self):
|
||||||
fake_gnocchi = fakes.FakeGnocchiClient()
|
fake_gnocchi = fakes.FakeGnocchiClient()
|
||||||
mock_gnocchi = mock.MagicMock()
|
mock_gnocchi = mock.MagicMock()
|
||||||
|
@ -21,7 +21,6 @@ import string
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from ceilometerclient import exc as ceilometer_exc
|
|
||||||
from glanceclient import exc
|
from glanceclient import exc
|
||||||
from neutronclient.common import exceptions as neutron_exceptions
|
from neutronclient.common import exceptions as neutron_exceptions
|
||||||
from novaclient import exceptions as nova_exceptions
|
from novaclient import exceptions as nova_exceptions
|
||||||
@ -810,89 +809,12 @@ class FakeMetricManager(FakeManager):
|
|||||||
return [metric]
|
return [metric]
|
||||||
|
|
||||||
|
|
||||||
class FakeAlarmManager(FakeManager):
|
|
||||||
|
|
||||||
def get(self, alarm_id):
|
|
||||||
alarm = self.find(alarm_id=alarm_id)
|
|
||||||
if alarm:
|
|
||||||
return [alarm]
|
|
||||||
raise ceilometer_exc.HTTPNotFound(
|
|
||||||
"Alarm with %s not found" % (alarm_id))
|
|
||||||
|
|
||||||
def update(self, alarm_id, **fake_alarm_dict_diff):
|
|
||||||
alarm = self.get(alarm_id)[0]
|
|
||||||
for attr, value in fake_alarm_dict_diff.items():
|
|
||||||
setattr(alarm, attr, value)
|
|
||||||
return alarm
|
|
||||||
|
|
||||||
def create(self, **kwargs):
|
|
||||||
alarm = FakeAlarm(self, **kwargs)
|
|
||||||
return self._cache(alarm)
|
|
||||||
|
|
||||||
def delete(self, alarm_id):
|
|
||||||
alarm = self.find(alarm_id=alarm_id)
|
|
||||||
if alarm is not None:
|
|
||||||
alarm.status = "DELETED"
|
|
||||||
del self.cache[alarm.id]
|
|
||||||
self.resources_order.remove(alarm.id)
|
|
||||||
|
|
||||||
def get_state(self, alarm_id):
|
|
||||||
alarm = self.find(alarm_id=alarm_id)
|
|
||||||
if alarm is not None:
|
|
||||||
return getattr(alarm, "state", "fake-alarm-state")
|
|
||||||
|
|
||||||
def get_history(self, alarm_id):
|
|
||||||
return ["fake-alarm-history"]
|
|
||||||
|
|
||||||
def set_state(self, alarm_id, state):
|
|
||||||
alarm = self.find(alarm_id=alarm_id)
|
|
||||||
if alarm is not None:
|
|
||||||
return setattr(alarm, "state", state)
|
|
||||||
|
|
||||||
|
|
||||||
class FakeSampleManager(FakeManager):
|
|
||||||
|
|
||||||
def create(self, **kwargs):
|
|
||||||
sample = FakeSample(self, **kwargs)
|
|
||||||
return [self._cache(sample)]
|
|
||||||
|
|
||||||
def list(self):
|
|
||||||
return ["fake-samples"]
|
|
||||||
|
|
||||||
|
|
||||||
class FakeMeterManager(FakeManager):
|
|
||||||
|
|
||||||
def list(self):
|
|
||||||
return ["fake-meter"]
|
|
||||||
|
|
||||||
|
|
||||||
class FakeMetricsManager(FakeManager):
|
class FakeMetricsManager(FakeManager):
|
||||||
|
|
||||||
def list(self):
|
def list(self):
|
||||||
return ["fake-metric"]
|
return ["fake-metric"]
|
||||||
|
|
||||||
|
|
||||||
class FakeCeilometerResourceManager(FakeManager):
|
|
||||||
|
|
||||||
def get(self, resource_id):
|
|
||||||
return ["fake-resource-info"]
|
|
||||||
|
|
||||||
def list(self):
|
|
||||||
return ["fake-resource"]
|
|
||||||
|
|
||||||
|
|
||||||
class FakeStatisticsManager(FakeManager):
|
|
||||||
|
|
||||||
def list(self, meter):
|
|
||||||
return ["%s-statistics" % meter]
|
|
||||||
|
|
||||||
|
|
||||||
class FakeQueryManager(FakeManager):
|
|
||||||
|
|
||||||
def query(self, filter, orderby, limit):
|
|
||||||
return ["fake-query-result"]
|
|
||||||
|
|
||||||
|
|
||||||
class FakeQueuesManager(FakeManager):
|
class FakeQueuesManager(FakeManager):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(FakeQueuesManager, self).__init__()
|
super(FakeQueuesManager, self).__init__()
|
||||||
@ -1141,19 +1063,6 @@ class FakeKeystoneClient(object):
|
|||||||
return self.users.delete(uuid)
|
return self.users.delete(uuid)
|
||||||
|
|
||||||
|
|
||||||
class FakeCeilometerClient(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.alarms = FakeAlarmManager()
|
|
||||||
self.meters = FakeMeterManager()
|
|
||||||
self.resources = FakeCeilometerResourceManager()
|
|
||||||
self.statistics = FakeStatisticsManager()
|
|
||||||
self.samples = FakeSampleManager()
|
|
||||||
self.query_alarms = FakeQueryManager()
|
|
||||||
self.query_samples = FakeQueryManager()
|
|
||||||
self.query_alarm_history = FakeQueryManager()
|
|
||||||
|
|
||||||
|
|
||||||
class FakeGnocchiClient(object):
|
class FakeGnocchiClient(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.metric = FakeMetricManager()
|
self.metric = FakeMetricManager()
|
||||||
@ -1620,7 +1529,6 @@ class FakeClients(object):
|
|||||||
self._sahara = None
|
self._sahara = None
|
||||||
self._heat = None
|
self._heat = None
|
||||||
self._designate = None
|
self._designate = None
|
||||||
self._ceilometer = None
|
|
||||||
self._zaqar = None
|
self._zaqar = None
|
||||||
self._trove = None
|
self._trove = None
|
||||||
self._mistral = None
|
self._mistral = None
|
||||||
@ -1685,11 +1593,6 @@ class FakeClients(object):
|
|||||||
self._designate = FakeDesignateClient()
|
self._designate = FakeDesignateClient()
|
||||||
return self._designate
|
return self._designate
|
||||||
|
|
||||||
def ceilometer(self):
|
|
||||||
if not self._ceilometer:
|
|
||||||
self._ceilometer = FakeCeilometerClient()
|
|
||||||
return self._ceilometer
|
|
||||||
|
|
||||||
def monasca(self):
|
def monasca(self):
|
||||||
if not self._monasca:
|
if not self._monasca:
|
||||||
self._monasca = FakeMonascaClient()
|
self._monasca = FakeMonascaClient()
|
||||||
|
@ -1,177 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
import copy
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
|
||||||
from rally_openstack.task.contexts.ceilometer import samples
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils as ceilo_utils
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
CTX = "rally_openstack.task.contexts.ceilometer"
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerSampleGeneratorTestCase(test.TestCase):
|
|
||||||
|
|
||||||
def _gen_tenants(self, count):
|
|
||||||
tenants = {}
|
|
||||||
for id_ in range(count):
|
|
||||||
tenants[str(id_)] = {"name": str(id_)}
|
|
||||||
return tenants
|
|
||||||
|
|
||||||
def _gen_context(self, tenants_count, users_per_tenant,
|
|
||||||
resources_per_tenant, samples_per_resource):
|
|
||||||
tenants = self._gen_tenants(tenants_count)
|
|
||||||
users = []
|
|
||||||
for id_ in tenants.keys():
|
|
||||||
for i in range(users_per_tenant):
|
|
||||||
users.append({"id": i, "tenant_id": id_,
|
|
||||||
"credential": mock.MagicMock()})
|
|
||||||
context = test.get_test_context()
|
|
||||||
context.update({
|
|
||||||
"config": {
|
|
||||||
"users": {
|
|
||||||
"tenants": tenants_count,
|
|
||||||
"users_per_tenant": users_per_tenant,
|
|
||||||
"concurrent": 10,
|
|
||||||
},
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "fake-counter-name",
|
|
||||||
"counter_type": "fake-counter-type",
|
|
||||||
"counter_unit": "fake-counter-unit",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"resources_per_tenant": resources_per_tenant,
|
|
||||||
"samples_per_resource": samples_per_resource,
|
|
||||||
"timestamp_interval": 60,
|
|
||||||
"metadata_list": (
|
|
||||||
{"status": "active", "name": "fake_resource",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-04T12:34:19.000000"},
|
|
||||||
{"status": "not_active", "name": "fake_resource_1",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-10T06:55:12.000000"},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"admin": {
|
|
||||||
"credential": mock.MagicMock()
|
|
||||||
},
|
|
||||||
"users": users,
|
|
||||||
"tenants": tenants,
|
|
||||||
"user_choice_method": "random",
|
|
||||||
})
|
|
||||||
return tenants, context
|
|
||||||
|
|
||||||
def test_init(self):
|
|
||||||
context = {}
|
|
||||||
context["task"] = mock.MagicMock()
|
|
||||||
context["config"] = {
|
|
||||||
"ceilometer": {
|
|
||||||
"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "instance",
|
|
||||||
"counter_volume": 1.0,
|
|
||||||
"resources_per_tenant": 5,
|
|
||||||
"samples_per_resource": 5,
|
|
||||||
"timestamp_interval": 60,
|
|
||||||
"metadata_list": (
|
|
||||||
{"status": "active", "name": "fake_resource",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-04T12:34:19.000000"},
|
|
||||||
{"status": "not_active", "name": "fake_resource_1",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-10T06:55:12.000000"},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inst = samples.CeilometerSampleGenerator(context)
|
|
||||||
self.assertEqual(inst.config, context["config"]["ceilometer"])
|
|
||||||
|
|
||||||
def test__store_batch_samples(self):
|
|
||||||
tenants_count = 2
|
|
||||||
users_per_tenant = 2
|
|
||||||
resources_per_tenant = 2
|
|
||||||
samples_per_resource = 2
|
|
||||||
|
|
||||||
tenants, real_context = self._gen_context(
|
|
||||||
tenants_count, users_per_tenant,
|
|
||||||
resources_per_tenant, samples_per_resource)
|
|
||||||
ceilometer_ctx = samples.CeilometerSampleGenerator(real_context)
|
|
||||||
scenario = ceilo_utils.CeilometerScenario(real_context)
|
|
||||||
self.assertRaises(
|
|
||||||
exceptions.ContextSetupFailure,
|
|
||||||
ceilometer_ctx._store_batch_samples,
|
|
||||||
scenario, ["foo", "bar"], 1)
|
|
||||||
|
|
||||||
@mock.patch("%s.samples.ceilo_utils.CeilometerScenario._get_resource"
|
|
||||||
% CTX)
|
|
||||||
@mock.patch("%s.samples.ceilo_utils.CeilometerScenario._create_samples"
|
|
||||||
% CTX)
|
|
||||||
@mock.patch(
|
|
||||||
"rally_openstack.task.scenarios.ceilometer.utils.uuid")
|
|
||||||
def test_setup(self, mock_uuid, mock_create_samples, mock_get_resource):
|
|
||||||
mock_uuid.uuid4.return_value = "fake_resource-id"
|
|
||||||
tenants_count = 2
|
|
||||||
users_per_tenant = 2
|
|
||||||
resources_per_tenant = 2
|
|
||||||
samples_per_resource = 2
|
|
||||||
|
|
||||||
tenants, real_context = self._gen_context(
|
|
||||||
tenants_count, users_per_tenant,
|
|
||||||
resources_per_tenant, samples_per_resource)
|
|
||||||
scenario = ceilo_utils.CeilometerScenario(real_context)
|
|
||||||
sample = {
|
|
||||||
"counter_name": "fake-counter-name",
|
|
||||||
"counter_type": "fake-counter-type",
|
|
||||||
"counter_unit": "fake-counter-unit",
|
|
||||||
"counter_volume": 100,
|
|
||||||
"metadata_list": [
|
|
||||||
{"status": "active", "name": "fake_resource",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-04T12:34:19.000000"},
|
|
||||||
{"status": "not_active", "name": "fake_resource_1",
|
|
||||||
"deleted": "False",
|
|
||||||
"created_at": "2015-09-10T06:55:12.000000"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
kwargs = copy.deepcopy(sample)
|
|
||||||
samples_to_create = list(
|
|
||||||
scenario._make_samples(count=samples_per_resource, interval=60,
|
|
||||||
**kwargs)
|
|
||||||
)[0]
|
|
||||||
new_context = copy.deepcopy(real_context)
|
|
||||||
for id_ in tenants.keys():
|
|
||||||
new_context["tenants"][id_].setdefault("samples", [])
|
|
||||||
new_context["tenants"][id_].setdefault("resources", [])
|
|
||||||
for _ in range(resources_per_tenant):
|
|
||||||
for sample in samples_to_create:
|
|
||||||
new_context["tenants"][id_]["samples"].append(sample)
|
|
||||||
new_context["tenants"][id_]["resources"].append(
|
|
||||||
sample["resource_id"])
|
|
||||||
|
|
||||||
mock_create_samples.return_value = []
|
|
||||||
for i, sample in enumerate(samples_to_create):
|
|
||||||
sample_object = mock.MagicMock(resource_id="fake_resource-id")
|
|
||||||
sample_object.to_dict.return_value = sample
|
|
||||||
mock_create_samples.return_value.append(sample_object)
|
|
||||||
ceilometer_ctx = samples.CeilometerSampleGenerator(real_context)
|
|
||||||
ceilometer_ctx.setup()
|
|
||||||
self.assertEqual(new_context, ceilometer_ctx.context)
|
|
||||||
|
|
||||||
def test_cleanup(self):
|
|
||||||
tenants, context = self._gen_context(2, 5, 3, 3)
|
|
||||||
ceilometer_ctx = samples.CeilometerSampleGenerator(context)
|
|
||||||
ceilometer_ctx.cleanup()
|
|
@ -1,102 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import alarms
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerAlarmsTestCase(test.ScenarioTestCase):
|
|
||||||
def test_create_alarm(self):
|
|
||||||
scenario = alarms.CreateAlarm(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock()
|
|
||||||
scenario.run("fake_meter_name", "fake_threshold", fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
"fake_threshold",
|
|
||||||
{"fakearg": "f"})
|
|
||||||
|
|
||||||
def test_list_alarm(self):
|
|
||||||
scenario = alarms.ListAlarms(self.context)
|
|
||||||
|
|
||||||
scenario._list_alarms = mock.MagicMock()
|
|
||||||
scenario.run()
|
|
||||||
scenario._list_alarms.assert_called_once_with()
|
|
||||||
|
|
||||||
def test_create_and_list_alarm(self):
|
|
||||||
fake_alarm = mock.MagicMock()
|
|
||||||
scenario = alarms.CreateAndListAlarm(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
|
||||||
scenario._list_alarms = mock.MagicMock()
|
|
||||||
scenario.run("fake_meter_name", "fake_threshold", fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
"fake_threshold",
|
|
||||||
{"fakearg": "f"})
|
|
||||||
scenario._list_alarms.assert_called_once_with(fake_alarm.alarm_id)
|
|
||||||
|
|
||||||
def test_create_and_get_alarm(self):
|
|
||||||
fake_alarm = mock.MagicMock()
|
|
||||||
scenario = alarms.CreateAndGetAlarm(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
|
||||||
scenario._get_alarm = mock.MagicMock()
|
|
||||||
scenario.run("fake_meter_name", "fake_threshold", fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
"fake_threshold",
|
|
||||||
{"fakearg": "f"})
|
|
||||||
scenario._get_alarm.assert_called_once_with(fake_alarm.alarm_id)
|
|
||||||
|
|
||||||
def test_create_and_update_alarm(self):
|
|
||||||
fake_alram_dict_diff = {"description": "Changed Test Description"}
|
|
||||||
fake_alarm = mock.MagicMock()
|
|
||||||
scenario = alarms.CreateAndUpdateAlarm(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
|
||||||
scenario._update_alarm = mock.MagicMock()
|
|
||||||
scenario.run("fake_meter_name", "fake_threshold", fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
"fake_threshold",
|
|
||||||
{"fakearg": "f"})
|
|
||||||
scenario._update_alarm.assert_called_once_with(fake_alarm.alarm_id,
|
|
||||||
fake_alram_dict_diff)
|
|
||||||
|
|
||||||
def test_create_and_delete_alarm(self):
|
|
||||||
fake_alarm = mock.MagicMock()
|
|
||||||
scenario = alarms.CreateAndDeleteAlarm(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
|
||||||
scenario._delete_alarm = mock.MagicMock()
|
|
||||||
scenario.run("fake_meter_name", "fake_threshold", fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
"fake_threshold",
|
|
||||||
{"fakearg": "f"})
|
|
||||||
scenario._delete_alarm.assert_called_once_with(fake_alarm.alarm_id)
|
|
||||||
|
|
||||||
def test_create_and_get_alarm_history(self):
|
|
||||||
alarm = mock.Mock(alarm_id="foo_id")
|
|
||||||
scenario = alarms.CreateAlarmAndGetHistory(
|
|
||||||
self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=alarm)
|
|
||||||
scenario._get_alarm_state = mock.MagicMock()
|
|
||||||
scenario._get_alarm_history = mock.MagicMock()
|
|
||||||
scenario._set_alarm_state = mock.MagicMock()
|
|
||||||
scenario.run("meter_name", "threshold", "state", 60, fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with(
|
|
||||||
"meter_name", "threshold", {"fakearg": "f"})
|
|
||||||
scenario._get_alarm_state.assert_called_once_with("foo_id")
|
|
||||||
scenario._get_alarm_history.assert_called_once_with("foo_id")
|
|
||||||
scenario._set_alarm_state.assert_called_once_with(alarm, "state", 60)
|
|
@ -1,103 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import events
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerEventsTestCase(test.ScenarioTestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(CeilometerEventsTestCase, self).setUp()
|
|
||||||
patch = mock.patch(
|
|
||||||
"rally_openstack.common.services.identity.identity.Identity")
|
|
||||||
self.addCleanup(patch.stop)
|
|
||||||
self.mock_identity = patch.start()
|
|
||||||
|
|
||||||
def get_test_context(self):
|
|
||||||
context = super(CeilometerEventsTestCase, self).get_test_context()
|
|
||||||
context["admin"] = {"id": "fake_user_id",
|
|
||||||
"credential": mock.MagicMock()
|
|
||||||
}
|
|
||||||
return context
|
|
||||||
|
|
||||||
def test_list_events(self):
|
|
||||||
scenario = events.CeilometerEventsCreateUserAndListEvents(self.context)
|
|
||||||
|
|
||||||
scenario._list_events = mock.MagicMock()
|
|
||||||
|
|
||||||
scenario.run()
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_events.assert_called_once_with()
|
|
||||||
|
|
||||||
def test_list_events_fails(self):
|
|
||||||
scenario = events.CeilometerEventsCreateUserAndListEvents(self.context)
|
|
||||||
|
|
||||||
scenario._list_events = mock.MagicMock(return_value=[])
|
|
||||||
|
|
||||||
self.assertRaises(exceptions.RallyException, scenario.run)
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_events.assert_called_once_with()
|
|
||||||
|
|
||||||
def test_list_event_types(self):
|
|
||||||
scenario = events.CeilometerEventsCreateUserAndListEventTypes(
|
|
||||||
self.context)
|
|
||||||
|
|
||||||
scenario._list_event_types = mock.MagicMock()
|
|
||||||
|
|
||||||
scenario.run()
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_event_types.assert_called_once_with()
|
|
||||||
|
|
||||||
def test_list_event_types_fails(self):
|
|
||||||
scenario = events.CeilometerEventsCreateUserAndListEventTypes(
|
|
||||||
self.context)
|
|
||||||
|
|
||||||
scenario._list_event_types = mock.MagicMock(return_value=[])
|
|
||||||
|
|
||||||
self.assertRaises(exceptions.RallyException, scenario.run)
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_event_types.assert_called_once_with()
|
|
||||||
|
|
||||||
def test_get_event(self):
|
|
||||||
scenario = events.CeilometerEventsCreateUserAndGetEvent(self.context)
|
|
||||||
|
|
||||||
scenario._get_event = mock.MagicMock()
|
|
||||||
scenario._list_events = mock.MagicMock(
|
|
||||||
return_value=[mock.Mock(message_id="fake_id")])
|
|
||||||
|
|
||||||
scenario.run()
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_events.assert_called_with()
|
|
||||||
scenario._get_event.assert_called_with(event_id="fake_id")
|
|
||||||
|
|
||||||
def test_get_event_fails(self):
|
|
||||||
scenario = events.CeilometerEventsCreateUserAndGetEvent(self.context)
|
|
||||||
|
|
||||||
scenario._list_events = mock.MagicMock(return_value=[])
|
|
||||||
scenario._get_event = mock.MagicMock()
|
|
||||||
|
|
||||||
self.assertRaises(exceptions.RallyException, scenario.run)
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_events.assert_called_with()
|
|
||||||
self.assertFalse(scenario._get_event.called)
|
|
@ -1,75 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import meters
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
BASE = "rally_openstack.task.scenarios.ceilometer"
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerMetersTestCase(test.ScenarioTestCase):
|
|
||||||
@mock.patch("%s.meters.ListMatchedMeters.run" % BASE)
|
|
||||||
def test_all_meter_list_queries(
|
|
||||||
self, mock_list_matched_meters_run):
|
|
||||||
scenario = meters.ListMeters(self.context)
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
limit = 100
|
|
||||||
|
|
||||||
scenario.run(metadata_query, limit)
|
|
||||||
|
|
||||||
mock_list_matched_meters_run.assert_any_call(limit=100)
|
|
||||||
mock_list_matched_meters_run.assert_any_call(
|
|
||||||
metadata_query=metadata_query)
|
|
||||||
mock_list_matched_meters_run.assert_any_call(filter_by_user_id=True)
|
|
||||||
mock_list_matched_meters_run.assert_any_call(filter_by_project_id=True)
|
|
||||||
mock_list_matched_meters_run.assert_any_call(
|
|
||||||
filter_by_resource_id=True)
|
|
||||||
|
|
||||||
@mock.patch("%s.meters.ListMatchedMeters.run" % BASE)
|
|
||||||
def test_meter_list_queries_without_limit_and_metadata(
|
|
||||||
self, mock_list_matched_meters_run):
|
|
||||||
|
|
||||||
scenario = meters.ListMeters(self.context)
|
|
||||||
scenario.run()
|
|
||||||
expected_call_args_list = [
|
|
||||||
mock.call(filter_by_project_id=True),
|
|
||||||
mock.call(filter_by_user_id=True),
|
|
||||||
mock.call(filter_by_resource_id=True)
|
|
||||||
]
|
|
||||||
self.assertSequenceEqual(
|
|
||||||
expected_call_args_list,
|
|
||||||
mock_list_matched_meters_run.call_args_list)
|
|
||||||
|
|
||||||
@mock.patch("%s.meters.ListMatchedMeters._list_meters" % BASE)
|
|
||||||
def test_list_matched_meters(
|
|
||||||
self, mock_list_matched_meters__list_meters):
|
|
||||||
mock_func = mock_list_matched_meters__list_meters
|
|
||||||
scenario = meters.ListMatchedMeters(self.context)
|
|
||||||
context = {"user": {"tenant_id": "fake", "id": "fake_id"},
|
|
||||||
"tenant": {"id": "fake_id",
|
|
||||||
"resources": ["fake_resource"]}}
|
|
||||||
scenario.context = context
|
|
||||||
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
limit = 100
|
|
||||||
scenario.run(True, True, True, metadata_query, limit)
|
|
||||||
mock_func.assert_called_once_with(
|
|
||||||
[{"field": "user_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "project_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "resource_id", "value": "fake_resource", "op": "eq"},
|
|
||||||
{"field": "metadata.a", "value": "test", "op": "eq"}],
|
|
||||||
100)
|
|
@ -1,102 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
import json
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import queries
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerQueriesTestCase(test.ScenarioTestCase):
|
|
||||||
def test_create_and_query_alarms(self):
|
|
||||||
scenario = queries.CeilometerQueriesCreateAndQueryAlarms(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock()
|
|
||||||
scenario._query_alarms = mock.MagicMock()
|
|
||||||
|
|
||||||
scenario.run("fake_meter_name", 100, "fake_filter",
|
|
||||||
"fake_orderby_attribute", 10, fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
100, {"fakearg": "f"})
|
|
||||||
scenario._query_alarms.assert_called_once_with(
|
|
||||||
json.dumps("fake_filter"), "fake_orderby_attribute", 10)
|
|
||||||
|
|
||||||
def test_create_and_query_alarms_no_filter(self):
|
|
||||||
scenario = queries.CeilometerQueriesCreateAndQueryAlarms(self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock()
|
|
||||||
scenario._query_alarms = mock.MagicMock()
|
|
||||||
|
|
||||||
scenario.run("fake_meter_name", 100, None, "fake_orderby_attribute",
|
|
||||||
10, fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name",
|
|
||||||
100, {"fakearg": "f"})
|
|
||||||
scenario._query_alarms.assert_called_once_with(
|
|
||||||
None, "fake_orderby_attribute", 10)
|
|
||||||
|
|
||||||
def test_create_and_query_alarm_history(self):
|
|
||||||
fake_alarm = mock.MagicMock()
|
|
||||||
fake_alarm.alarm_id = "fake_alarm_id"
|
|
||||||
scenario = queries.CeilometerQueriesCreateAndQueryAlarmHistory(
|
|
||||||
self.context)
|
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
|
||||||
scenario._query_alarm_history = mock.MagicMock()
|
|
||||||
|
|
||||||
fake_filter = json.dumps({"=": {"alarm_id": fake_alarm.alarm_id}})
|
|
||||||
scenario.run("fake_meter_name", 100, "fake_orderby_attribute",
|
|
||||||
10, fakearg="f")
|
|
||||||
scenario._create_alarm.assert_called_once_with("fake_meter_name", 100,
|
|
||||||
{"fakearg": "f"})
|
|
||||||
scenario._query_alarm_history.assert_called_once_with(
|
|
||||||
fake_filter, "fake_orderby_attribute", 10)
|
|
||||||
|
|
||||||
def test_create_and_query_samples(self):
|
|
||||||
scenario = queries.CeilometerQueriesCreateAndQuerySamples(self.context)
|
|
||||||
|
|
||||||
scenario._create_sample = mock.MagicMock()
|
|
||||||
scenario._query_samples = mock.MagicMock()
|
|
||||||
|
|
||||||
scenario.run("fake_counter_name", "fake_counter_type",
|
|
||||||
"fake_counter_unit", "fake_counter_volume",
|
|
||||||
"fake_resource_id", "fake_filter",
|
|
||||||
"fake_orderby_attribute", 10, fakearg="f")
|
|
||||||
scenario._create_sample.assert_called_once_with("fake_counter_name",
|
|
||||||
"fake_counter_type",
|
|
||||||
"fake_counter_unit",
|
|
||||||
"fake_counter_volume",
|
|
||||||
"fake_resource_id",
|
|
||||||
fakearg="f")
|
|
||||||
scenario._query_samples.assert_called_once_with(
|
|
||||||
json.dumps("fake_filter"), "fake_orderby_attribute", 10)
|
|
||||||
|
|
||||||
def test_create_and_query_samples_no_filter(self):
|
|
||||||
scenario = queries.CeilometerQueriesCreateAndQuerySamples(self.context)
|
|
||||||
|
|
||||||
scenario._create_sample = mock.MagicMock()
|
|
||||||
scenario._query_samples = mock.MagicMock()
|
|
||||||
|
|
||||||
scenario.run("fake_counter_name", "fake_counter_type",
|
|
||||||
"fake_counter_unit", "fake_counter_volume",
|
|
||||||
"fake_resource_id", None,
|
|
||||||
"fake_orderby_attribute", 10, fakearg="f")
|
|
||||||
scenario._create_sample.assert_called_once_with("fake_counter_name",
|
|
||||||
"fake_counter_type",
|
|
||||||
"fake_counter_unit",
|
|
||||||
"fake_counter_volume",
|
|
||||||
"fake_resource_id",
|
|
||||||
fakearg="f")
|
|
||||||
scenario._query_samples.assert_called_once_with(
|
|
||||||
None, "fake_orderby_attribute", 10)
|
|
@ -1,107 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import resources
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
BASE = "rally_openstack.task.scenarios.ceilometer"
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerResourcesTestCase(test.ScenarioTestCase):
|
|
||||||
@mock.patch("%s.resources.ListMatchedResources.run" % BASE)
|
|
||||||
def test_all_resource_list_queries(
|
|
||||||
self, mock_list_matched_resources_run):
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
start_time = "fake start time"
|
|
||||||
end_time = "fake end time"
|
|
||||||
limit = 100
|
|
||||||
|
|
||||||
scenario = resources.ListResources(self.context)
|
|
||||||
scenario.run(metadata_query, start_time, end_time, limit)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(limit=100)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(start_time=start_time,
|
|
||||||
end_time=end_time)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(end_time=end_time)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(start_time=start_time)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(
|
|
||||||
metadata_query=metadata_query)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(
|
|
||||||
filter_by_user_id=True)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(
|
|
||||||
filter_by_project_id=True)
|
|
||||||
mock_list_matched_resources_run.assert_any_call(
|
|
||||||
filter_by_resource_id=True)
|
|
||||||
|
|
||||||
def test_list_matched_resources(self):
|
|
||||||
scenario = resources.ListMatchedResources(self.context)
|
|
||||||
scenario._list_resources = mock.MagicMock()
|
|
||||||
context = {"user": {"tenant_id": "fake", "id": "fake_id"},
|
|
||||||
"tenant": {"id": "fake_id",
|
|
||||||
"resources": ["fake_resource"]}}
|
|
||||||
scenario.context = context
|
|
||||||
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
start_time = "2015-09-09T00:00:00"
|
|
||||||
end_time = "2015-09-10T00:00:00"
|
|
||||||
limit = 100
|
|
||||||
scenario.run(True, True, True, metadata_query,
|
|
||||||
start_time, end_time, limit)
|
|
||||||
scenario._list_resources.assert_called_once_with(
|
|
||||||
[{"field": "user_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "project_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "resource_id", "value": "fake_resource", "op": "eq"},
|
|
||||||
{"field": "metadata.a", "value": "test", "op": "eq"},
|
|
||||||
{"field": "timestamp", "value": "2015-09-09T00:00:00",
|
|
||||||
"op": ">="},
|
|
||||||
{"field": "timestamp", "value": "2015-09-10T00:00:00",
|
|
||||||
"op": "<="}
|
|
||||||
],
|
|
||||||
100)
|
|
||||||
|
|
||||||
def test_get_tenant_resources(self):
|
|
||||||
scenario = resources.GetTenantResources(self.context)
|
|
||||||
resource_list = ["id1", "id2", "id3", "id4"]
|
|
||||||
context = {"user": {"tenant_id": "fake"},
|
|
||||||
"tenant": {"id": "fake", "resources": resource_list}}
|
|
||||||
scenario.context = context
|
|
||||||
scenario._get_resource = mock.MagicMock()
|
|
||||||
scenario.run()
|
|
||||||
for resource_id in resource_list:
|
|
||||||
scenario._get_resource.assert_any_call(resource_id)
|
|
||||||
|
|
||||||
@mock.patch("%s.resources.ListMatchedResources.run" % BASE)
|
|
||||||
def test_resource_list_queries_without_limit_and_metadata(
|
|
||||||
self, mock_list_matched_resources_run):
|
|
||||||
scenario = resources.ListResources()
|
|
||||||
scenario.run()
|
|
||||||
expected_call_args_list = [
|
|
||||||
mock.call(filter_by_project_id=True),
|
|
||||||
mock.call(filter_by_user_id=True),
|
|
||||||
mock.call(filter_by_resource_id=True)
|
|
||||||
]
|
|
||||||
self.assertSequenceEqual(
|
|
||||||
expected_call_args_list,
|
|
||||||
mock_list_matched_resources_run.call_args_list)
|
|
||||||
|
|
||||||
def test_get_tenant_resources_with_exception(self):
|
|
||||||
scenario = resources.GetTenantResources(self.context)
|
|
||||||
resource_list = []
|
|
||||||
context = {"user": {"tenant_id": "fake"},
|
|
||||||
"tenant": {"id": "fake", "resources": resource_list}}
|
|
||||||
scenario.context = context
|
|
||||||
self.assertRaises(exceptions.RallyAssertionError, scenario.run)
|
|
@ -1,72 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import samples
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
BASE = "rally_openstack.task.scenarios.ceilometer"
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerSamplesTestCase(test.ScenarioTestCase):
|
|
||||||
|
|
||||||
@mock.patch("%s.samples.ListMatchedSamples.run" % BASE)
|
|
||||||
def test_all_list_samples(self, mock_list_matched_samples_run):
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
limit = 10
|
|
||||||
scenario = samples.ListSamples(self.context)
|
|
||||||
scenario.run(metadata_query, limit)
|
|
||||||
mock_list_matched_samples_run.assert_any_call(limit=10)
|
|
||||||
mock_list_matched_samples_run.assert_any_call(
|
|
||||||
metadata_query=metadata_query)
|
|
||||||
mock_list_matched_samples_run.assert_any_call(
|
|
||||||
filter_by_resource_id=True)
|
|
||||||
mock_list_matched_samples_run.assert_any_call(
|
|
||||||
filter_by_user_id=True)
|
|
||||||
mock_list_matched_samples_run.assert_any_call(
|
|
||||||
filter_by_project_id=True)
|
|
||||||
|
|
||||||
@mock.patch("%s.samples.ListMatchedSamples.run" % BASE)
|
|
||||||
def test_list_samples_without_limit_and_metadata(
|
|
||||||
self,
|
|
||||||
mock_list_matched_samples_run):
|
|
||||||
scenario = samples.ListSamples()
|
|
||||||
scenario.run()
|
|
||||||
expected_call_args_list = [
|
|
||||||
mock.call(filter_by_project_id=True),
|
|
||||||
mock.call(filter_by_user_id=True),
|
|
||||||
mock.call(filter_by_resource_id=True)
|
|
||||||
]
|
|
||||||
self.assertSequenceEqual(
|
|
||||||
expected_call_args_list,
|
|
||||||
mock_list_matched_samples_run.call_args_list)
|
|
||||||
|
|
||||||
def test_list_matched_samples(self):
|
|
||||||
scenario = samples.ListMatchedSamples()
|
|
||||||
scenario._list_samples = mock.MagicMock()
|
|
||||||
context = {"user": {"tenant_id": "fake", "id": "fake_id"},
|
|
||||||
"tenant": {"id": "fake_id",
|
|
||||||
"resources": ["fake_resource"]}}
|
|
||||||
scenario.context = context
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
limit = 10
|
|
||||||
scenario.run(True, True, True, metadata_query, limit)
|
|
||||||
scenario._list_samples.assert_called_once_with(
|
|
||||||
[{"field": "user_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "project_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "resource_id", "value": "fake_resource", "op": "eq"},
|
|
||||||
{"field": "metadata.a", "value": "test", "op": "eq"}],
|
|
||||||
10)
|
|
@ -1,45 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import stats
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerStatsTestCase(test.ScenarioTestCase):
|
|
||||||
|
|
||||||
def test_get_stats(self):
|
|
||||||
scenario = stats.GetStats(self.context)
|
|
||||||
scenario._get_stats = mock.MagicMock()
|
|
||||||
context = {"user": {"tenant_id": "fake", "id": "fake_id"},
|
|
||||||
"tenant": {"id": "fake_id",
|
|
||||||
"resources": ["fake_resource"]}}
|
|
||||||
metadata_query = {"a": "test"}
|
|
||||||
period = 10
|
|
||||||
groupby = "user_id"
|
|
||||||
aggregates = "sum"
|
|
||||||
scenario.context = context
|
|
||||||
scenario.run("fake_meter", True, True, True, metadata_query,
|
|
||||||
period, groupby, aggregates)
|
|
||||||
scenario._get_stats.assert_called_once_with(
|
|
||||||
"fake_meter",
|
|
||||||
[{"field": "user_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "project_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "resource_id", "value": "fake_resource", "op": "eq"},
|
|
||||||
{"field": "metadata.a", "value": "test", "op": "eq"}],
|
|
||||||
10,
|
|
||||||
"user_id",
|
|
||||||
"sum"
|
|
||||||
)
|
|
@ -1,69 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import traits
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerTraitsTestCase(test.ScenarioTestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(CeilometerTraitsTestCase, self).setUp()
|
|
||||||
patch = mock.patch(
|
|
||||||
"rally_openstack.common.services.identity.identity.Identity")
|
|
||||||
self.addCleanup(patch.stop)
|
|
||||||
self.mock_identity = patch.start()
|
|
||||||
|
|
||||||
def get_test_context(self):
|
|
||||||
context = super(CeilometerTraitsTestCase, self).get_test_context()
|
|
||||||
context["admin"] = {"id": "fake_user_id",
|
|
||||||
"credential": mock.MagicMock()
|
|
||||||
}
|
|
||||||
return context
|
|
||||||
|
|
||||||
def test_list_traits(self):
|
|
||||||
scenario = traits.CreateUserAndListTraits(self.context)
|
|
||||||
|
|
||||||
scenario._list_event_traits = mock.MagicMock()
|
|
||||||
scenario._list_events = mock.MagicMock(
|
|
||||||
return_value=[mock.Mock(
|
|
||||||
event_type="fake_event_type",
|
|
||||||
traits=[{"name": "fake_trait_name"}])
|
|
||||||
])
|
|
||||||
|
|
||||||
scenario.run()
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_events.assert_called_with()
|
|
||||||
scenario._list_event_traits.assert_called_once_with(
|
|
||||||
event_type="fake_event_type", trait_name="fake_trait_name")
|
|
||||||
|
|
||||||
def test_list_trait_descriptions(self):
|
|
||||||
scenario = traits.CreateUserAndListTraitDescriptions(
|
|
||||||
self.context)
|
|
||||||
|
|
||||||
scenario._list_event_trait_descriptions = mock.MagicMock()
|
|
||||||
scenario._list_events = mock.MagicMock(
|
|
||||||
return_value=[mock.Mock(
|
|
||||||
event_type="fake_event_type")
|
|
||||||
])
|
|
||||||
|
|
||||||
scenario.run()
|
|
||||||
|
|
||||||
self.mock_identity.return_value.create_user.assert_called_once_with()
|
|
||||||
scenario._list_events.assert_called_with()
|
|
||||||
scenario._list_event_trait_descriptions.assert_called_once_with(
|
|
||||||
event_type="fake_event_type")
|
|
@ -1,405 +0,0 @@
|
|||||||
# All Rights Reserved.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
import copy
|
|
||||||
import datetime as dt
|
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
|
||||||
from rally_openstack.task.scenarios.ceilometer import utils
|
|
||||||
from tests.unit import test
|
|
||||||
|
|
||||||
CEILOMETER_UTILS = "rally_openstack.task.scenarios.ceilometer.utils"
|
|
||||||
|
|
||||||
|
|
||||||
def get_dt_diff(dt1, dt2):
|
|
||||||
"""Returns a diff between to datetime objects in seconds."""
|
|
||||||
if isinstance(dt1, str):
|
|
||||||
dt1 = dt.datetime.strptime(dt1, "%Y-%m-%dT%H:%M:%S")
|
|
||||||
if isinstance(dt2, str):
|
|
||||||
dt2 = dt.datetime.strptime(dt2, "%Y-%m-%dT%H:%M:%S")
|
|
||||||
return (dt1 - dt2).seconds
|
|
||||||
|
|
||||||
|
|
||||||
class CeilometerScenarioTestCase(test.ScenarioTestCase):
|
|
||||||
def setUp(self):
|
|
||||||
super(CeilometerScenarioTestCase, self).setUp()
|
|
||||||
self.scenario = utils.CeilometerScenario(self.context)
|
|
||||||
|
|
||||||
@mock.patch("%s.uuid.uuid4" % CEILOMETER_UTILS)
|
|
||||||
def test__make_samples_no_batch_size(self, mock_uuid4):
|
|
||||||
mock_uuid4.return_value = "fake_uuid"
|
|
||||||
test_timestamp = dt.datetime(2015, 10, 20, 14, 18, 40)
|
|
||||||
result = list(self.scenario._make_samples(count=2, interval=60,
|
|
||||||
timestamp=test_timestamp))
|
|
||||||
self.assertEqual(1, len(result))
|
|
||||||
expected = {"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 1,
|
|
||||||
"resource_id": "fake_uuid",
|
|
||||||
"timestamp": test_timestamp.isoformat()}
|
|
||||||
self.assertEqual(expected, result[0][0])
|
|
||||||
samples_int = get_dt_diff(result[0][0]["timestamp"],
|
|
||||||
result[0][1]["timestamp"])
|
|
||||||
self.assertEqual(60, samples_int)
|
|
||||||
|
|
||||||
@mock.patch("%s.uuid.uuid4" % CEILOMETER_UTILS)
|
|
||||||
def test__make_samples_batch_size(self, mock_uuid4):
|
|
||||||
mock_uuid4.return_value = "fake_uuid"
|
|
||||||
test_timestamp = dt.datetime(2015, 10, 20, 14, 18, 40)
|
|
||||||
result = list(self.scenario._make_samples(count=4, interval=60,
|
|
||||||
batch_size=2,
|
|
||||||
timestamp=test_timestamp))
|
|
||||||
self.assertEqual(2, len(result))
|
|
||||||
expected = {"counter_name": "cpu_util",
|
|
||||||
"counter_type": "gauge",
|
|
||||||
"counter_unit": "%",
|
|
||||||
"counter_volume": 1,
|
|
||||||
"resource_id": "fake_uuid",
|
|
||||||
"timestamp": test_timestamp.isoformat()}
|
|
||||||
self.assertEqual(expected, result[0][0])
|
|
||||||
samples_int = get_dt_diff(result[0][-1]["timestamp"],
|
|
||||||
result[1][0]["timestamp"])
|
|
||||||
# NOTE(idegtiarov): here we check that interval between last sample in
|
|
||||||
# first batch and first sample in second batch is equal 60 sec.
|
|
||||||
self.assertEqual(60, samples_int)
|
|
||||||
|
|
||||||
def test__make_timestamp_query(self):
|
|
||||||
start_time = "2015-09-09T00:00:00"
|
|
||||||
end_time = "2015-09-10T00:00:00"
|
|
||||||
expected_start = [
|
|
||||||
{"field": "timestamp", "value": "2015-09-09T00:00:00",
|
|
||||||
"op": ">="}]
|
|
||||||
expected_end = [
|
|
||||||
{"field": "timestamp", "value": "2015-09-10T00:00:00",
|
|
||||||
"op": "<="}
|
|
||||||
]
|
|
||||||
|
|
||||||
actual = self.scenario._make_timestamp_query(start_time, end_time)
|
|
||||||
self.assertEqual(expected_start + expected_end, actual)
|
|
||||||
self.assertRaises(exceptions.InvalidArgumentsException,
|
|
||||||
self.scenario._make_timestamp_query,
|
|
||||||
end_time, start_time)
|
|
||||||
self.assertEqual(
|
|
||||||
expected_start,
|
|
||||||
self.scenario._make_timestamp_query(start_time=start_time))
|
|
||||||
self.assertEqual(
|
|
||||||
expected_end,
|
|
||||||
self.scenario._make_timestamp_query(end_time=end_time))
|
|
||||||
|
|
||||||
def test__list_alarms_by_id(self):
|
|
||||||
self.assertEqual(self.clients("ceilometer").alarms.get.return_value,
|
|
||||||
self.scenario._list_alarms("alarm-id"))
|
|
||||||
self.clients("ceilometer").alarms.get.assert_called_once_with(
|
|
||||||
"alarm-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_alarms")
|
|
||||||
|
|
||||||
def test__list_alarms(self):
|
|
||||||
self.assertEqual(self.clients("ceilometer").alarms.list.return_value,
|
|
||||||
self.scenario._list_alarms())
|
|
||||||
self.clients("ceilometer").alarms.list.assert_called_once_with()
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_alarms")
|
|
||||||
|
|
||||||
def test__get_alarm(self):
|
|
||||||
self.assertEqual(self.clients("ceilometer").alarms.get.return_value,
|
|
||||||
self.scenario._get_alarm("alarm-id"))
|
|
||||||
self.clients("ceilometer").alarms.get.assert_called_once_with(
|
|
||||||
"alarm-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.get_alarm")
|
|
||||||
|
|
||||||
def test__create_alarm(self):
|
|
||||||
alarm_dict = {"alarm_id": "fake-alarm-id"}
|
|
||||||
orig_alarm_dict = copy.copy(alarm_dict)
|
|
||||||
self.scenario.generate_random_name = mock.Mock()
|
|
||||||
self.assertEqual(self.scenario._create_alarm("fake-meter-name", 100,
|
|
||||||
alarm_dict),
|
|
||||||
self.clients("ceilometer").alarms.create.return_value)
|
|
||||||
self.clients("ceilometer").alarms.create.assert_called_once_with(
|
|
||||||
meter_name="fake-meter-name",
|
|
||||||
threshold=100,
|
|
||||||
description="Test Alarm",
|
|
||||||
alarm_id="fake-alarm-id",
|
|
||||||
name=self.scenario.generate_random_name.return_value)
|
|
||||||
# ensure that _create_alarm() doesn't modify the alarm dict as
|
|
||||||
# a side-effect
|
|
||||||
self.assertEqual(alarm_dict, orig_alarm_dict)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.create_alarm")
|
|
||||||
|
|
||||||
def test__delete_alarms(self):
|
|
||||||
self.scenario._delete_alarm("alarm-id")
|
|
||||||
self.clients("ceilometer").alarms.delete.assert_called_once_with(
|
|
||||||
"alarm-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.delete_alarm")
|
|
||||||
|
|
||||||
def test__update_alarm(self):
|
|
||||||
alarm_diff = {"description": "Changed Test Description"}
|
|
||||||
orig_alarm_diff = copy.copy(alarm_diff)
|
|
||||||
self.scenario._update_alarm("alarm-id", alarm_diff)
|
|
||||||
self.clients("ceilometer").alarms.update.assert_called_once_with(
|
|
||||||
"alarm-id", **alarm_diff)
|
|
||||||
# ensure that _create_alarm() doesn't modify the alarm dict as
|
|
||||||
# a side-effect
|
|
||||||
self.assertEqual(alarm_diff, orig_alarm_diff)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.update_alarm")
|
|
||||||
|
|
||||||
def test__get_alarm_history(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._get_alarm_history("alarm-id"),
|
|
||||||
self.clients("ceilometer").alarms.get_history.return_value)
|
|
||||||
self.clients("ceilometer").alarms.get_history.assert_called_once_with(
|
|
||||||
"alarm-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.get_alarm_history")
|
|
||||||
|
|
||||||
def test__get_alarm_state(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._get_alarm_state("alarm-id"),
|
|
||||||
self.clients("ceilometer").alarms.get_state.return_value)
|
|
||||||
self.clients("ceilometer").alarms.get_state.assert_called_once_with(
|
|
||||||
"alarm-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.get_alarm_state")
|
|
||||||
|
|
||||||
def test__set_alarm_state(self):
|
|
||||||
alarm = mock.Mock()
|
|
||||||
self.clients("ceilometer").alarms.create.return_value = alarm
|
|
||||||
return_alarm = self.scenario._set_alarm_state(alarm, "ok", 100)
|
|
||||||
self.mock_wait_for_status.mock.assert_called_once_with(
|
|
||||||
alarm,
|
|
||||||
ready_statuses=["ok"],
|
|
||||||
update_resource=self.mock_get_from_manager.mock.return_value,
|
|
||||||
timeout=100, check_interval=1)
|
|
||||||
self.mock_get_from_manager.mock.assert_called_once_with()
|
|
||||||
self.assertEqual(self.mock_wait_for_status.mock.return_value,
|
|
||||||
return_alarm)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.set_alarm_state")
|
|
||||||
|
|
||||||
def test__list_events(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_events(),
|
|
||||||
self.admin_clients("ceilometer").events.list.return_value
|
|
||||||
)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_events")
|
|
||||||
|
|
||||||
def test__get_events(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._get_event(event_id="fake_id"),
|
|
||||||
self.admin_clients("ceilometer").events.get.return_value
|
|
||||||
)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.get_event")
|
|
||||||
|
|
||||||
def test__list_event_types(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_event_types(),
|
|
||||||
self.admin_clients("ceilometer").event_types.list.return_value
|
|
||||||
)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_event_types")
|
|
||||||
|
|
||||||
def test__list_event_traits(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_event_traits(
|
|
||||||
event_type="fake_event_type", trait_name="fake_trait_name"),
|
|
||||||
self.admin_clients("ceilometer").traits.list.return_value
|
|
||||||
)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_event_traits")
|
|
||||||
|
|
||||||
def test__list_event_trait_descriptions(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_event_trait_descriptions(
|
|
||||||
event_type="fake_event_type"
|
|
||||||
),
|
|
||||||
self.admin_clients("ceilometer").trait_descriptions.list.
|
|
||||||
return_value
|
|
||||||
)
|
|
||||||
self._test_atomic_action_timer(
|
|
||||||
self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_event_trait_descriptions")
|
|
||||||
|
|
||||||
def test__list_meters(self):
|
|
||||||
self.assertEqual(self.scenario._list_meters(),
|
|
||||||
self.clients("ceilometer").meters.list.return_value)
|
|
||||||
self.clients("ceilometer").meters.list.assert_called_once_with(
|
|
||||||
q=None, limit=None)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_meters")
|
|
||||||
|
|
||||||
def test__list_resources(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_resources(),
|
|
||||||
self.clients("ceilometer").resources.list.return_value)
|
|
||||||
self.clients("ceilometer").resources.list.assert_called_once_with(
|
|
||||||
q=None, limit=None)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_resources")
|
|
||||||
|
|
||||||
def test__list_samples(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_samples(),
|
|
||||||
self.clients("ceilometer").new_samples.list.return_value)
|
|
||||||
self.clients("ceilometer").new_samples.list.assert_called_once_with(
|
|
||||||
q=None, limit=None)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_samples")
|
|
||||||
|
|
||||||
def test__list_samples_with_query(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._list_samples(query=[{"field": "user_id",
|
|
||||||
"volume": "fake_id"}],
|
|
||||||
limit=10),
|
|
||||||
self.clients("ceilometer").new_samples.list.return_value)
|
|
||||||
self.clients("ceilometer").new_samples.list.assert_called_once_with(
|
|
||||||
q=[{"field": "user_id", "volume": "fake_id"}], limit=10)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.list_samples:limit&user_id")
|
|
||||||
|
|
||||||
def test__get_resource(self):
|
|
||||||
self.assertEqual(self.scenario._get_resource("fake-resource-id"),
|
|
||||||
self.clients("ceilometer").resources.get.return_value)
|
|
||||||
self.clients("ceilometer").resources.get.assert_called_once_with(
|
|
||||||
"fake-resource-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.get_resource")
|
|
||||||
|
|
||||||
def test__get_stats(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._get_stats("fake-meter"),
|
|
||||||
self.clients("ceilometer").statistics.list.return_value)
|
|
||||||
self.clients("ceilometer").statistics.list.assert_called_once_with(
|
|
||||||
"fake-meter", q=None, period=None, groupby=None, aggregates=None)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.get_stats")
|
|
||||||
|
|
||||||
def test__create_meter(self):
|
|
||||||
self.scenario.generate_random_name = mock.Mock()
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._create_meter(fakearg="fakearg"),
|
|
||||||
self.clients("ceilometer").samples.create.return_value[0])
|
|
||||||
self.clients("ceilometer").samples.create.assert_called_once_with(
|
|
||||||
counter_name=self.scenario.generate_random_name.return_value,
|
|
||||||
fakearg="fakearg")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.create_meter")
|
|
||||||
|
|
||||||
def test__query_alarms(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._query_alarms("fake-filter", "fake-orderby", 10),
|
|
||||||
self.clients("ceilometer").query_alarms.query.return_value)
|
|
||||||
self.clients("ceilometer").query_alarms.query.assert_called_once_with(
|
|
||||||
"fake-filter", "fake-orderby", 10)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.query_alarms")
|
|
||||||
|
|
||||||
def test__query_alarm_history(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._query_alarm_history(
|
|
||||||
"fake-filter", "fake-orderby", 10),
|
|
||||||
self.clients("ceilometer").query_alarm_history.query.return_value)
|
|
||||||
self.clients(
|
|
||||||
"ceilometer").query_alarm_history.query.assert_called_once_with(
|
|
||||||
"fake-filter", "fake-orderby", 10)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.query_alarm_history")
|
|
||||||
|
|
||||||
def test__query_samples(self):
|
|
||||||
self.assertEqual(
|
|
||||||
self.scenario._query_samples("fake-filter", "fake-orderby", 10),
|
|
||||||
self.clients("ceilometer").query_samples.query.return_value)
|
|
||||||
self.clients("ceilometer").query_samples.query.assert_called_once_with(
|
|
||||||
"fake-filter", "fake-orderby", 10)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.query_samples")
|
|
||||||
|
|
||||||
def test__create_sample_no_resource_id(self):
|
|
||||||
self.scenario.generate_random_name = mock.Mock()
|
|
||||||
created_sample = self.scenario._create_sample("test-counter-name",
|
|
||||||
"test-counter-type",
|
|
||||||
"test-counter-unit",
|
|
||||||
"test-counter-volume")
|
|
||||||
self.assertEqual(
|
|
||||||
created_sample,
|
|
||||||
self.clients("ceilometer").samples.create.return_value)
|
|
||||||
self.clients("ceilometer").samples.create.assert_called_once_with(
|
|
||||||
counter_name="test-counter-name",
|
|
||||||
counter_type="test-counter-type",
|
|
||||||
counter_unit="test-counter-unit",
|
|
||||||
counter_volume="test-counter-volume",
|
|
||||||
resource_id=self.scenario.generate_random_name.return_value)
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.create_sample")
|
|
||||||
|
|
||||||
def test__create_sample(self):
|
|
||||||
created_sample = self.scenario._create_sample("test-counter-name",
|
|
||||||
"test-counter-type",
|
|
||||||
"test-counter-unit",
|
|
||||||
"test-counter-volume",
|
|
||||||
"test-resource-id")
|
|
||||||
self.assertEqual(
|
|
||||||
created_sample,
|
|
||||||
self.clients("ceilometer").samples.create.return_value)
|
|
||||||
self.clients("ceilometer").samples.create.assert_called_once_with(
|
|
||||||
counter_name="test-counter-name",
|
|
||||||
counter_type="test-counter-type",
|
|
||||||
counter_unit="test-counter-unit",
|
|
||||||
counter_volume="test-counter-volume",
|
|
||||||
resource_id="test-resource-id")
|
|
||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
|
||||||
"ceilometer.create_sample")
|
|
||||||
|
|
||||||
def test__make_general_query(self):
|
|
||||||
self.scenario.context = {
|
|
||||||
"user": {"tenant_id": "fake", "id": "fake_id"},
|
|
||||||
"tenant": {"id": "fake_id", "resources": ["fake_resource"]}}
|
|
||||||
metadata = {"fake_field": "boo"}
|
|
||||||
expected = [
|
|
||||||
{"field": "user_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "project_id", "value": "fake_id", "op": "eq"},
|
|
||||||
{"field": "resource_id", "value": "fake_resource", "op": "eq"},
|
|
||||||
{"field": "metadata.fake_field", "value": "boo", "op": "eq"},
|
|
||||||
]
|
|
||||||
|
|
||||||
actual = self.scenario._make_general_query(True, True, True, metadata)
|
|
||||||
self.assertEqual(expected, actual)
|
|
||||||
|
|
||||||
def test__make_query_item(self):
|
|
||||||
expected = {"field": "foo", "op": "eq", "value": "bar"}
|
|
||||||
self.assertEqual(expected,
|
|
||||||
self.scenario._make_query_item("foo", value="bar"))
|
|
||||||
|
|
||||||
def test__make_profiler_key(self):
|
|
||||||
query = [
|
|
||||||
{"field": "test_field1", "op": "eq", "value": "bar"},
|
|
||||||
{"field": "test_field2", "op": "==", "value": None}
|
|
||||||
]
|
|
||||||
limit = 100
|
|
||||||
method = "fake_method"
|
|
||||||
actual = self.scenario._make_profiler_key(method, query, limit)
|
|
||||||
self.assertEqual("fake_method:limit&test_field1&test_field2", actual)
|
|
||||||
|
|
||||||
actual = self.scenario._make_profiler_key(method, query, None)
|
|
||||||
self.assertEqual("fake_method:test_field1&test_field2", actual)
|
|
||||||
|
|
||||||
self.assertEqual(method,
|
|
||||||
self.scenario._make_profiler_key(method, None, None))
|
|
7
tox.ini
7
tox.ini
@ -25,7 +25,7 @@ commands =
|
|||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
python {toxinidir}/tests/ci/pytest_launcher.py tests/unit --posargs={posargs}
|
python {toxinidir}/tests/ci/pytest_launcher.py tests/unit --posargs={posargs}
|
||||||
distribute = false
|
distribute = false
|
||||||
basepython = python3.6
|
basepython = python3
|
||||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY REQUESTS_CA_BUNDLE
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY REQUESTS_CA_BUNDLE
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
@ -71,7 +71,6 @@ deps =
|
|||||||
--no-cache-dir
|
--no-cache-dir
|
||||||
requests[security]
|
requests[security]
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
|
||||||
commands = python {toxinidir}/tests/ci/sync_requirements.py {posargs}
|
commands = python {toxinidir}/tests/ci/sync_requirements.py {posargs}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
@ -123,13 +122,11 @@ commands = {toxinidir}/tests/ci/rally_self_job.sh {toxinidir}/rally-jobs/self-ra
|
|||||||
[pytest]
|
[pytest]
|
||||||
filterwarnings =
|
filterwarnings =
|
||||||
error
|
error
|
||||||
ignore:invalid escape sequence:DeprecationWarning:.*prettytable
|
|
||||||
ignore:invalid escape sequence:DeprecationWarning:.*subunit.*
|
ignore:invalid escape sequence:DeprecationWarning:.*subunit.*
|
||||||
ignore:Using or importing the ABCs:DeprecationWarning:unittest2.*
|
|
||||||
ignore:::.*netaddr.strategy.*
|
ignore:::.*netaddr.strategy.*
|
||||||
ignore:Using or importing the ABCs:DeprecationWarning:.*oslo_context.*
|
|
||||||
ignore:the imp module is deprecated in favour of importlib.*:DeprecationWarning
|
ignore:the imp module is deprecated in favour of importlib.*:DeprecationWarning
|
||||||
# raised by designateclient?!
|
# raised by designateclient?!
|
||||||
ignore:dns.hash module will be removed in future versions. Please use hashlib instead.:DeprecationWarning
|
ignore:dns.hash module will be removed in future versions. Please use hashlib instead.:DeprecationWarning
|
||||||
# should be fixed at rally framework (raised by functional job)
|
# should be fixed at rally framework (raised by functional job)
|
||||||
ignore:.*EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade*:
|
ignore:.*EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade*:
|
||||||
|
ignore:.*unclosed file <_io.TextIOWrapper name='/tmp/rally.log'::
|
||||||
|
@ -1,158 +1,134 @@
|
|||||||
alembic===1.4.3
|
alembic===1.7.4
|
||||||
apipkg===1.5
|
|
||||||
appdirs===1.4.4
|
appdirs===1.4.4
|
||||||
argparse===1.4.0
|
attrs===21.2.0
|
||||||
attrs===20.2.0
|
autopage===0.4.0
|
||||||
Babel===2.8.0
|
Babel===2.9.1
|
||||||
|
backports.entry-points-selectable===1.1.0
|
||||||
bcrypt===3.2.0
|
bcrypt===3.2.0
|
||||||
cachetools===4.1.1
|
cachetools===4.2.4
|
||||||
certifi===2020.6.20
|
certifi===2021.10.8
|
||||||
cffi===1.14.3
|
cffi===1.15.0
|
||||||
chardet===3.0.4
|
charset-normalizer===2.0.7
|
||||||
click===7.1.2
|
click===8.0.3
|
||||||
cliff===3.4.0
|
cliff===3.9.0
|
||||||
cmd2===1.3.11
|
cmd2===2.2.0
|
||||||
colorama===0.4.4
|
colorama===0.4.4
|
||||||
coverage===5.3
|
cryptography===35.0.0
|
||||||
cryptography===3.2.1
|
debtcollector===2.3.0
|
||||||
ddt===1.4.1
|
decorator===5.1.0
|
||||||
debtcollector===2.2.0
|
distlib===0.3.3
|
||||||
decorator===4.4.2
|
dogpile.cache===1.1.4
|
||||||
distlib===0.3.1
|
|
||||||
docutils===0.15.2
|
|
||||||
dogpile.cache===1.0.2
|
|
||||||
execnet===1.7.1
|
|
||||||
extras===1.0.0
|
extras===1.0.0
|
||||||
fasteners===0.14.1
|
fasteners===0.14.1
|
||||||
filelock===3.0.12
|
filelock===3.3.1
|
||||||
fixtures===3.0.0
|
fixtures===3.0.0
|
||||||
flake8===3.8.4
|
futurist===2.4.0
|
||||||
futurist===2.3.0
|
|
||||||
gnocchiclient===7.0.6
|
gnocchiclient===7.0.6
|
||||||
google-auth===1.23.0
|
google-auth===2.3.0
|
||||||
hacking===3.2.0
|
greenlet===1.1.2
|
||||||
idna===2.10
|
idna===3.3
|
||||||
importlib-metadata===2.0.0
|
importlib-metadata===4.8.1
|
||||||
importlib-resources===3.3.0
|
importlib-resources===5.3.0
|
||||||
iniconfig===1.1.1
|
iso8601===0.1.16
|
||||||
iso8601===0.1.13
|
Jinja2===3.0.2
|
||||||
Jinja2===2.11.2
|
|
||||||
jmespath===0.10.0
|
jmespath===0.10.0
|
||||||
jsonpatch===1.26
|
jsonpatch===1.32
|
||||||
jsonpointer===2.0
|
jsonpointer===2.1
|
||||||
jsonschema===3.2.0
|
jsonschema===3.2.0
|
||||||
keystoneauth1===4.2.1
|
keystoneauth1===4.4.0
|
||||||
kubernetes===12.0.0
|
kubernetes===18.20.0
|
||||||
linecache2===1.0.0
|
Mako===1.1.5
|
||||||
Mako===1.1.3
|
MarkupSafe===2.0.1
|
||||||
MarkupSafe===1.1.1
|
monotonic===1.6
|
||||||
mccabe===0.6.1
|
msgpack===1.0.2
|
||||||
monotonic===1.5
|
|
||||||
msgpack===1.0.0
|
|
||||||
munch===2.5.0
|
munch===2.5.0
|
||||||
murano-pkg-check===0.3.0
|
murano-pkg-check===0.3.0
|
||||||
netaddr===0.8.0
|
netaddr===0.8.0
|
||||||
netifaces===0.10.9
|
netifaces===0.11.0
|
||||||
oauthlib===3.1.0
|
oauthlib===3.1.1
|
||||||
openstacksdk===0.50.0
|
openstacksdk===0.59.0
|
||||||
os-client-config===2.1.0
|
os-client-config===2.1.0
|
||||||
os-faults===0.2.7
|
os-faults===0.2.7
|
||||||
os-service-types===1.7.0
|
os-service-types===1.7.0
|
||||||
osc-lib===2.2.1
|
osc-lib===2.4.2
|
||||||
oslo.concurrency===4.3.1
|
oslo.concurrency===4.4.1
|
||||||
oslo.config===8.3.2
|
oslo.config===8.7.1
|
||||||
oslo.context===3.1.1
|
oslo.context===3.3.1
|
||||||
oslo.db===8.4.0
|
oslo.db===11.0.0
|
||||||
oslo.i18n===5.0.1
|
oslo.i18n===5.1.0
|
||||||
oslo.log===4.4.0
|
oslo.log===4.6.0
|
||||||
oslo.serialization===4.0.1
|
oslo.serialization===4.2.0
|
||||||
oslo.utils===4.7.0
|
oslo.utils===4.10.0
|
||||||
osprofiler===3.4.0
|
osprofiler===3.4.2
|
||||||
packaging===20.4
|
packaging===21.0
|
||||||
paramiko===2.7.2
|
paramiko===2.8.0
|
||||||
pbr===5.5.1
|
pbr===5.6.0
|
||||||
pip===20.2.4
|
pip===21.3
|
||||||
pluggy===0.13.1
|
platformdirs===2.4.0
|
||||||
ply===3.11
|
ply===3.11
|
||||||
prettytable===0.7.2
|
prettytable===2.0.0
|
||||||
py===1.9.0
|
|
||||||
pyasn1===0.4.8
|
pyasn1===0.4.8
|
||||||
pyasn1-modules===0.2.8
|
pyasn1-modules===0.2.8
|
||||||
pycodestyle===2.6.0
|
|
||||||
pycparser===2.20
|
pycparser===2.20
|
||||||
pyflakes===2.2.0
|
pyghmi===1.5.29
|
||||||
pyghmi===1.5.18
|
|
||||||
Pygments===2.7.2
|
|
||||||
pyinotify===0.9.6
|
pyinotify===0.9.6
|
||||||
PyNaCl===1.4.0
|
PyNaCl===1.4.0
|
||||||
pyOpenSSL===19.1.0
|
pyOpenSSL===21.0.0
|
||||||
pyparsing===2.4.7
|
pyparsing===2.4.7
|
||||||
pyperclip===1.8.1
|
pyperclip===1.8.2
|
||||||
pyrsistent===0.17.3
|
pyrsistent===0.18.0
|
||||||
pytest===6.1.2
|
python-barbicanclient===5.2.0
|
||||||
pytest-cov===2.10.1
|
python-cinderclient===8.1.0
|
||||||
pytest-forked===1.3.0
|
python-dateutil===2.8.2
|
||||||
pytest-html===2.1.1
|
python-designateclient===4.3.0
|
||||||
pytest-metadata===1.10.0
|
python-glanceclient===3.5.0
|
||||||
pytest-xdist===2.1.0
|
python-heatclient===2.4.0
|
||||||
python-barbicanclient===5.0.1
|
python-ironicclient===4.9.0
|
||||||
python-ceilometerclient===2.9.0
|
python-keystoneclient===4.3.0
|
||||||
python-cinderclient===7.2.0
|
python-magnumclient===3.5.0
|
||||||
python-dateutil===2.8.1
|
python-manilaclient===3.0.0
|
||||||
python-designateclient===4.1.0
|
python-mistralclient===4.3.0
|
||||||
python-editor===1.0.4
|
python-monascaclient===2.4.0
|
||||||
python-glanceclient===3.2.2
|
python-muranoclient===2.4.0
|
||||||
python-heatclient===2.2.1
|
python-neutronclient===7.6.0
|
||||||
python-ironicclient===4.4.0
|
python-novaclient===17.6.0
|
||||||
python-keystoneclient===4.1.1
|
python-octaviaclient===2.4.0
|
||||||
python-magnumclient===3.2.1
|
python-openstackclient===5.6.0
|
||||||
python-manilaclient===2.3.0
|
python-saharaclient===3.4.0
|
||||||
python-mimeparse===1.6.0
|
python-senlinclient===2.3.0
|
||||||
python-mistralclient===4.1.1
|
|
||||||
python-monascaclient===2.2.1
|
|
||||||
python-muranoclient===2.1.1
|
|
||||||
python-neutronclient===7.2.1
|
|
||||||
python-novaclient===17.2.1
|
|
||||||
python-octaviaclient===2.2.0
|
|
||||||
python-openstackclient===5.4.0
|
|
||||||
python-saharaclient===3.2.1
|
|
||||||
python-senlinclient===2.1.1
|
|
||||||
python-subunit===1.4.0
|
python-subunit===1.4.0
|
||||||
python-swiftclient===3.10.1
|
python-swiftclient===3.12.0
|
||||||
python-troveclient===5.1.1
|
python-troveclient===7.1.1
|
||||||
python-watcherclient===3.1.1
|
python-watcherclient===3.3.0
|
||||||
python-zaqarclient===2.0.1
|
python-zaqarclient===2.2.0
|
||||||
pytz===2020.4
|
pytz===2021.3
|
||||||
PyYAML===5.3.1
|
PyYAML===5.4.1
|
||||||
rally===3.2.0
|
rally===3.3.0
|
||||||
requests===2.23.0
|
requests===2.26.0
|
||||||
requests-oauthlib===1.3.0
|
requests-oauthlib===1.3.0
|
||||||
requestsexceptions===1.4.0
|
requestsexceptions===1.4.0
|
||||||
rfc3986===1.4.0
|
rfc3986===1.5.0
|
||||||
rsa===4.6
|
rsa===4.7.2
|
||||||
semantic-version===2.8.5
|
semantic-version===2.8.5
|
||||||
setuptools===50.3.2
|
setuptools===58.2.0
|
||||||
simplejson===3.17.2
|
simplejson===3.17.5
|
||||||
six===1.15.0
|
six===1.16.0
|
||||||
SQLAlchemy===1.3.20
|
SQLAlchemy===1.4.25
|
||||||
sqlalchemy-migrate===0.13.0
|
sqlalchemy-migrate===0.13.0
|
||||||
sqlparse===0.4.1
|
sqlparse===0.4.2
|
||||||
stevedore===3.2.2
|
stevedore===3.5.0
|
||||||
Tempita===0.5.2
|
Tempita===0.5.2
|
||||||
testresources===2.0.1
|
testresources===2.0.1
|
||||||
testscenarios===0.5.0
|
testscenarios===0.5.0
|
||||||
testtools===2.4.0
|
testtools===2.5.0
|
||||||
toml===0.10.0
|
ujson===4.2.0
|
||||||
traceback2===1.4.0
|
urllib3===1.26.7
|
||||||
ujson===4.0.1
|
virtualenv===20.8.1
|
||||||
unittest2===1.1.0
|
|
||||||
urllib3===1.25.11
|
|
||||||
virtualenv===20.1.0
|
|
||||||
warlock===1.3.3
|
warlock===1.3.3
|
||||||
wcwidth===0.2.5
|
wcwidth===0.2.5
|
||||||
WebOb===1.8.6
|
WebOb===1.8.7
|
||||||
websocket-client===0.57.0
|
websocket-client===1.2.1
|
||||||
wheel===0.35.1
|
wheel===0.37.0
|
||||||
wrapt===1.12.1
|
wrapt===1.13.2
|
||||||
yaql===1.1.3
|
yaql===2.0.0
|
||||||
zipp===3.4.0
|
zipp===3.6.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user