コード例 #1
0
    def setUp(self):
        super(BaseRealNotification, self).setUp()
        self.CONF = self.useFixture(fixture_config.Config()).conf
        # Dummy config file to avoid looking for system config
        service.prepare_service(argv=[], config_files=[])
        self.setup_messaging(self.CONF, 'nova')

        pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
        self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)

        self.expected_samples = 2

        self.CONF.set_override("store_events", True, group="notification")
        self.CONF.set_override("disable_non_metric_meters", False,
                               group="notification")

        ev_pipeline_cfg_file = self.setup_event_pipeline(
            ['compute.instance.*'])
        self.expected_events = 1

        self.CONF.set_override("event_pipeline_cfg_file",
                               ev_pipeline_cfg_file)
        self.CONF.set_override(
            "definitions_cfg_file",
            self.path_get('etc/ceilometer/event_definitions.yaml'),
            group='event')
        self.publisher = test_publisher.TestPublisher("")
コード例 #2
0
    def setUp(self):
        super(BaseRealNotification, self).setUp()
        self.CONF = self.useFixture(fixture_config.Config()).conf
        # Dummy config file to avoid looking for system config
        service.prepare_service(argv=[], config_files=[])
        self.setup_messaging(self.CONF, 'nova')

        pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
        self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)

        self.expected_samples = 2

        self.CONF.set_override("store_events", True, group="notification")
        self.CONF.set_override("disable_non_metric_meters",
                               False,
                               group="notification")

        ev_pipeline_cfg_file = self.setup_event_pipeline(
            ['compute.instance.*'])
        self.expected_events = 1

        self.CONF.set_override("event_pipeline_cfg_file", ev_pipeline_cfg_file)
        self.CONF.set_override(
            "definitions_cfg_file",
            self.path_get('etc/ceilometer/event_definitions.yaml'),
            group='event')
        self.publisher = test_publisher.TestPublisher("")
コード例 #3
0
    def setUp(self):
        super(TestRealNotificationMultipleAgents, self).setUp()
        self.CONF = self.useFixture(fixture_config.Config()).conf
        service.prepare_service(argv=[], config_files=[])
        self.setup_messaging(self.CONF, 'nova')

        pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
        self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)
        self.CONF.set_override("store_events", False, group="notification")
        self.CONF.set_override("disable_non_metric_meters", False,
                               group="notification")
        self.CONF.set_override('workload_partitioning', True,
                               group='notification')
        self.CONF.set_override('pipeline_processing_queues', 2,
                               group='notification')
        self.publisher = test_publisher.TestPublisher("")
        self.publisher2 = test_publisher.TestPublisher("")
コード例 #4
0
    def setUp(self):
        super(TestRealNotificationMultipleAgents, self).setUp()
        self.CONF = self.useFixture(fixture_config.Config()).conf
        service.prepare_service(argv=[], config_files=[])
        self.setup_messaging(self.CONF, 'nova')

        pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
        self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)
        self.CONF.set_override("store_events", False, group="notification")
        self.CONF.set_override("disable_non_metric_meters",
                               False,
                               group="notification")
        self.CONF.set_override('workload_partitioning',
                               True,
                               group='notification')
        self.CONF.set_override('pipeline_processing_queues',
                               2,
                               group='notification')
        self.publisher = test_publisher.TestPublisher("")
        self.publisher2 = test_publisher.TestPublisher("")
コード例 #5
0
    def setUp(self):
        super(BaseRealNotification, self).setUp()
        self.CONF = self.useFixture(fixture_config.Config()).conf
        service.prepare_service([])
        self.setup_messaging(self.CONF, 'nova')

        pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
        self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)

        self.expected_samples = 2

        self.CONF.set_override("store_events", True, group="notification")
        self.CONF.set_override("disable_non_metric_meters",
                               False,
                               group="notification")
        ev_pipeline = yaml.dump({
            'sources': [{
                'name': 'test_event',
                'events': ['compute.instance.*'],
                'sinks': ['test_sink']
            }],
            'sinks': [{
                'name': 'test_sink',
                'publishers': ['test://']
            }]
        })
        if six.PY3:
            ev_pipeline = ev_pipeline.encode('utf-8')
        self.expected_events = 1
        ev_pipeline_cfg_file = fileutils.write_to_tempfile(
            content=ev_pipeline, prefix="event_pipeline", suffix="yaml")
        self.CONF.set_override("event_pipeline_cfg_file", ev_pipeline_cfg_file)
        self.CONF.set_override(
            "definitions_cfg_file",
            self.path_get('etc/ceilometer/event_definitions.yaml'),
            group='event')
        self.publisher = test_publisher.TestPublisher("")
コード例 #6
0
    def setUp(self):
        super(BaseRealNotification, self).setUp()
        self.CONF = self.useFixture(fixture_config.Config()).conf
        # Dummy config file to avoid looking for system config
        service.prepare_service(argv=[], config_files=[])
        self.setup_messaging(self.CONF, 'nova')

        pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
        self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)

        self.expected_samples = 2

        self.CONF.set_override("store_events", True, group="notification")
        self.CONF.set_override("disable_non_metric_meters", False,
                               group="notification")
        ev_pipeline = yaml.dump({
            'sources': [{
                'name': 'test_event',
                'events': ['compute.instance.*'],
                'sinks': ['test_sink']
            }],
            'sinks': [{
                'name': 'test_sink',
                'publishers': ['test://']
            }]
        })
        if six.PY3:
            ev_pipeline = ev_pipeline.encode('utf-8')
        self.expected_events = 1
        ev_pipeline_cfg_file = fileutils.write_to_tempfile(
            content=ev_pipeline, prefix="event_pipeline", suffix="yaml")
        self.CONF.set_override("event_pipeline_cfg_file", ev_pipeline_cfg_file)
        self.CONF.set_override(
            "definitions_cfg_file",
            self.path_get('etc/ceilometer/event_definitions.yaml'),
            group='event')
        self.publisher = test_publisher.TestPublisher("")