Пример #1
0
    def _test_get_samples(self):
        nm = mock.Mock()
        nm.read_temperature_all.side_effect = self.fake_data
        nm.read_power_all.side_effect = self.fake_data
        nm.read_sensor_any.side_effect = self.fake_sensor_data

        self.mgr = manager.AgentManager()

        self.useFixture(
            mockpatch.Patch(
                'ceilometer.ipmi.platform.intel_node_manager.NodeManager',
                return_value=nm))

        self.useFixture(
            mockpatch.Patch('ceilometer.ipmi.platform.ipmi_sensor.IPMISensor',
                            return_value=nm))

        self.pollster = self.make_pollster()
Пример #2
0
    def _test_get_samples(self):
        nm = mock.Mock()
        nm.read_temperature_all.side_effect = self.fake_data
        nm.read_power_all.side_effect = self.fake_data
        nm.read_sensor_any.side_effect = self.fake_sensor_data
        # We should mock the pollster first before initialize the Manager
        # so that we don't trigger the sudo in pollsters' __init__().
        self.useFixture(
            mockpatch.Patch(
                'ceilometer.ipmi.platform.intel_node_manager.NodeManager',
                return_value=nm))

        self.useFixture(
            mockpatch.Patch('ceilometer.ipmi.platform.ipmi_sensor.IPMISensor',
                            return_value=nm))

        self.mgr = manager.AgentManager()

        self.pollster = self.make_pollster()
Пример #3
0
 def create_manager():
     return manager.AgentManager()
Пример #4
0
 def test_load_plugins(self):
     mgr = manager.AgentManager()
     self.assertIsNotNone(list(mgr.pollster_manager))
Пример #5
0
 def test_load_plugins(self):
     mgr = manager.AgentManager()
     self.assertIsNotNone(list(mgr.extensions))
Пример #6
0
def main():
    service.prepare_service()
    os_service.launch(manager.AgentManager()).wait()