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 range(3): instance_uuids.append(uuidutils.generate_uuid()) self.instance_uuids = instance_uuids self.instances = [objects.Instance(uuid=uuid, id=id) for id, uuid in enumerate(instance_uuids)] self.request_spec = { "num_instances": len(instance_uuids), "instance_properties": self.instances[0], "instance_type": "fake_type", "image": "fake_image", } 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 = [ objects.Instance(uuid=uuid, id=id) for id, uuid in enumerate(instance_uuids) ] self.request_spec = { 'num_instances': len(instance_uuids), 'instance_properties': self.instances[0], 'instance_type': 'fake_type', 'image': 'fake_image' } 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(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.state_manager = fakes.get_state_manager(self.our_cell) 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(_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() filter_classes = self.filter_handler.get_matching_classes([self.filter_cls_name]) self.filters = [cls() for cls in filter_classes] self.context = context.RequestContext("fake", "fake", is_admin=True)
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': self.instances[0], 'instance_type': 'fake_type', 'image': 'fake_image'} 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(CellsRPCDriverTestCase, self).setUp() fakes.init(self) self.ctxt = context.RequestContext('fake', 'fake') self.driver = rpc_driver.CellsRPCDriver()