def _init_cells_scheduler(self): fakes.init(self) self.msg_runner = fakes.get_message_runner('api-cell') self.scheduler = self.msg_runner.scheduler self.state_manager = self.msg_runner.state_manager self.my_cell_state = self.state_manager.get_my_state() self.ctxt = context.RequestContext('fake', 'fake') instance_uuids = [] for x in xrange(3): instance_uuids.append(uuidutils.generate_uuid()) self.instance_uuids = instance_uuids self.instances = [{'uuid': uuid} for uuid in instance_uuids] self.request_spec = { 'instance_uuids': instance_uuids, 'instance_properties': 'fake_properties', 'instance_type': 'fake_type', 'image': 'fake_image', 'security_group': 'fake_sec_groups', 'block_device_mapping': 'fake_bdm' } self.build_inst_kwargs = { 'instances': self.instances, 'image': 'fake_image', 'filter_properties': { 'instance_type': 'fake_type' }, 'security_groups': 'fake_sec_groups', 'block_device_mapping': 'fake_bdm' }
def _init_cells_scheduler(self): fakes.init(self) self.msg_runner = fakes.get_message_runner('api-cell') self.scheduler = self.msg_runner.scheduler self.state_manager = self.msg_runner.state_manager self.my_cell_state = self.state_manager.get_my_state() self.ctxt = context.RequestContext('fake', 'fake') instance_uuids = [] for x in xrange(3): instance_uuids.append(uuidutils.generate_uuid()) self.instance_uuids = instance_uuids self.instances = [{'uuid': uuid} for uuid in instance_uuids] self.request_spec = { 'instance_uuids': instance_uuids, 'instance_properties': 'fake_properties', 'instance_type': 'fake_type', 'image': 'fake_image', 'security_group': 'fake_sec_groups', 'block_device_mapping': 'fake_bdm'} self.build_inst_kwargs = { 'instances': self.instances, 'image': 'fake_image', 'filter_properties': {'instance_type': 'fake_type'}, 'security_groups': 'fake_sec_groups', 'block_device_mapping': 'fake_bdm'}
def _init_cells_scheduler(self): fakes.init(self) self.msg_runner = fakes.get_message_runner("api-cell") self.scheduler = self.msg_runner.scheduler self.state_manager = self.msg_runner.state_manager self.my_cell_state = self.state_manager.get_my_state() self.ctxt = context.RequestContext("fake", "fake") instance_uuids = [] for x in xrange(3): instance_uuids.append(uuidutils.generate_uuid()) self.instance_uuids = instance_uuids self.instances = [{"uuid": uuid} for uuid in instance_uuids] self.request_spec = { "instance_uuids": instance_uuids, "instance_properties": "fake_properties", "instance_type": "fake_type", "image": "fake_image", "security_group": "fake_sec_groups", "block_device_mapping": "fake_bdm", } self.build_inst_kwargs = { "instances": self.instances, "image": "fake_image", "filter_properties": {"instance_type": "fake_type"}, "security_groups": "fake_sec_groups", "block_device_mapping": "fake_bdm", }
def setUp(self): super(_FilterTestClass, self).setUp() fakes.init(self) self.msg_runner = fakes.get_message_runner("api-cell") self.scheduler = self.msg_runner.scheduler self.my_cell_state = self.msg_runner.state_manager.get_my_state() self.filter_handler = filters.CellFilterHandler() self.filter_classes = self.filter_handler.get_matching_classes([self.filter_cls_name]) self.context = context.RequestContext("fake", "fake", is_admin=True)
def setUp(self): super(CellsManagerClassTestCase, self).setUp() fakes.init(self) # pick a child cell to use for tests. self.our_cell = 'grandchild-cell1' self.cells_manager = fakes.get_cells_manager(self.our_cell) self.msg_runner = self.cells_manager.msg_runner self.driver = self.cells_manager.driver self.ctxt = 'fake_context'
def setUp(self): super(_FilterTestClass, self).setUp() fakes.init(self) self.msg_runner = fakes.get_message_runner('api-cell') self.scheduler = self.msg_runner.scheduler self.my_cell_state = self.msg_runner.state_manager.get_my_state() self.filter_handler = filters.CellFilterHandler() self.filter_classes = self.filter_handler.get_matching_classes( [self.filter_cls_name]) self.context = context.RequestContext('fake', 'fake', is_admin=True)
def setUp(self): super(CellsMessageClassesTestCase, self).setUp() fakes.init(self) self.ctxt = context.RequestContext('fake', 'fake') # Need to be able to deserialize test.TestingException. allowed_modules = CONF.allowed_rpc_exception_modules allowed_modules.append('nova.test') self.flags(allowed_rpc_exception_modules=allowed_modules) self.our_name = 'api-cell' self.msg_runner = fakes.get_message_runner(self.our_name) self.state_manager = self.msg_runner.state_manager
def _init_cells_scheduler(self): fakes.init(self) self.msg_runner = fakes.get_message_runner("api-cell") self.scheduler = self.msg_runner.scheduler self.state_manager = self.msg_runner.state_manager self.my_cell_state = self.state_manager.get_my_state() self.ctxt = context.RequestContext("fake", "fake") instance_uuids = [] for x in xrange(3): instance_uuids.append(uuidutils.generate_uuid()) self.instance_uuids = instance_uuids self.request_spec = {"instance_uuids": instance_uuids, "other": "stuff"}
def setUp(self): super(CellsSchedulerTestCase, self).setUp() fakes.init(self) self.msg_runner = fakes.get_message_runner('api-cell') self.scheduler = self.msg_runner.scheduler self.state_manager = self.msg_runner.state_manager self.my_cell_state = self.state_manager.get_my_state() self.ctxt = context.RequestContext('fake', 'fake') instance_uuids = [] for x in xrange(3): instance_uuids.append(uuidutils.generate_uuid()) self.instance_uuids = instance_uuids self.request_spec = {'instance_uuids': instance_uuids, 'other': 'stuff'}
def setUp(self): super(CellsRPCDriverTestCase, self).setUp() fakes.init(self) self.ctxt = context.RequestContext('fake', 'fake') self.driver = rpc_driver.CellsRPCDriver()
def setUp(self): super(CellsBroadcastMethodsTestCase, self).setUp() fakes.init(self) self.ctxt = context.RequestContext('fake', 'fake') self._setup_attrs()
def setUp(self): super(CellsTargetedMethodsTestCase, self).setUp() fakes.init(self) self.ctxt = context.RequestContext('fake', 'fake') self._setup_attrs('api-cell', 'api-cell!child-cell2')