示例#1
0
 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",
     }
示例#2
0
 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'
     }
示例#3
0
 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'
示例#4
0
 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'
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 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'}
示例#8
0
 def setUp(self):
     super(CellsRPCDriverTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self.driver = rpc_driver.CellsRPCDriver()