Exemplo n.º 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 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'
     }
Exemplo n.º 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 = [{'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'}
Exemplo n.º 3
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": "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",
     }
Exemplo n.º 4
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)
Exemplo n.º 5
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.driver = self.cells_manager.driver
     self.ctxt = 'fake_context'
Exemplo n.º 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()
     self.filter_classes = self.filter_handler.get_matching_classes(
         [self.filter_cls_name])
     self.context = context.RequestContext('fake', 'fake', is_admin=True)
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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
Exemplo n.º 9
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.request_spec = {"instance_uuids": instance_uuids, "other": "stuff"}
Exemplo n.º 10
0
 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'}
Exemplo n.º 11
0
 def setUp(self):
     super(CellsRPCDriverTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self.driver = rpc_driver.CellsRPCDriver()
Exemplo n.º 12
0
 def setUp(self):
     super(CellsBroadcastMethodsTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self._setup_attrs()
Exemplo n.º 13
0
 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')
Exemplo n.º 14
0
 def setUp(self):
     super(CellsBroadcastMethodsTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self._setup_attrs()
Exemplo n.º 15
0
 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')