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()
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()
def create_manager(): return manager.AgentManager()
def test_load_plugins(self): mgr = manager.AgentManager() self.assertIsNotNone(list(mgr.pollster_manager))
def test_load_plugins(self): mgr = manager.AgentManager() self.assertIsNotNone(list(mgr.extensions))
def main(): service.prepare_service() os_service.launch(manager.AgentManager()).wait()