The ceilometer.tests.unit.polling.test_manager Module

The ceilometer.tests.unit.polling.test_manager Module

Tests for ceilometer agent manager

class ceilometer.tests.unit.polling.test_manager.BaseAgent(*args, **kwds)[source]

Bases: ceilometer.tests.base.BaseTestCase

class BatchPollster(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.BatchTestPollster

resources = []
samples = []
test_data = <name: test, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.739929>
class Discovery(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestDiscovery

params = []
resources = []
class DiscoveryAnother(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestDiscovery

group_id
params = []
resources = []
class DiscoveryException(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestDiscoveryException

params = []
class Pollster(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollster

resources = []
samples = []
test_data = <name: test, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.739827>
class PollsterAnother(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollster

resources = []
samples = []
test_data = <name: testanother, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.740024>
class PollsterKeystone(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollsterKeystone

resources = []
samples = []
test_data = <name: testkeystone, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.740124>
class PollsterPollingException(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollsterPollingException

resources = []
samples = []
test_data = <name: testpollingexception, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.740215>
create_discoveries()[source]
create_extension_list()[source]
create_manager()[source]
fake_notifier_sample(ctxt, event_type, payload)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

setup_polling(poll_cfg=None)[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

class ceilometer.tests.unit.polling.test_manager.BatchTestPollster(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollster

default_discovery
discovery = None
get_samples(manager, cache, resources)[source]

Return a sequence of Counter instances from polling the resources.

Parameters:
  • manager – The service manager class invoking the plugin.
  • cache – A dictionary to allow pollsters to pass data between themselves when recomputing it would be expensive (e.g., asking another service for a list of objects).
  • resources – A list of resources the pollster will get data from. It’s up to the specific pollster to decide how to use it. It is usually supplied by a discovery, see default_discovery for more information.
test_data = <name: test, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.739540>
exception ceilometer.tests.unit.polling.test_manager.PollingException[source]

Bases: exceptions.Exception

class ceilometer.tests.unit.polling.test_manager.TestDiscovery(conf)[source]

Bases: ceilometer.polling.plugin_base.DiscoveryBase

discover(manager, param=None)[source]

Discover resources to monitor.

The most fine-grained discovery should be preferred, so the work is the most evenly distributed among multiple agents (if they exist).

For example: if the pollster can separately poll individual resources, it should have its own discovery implementation to discover those resources. If it can only poll per-tenant, then the TenantDiscovery should be used. If even that is not possible, use EndpointDiscovery (see their respective docstrings).

Parameters:
  • manager – The service manager class invoking the plugin.
  • param – an optional parameter to guide the discovery
class ceilometer.tests.unit.polling.test_manager.TestDiscoveryException(conf)[source]

Bases: ceilometer.polling.plugin_base.DiscoveryBase

discover(manager, param=None)[source]

Discover resources to monitor.

The most fine-grained discovery should be preferred, so the work is the most evenly distributed among multiple agents (if they exist).

For example: if the pollster can separately poll individual resources, it should have its own discovery implementation to discover those resources. If it can only poll per-tenant, then the TenantDiscovery should be used. If even that is not possible, use EndpointDiscovery (see their respective docstrings).

Parameters:
  • manager – The service manager class invoking the plugin.
  • param – an optional parameter to guide the discovery
class ceilometer.tests.unit.polling.test_manager.TestManager(*args, **kwds)[source]

Bases: ceilometer.tests.base.BaseTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_builder()[source]
test_hash_of_set()[source]
test_import_error_in_plugin(**keywargs)[source]
test_load_exceptional_plugins(**keywargs)[source]
test_load_failed_plugins(**keywargs)[source]
test_load_normal_plugins(**keywargs)[source]
test_load_plugins()[source]
class ceilometer.tests.unit.polling.test_manager.TestPollingAgent(*args, **kwds)[source]

Bases: ceilometer.tests.unit.polling.test_manager.BaseAgent

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_batching_polled_samples_batch_size()[source]
test_batching_polled_samples_default()[source]
test_batching_polled_samples_disable_batch()[source]
test_batching_polled_samples_false_deprecated()[source]
test_get_sample_resources()[source]
test_hardware_discover_fail_minimize_logs(**keywargs)[source]
test_multiple_pollings_different_static_resources()[source]
test_multiple_sources_different_discoverers()[source]
test_per_polling_discovery_discovered_augmented_by_static()[source]
test_per_polling_discovery_discovered_duplicated_static()[source]
test_per_polling_discovery_discovered_only()[source]
test_per_polling_discovery_static_only()[source]
test_per_pollster_discovery()[source]
test_per_pollster_discovery_caching()[source]
test_per_pollster_discovery_duplicated()[source]
test_per_pollster_discovery_overridden_by_duplicated_static()[source]
test_per_pollster_discovery_overridden_by_per_polling_discovery()[source]
test_polling_and_notify_with_resources(**keywargs)[source]
test_polling_exception(**keywargs)[source]
test_polling_novalike_exception(**keywargs)[source]
test_polling_samples_timestamp(**keywargs)[source]
test_setup_polling_task_same_interval()[source]
test_setup_polling_tasks()[source]
test_setup_polling_tasks_mismatch_counter()[source]
test_setup_polling_tasks_multiple_interval()[source]
test_skip_polling_and_notify_with_no_resources(**keywargs)[source]
test_skip_polling_polled_resources(**keywargs)[source]
test_start(**keywargs)[source]
test_when_keystone_fail()[source]

Test for bug 1316532.

class ceilometer.tests.unit.polling.test_manager.TestPollingAgentPartitioned(*args, **kwds)[source]

Bases: ceilometer.tests.unit.polling.test_manager.BaseAgent

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_discovery_partitioning()[source]
test_discovery_partitioning_unhashable()[source]
test_static_resources_partitioning()[source]
class ceilometer.tests.unit.polling.test_manager.TestPollster(conf)[source]

Bases: ceilometer.polling.plugin_base.PollsterBase

default_discovery
discovery = None
get_samples(manager, cache, resources)[source]

Return a sequence of Counter instances from polling the resources.

Parameters:
  • manager – The service manager class invoking the plugin.
  • cache – A dictionary to allow pollsters to pass data between themselves when recomputing it would be expensive (e.g., asking another service for a list of objects).
  • resources – A list of resources the pollster will get data from. It’s up to the specific pollster to decide how to use it. It is usually supplied by a discovery, see default_discovery for more information.
test_data = <name: test, volume: 1, resource_id: test_run_tasks, timestamp: 2020-05-29T08:30:32.721985>
class ceilometer.tests.unit.polling.test_manager.TestPollsterBuilder(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollster

classmethod build_pollsters(conf)[source]

Return a list of tuple (name, pollster).

The name is the meter name which the pollster would return, the pollster is a pollster object instance. The pollster which implements this method should be registered in the namespace of ceilometer.builder.xxx instead of ceilometer.poll.xxx.

class ceilometer.tests.unit.polling.test_manager.TestPollsterKeystone(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollster

get_samples(manager, cache, resources)[source]

Return a sequence of Counter instances from polling the resources.

Parameters:
  • manager – The service manager class invoking the plugin.
  • cache – A dictionary to allow pollsters to pass data between themselves when recomputing it would be expensive (e.g., asking another service for a list of objects).
  • resources – A list of resources the pollster will get data from. It’s up to the specific pollster to decide how to use it. It is usually supplied by a discovery, see default_discovery for more information.
class ceilometer.tests.unit.polling.test_manager.TestPollsterPollingException(conf)[source]

Bases: ceilometer.tests.unit.polling.test_manager.TestPollster

discovery = 'test'
get_samples(manager, cache, resources)[source]

Return a sequence of Counter instances from polling the resources.

Parameters:
  • manager – The service manager class invoking the plugin.
  • cache – A dictionary to allow pollsters to pass data between themselves when recomputing it would be expensive (e.g., asking another service for a list of objects).
  • resources – A list of resources the pollster will get data from. It’s up to the specific pollster to decide how to use it. It is usually supplied by a discovery, see default_discovery for more information.
polling_failures = 0
ceilometer.tests.unit.polling.test_manager.default_test_data(name='test')[source]
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.