コード例 #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'
     }
コード例 #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'}
コード例 #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",
     }
コード例 #4
0
ファイル: test_cells_filters.py プロジェクト: ChaosCloud/nova
 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)
コード例 #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'
コード例 #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)
コード例 #7
0
ファイル: test_cells_messaging.py プロジェクト: ameade/nova
 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
コード例 #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
コード例 #9
0
ファイル: test_cells_scheduler.py プロジェクト: unmisha/nova
 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"}
コード例 #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'}
コード例 #11
0
 def setUp(self):
     super(CellsRPCDriverTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self.driver = rpc_driver.CellsRPCDriver()
コード例 #12
0
ファイル: test_cells_messaging.py プロジェクト: ameade/nova
 def setUp(self):
     super(CellsBroadcastMethodsTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self._setup_attrs()
コード例 #13
0
ファイル: test_cells_messaging.py プロジェクト: ameade/nova
 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')
コード例 #14
0
 def setUp(self):
     super(CellsBroadcastMethodsTestCase, self).setUp()
     fakes.init(self)
     self.ctxt = context.RequestContext('fake', 'fake')
     self._setup_attrs()
コード例 #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')