Exemplo n.º 1
0
 def setUp(self, mock_init_agg, mock_init_inst):
     super(IronicHostManagerChangedNodesTestCase, self).setUp()
     self.host_manager = ironic_host_manager.IronicHostManager()
     ironic_driver = "nova.virt.ironic.driver.IronicDriver"
     supported_instances = [
         objects.HVSpec.from_list(["i386", "baremetal", "baremetal"])
     ]
     self.compute_node = objects.ComputeNode(
         id=1,
         local_gb=10,
         memory_mb=1024,
         vcpus=1,
         vcpus_used=0,
         local_gb_used=0,
         memory_mb_used=0,
         updated_at=None,
         cpu_info='baremetal cpu',
         stats=dict(ironic_driver=ironic_driver, cpu_arch='i386'),
         supported_hv_specs=supported_instances,
         free_disk_gb=10,
         free_ram_mb=1024,
         hypervisor_type='ironic',
         hypervisor_version=1,
         hypervisor_hostname='fake_host',
         cpu_allocation_ratio=16.0,
         ram_allocation_ratio=1.5)
Exemplo n.º 2
0
 def setUp(self):
     super(IronicHostManagerTestFilters, self).setUp()
     self.host_manager = ironic_host_manager.IronicHostManager()
     self.fake_hosts = [ironic_host_manager.IronicNodeState(
             'fake_host%s' % x, 'fake-node') for x in range(1, 5)]
     self.fake_hosts += [ironic_host_manager.IronicNodeState(
             'fake_multihost', 'fake-node%s' % x) for x in range(1, 5)]
Exemplo n.º 3
0
    def test_host_manager_default_filters_uses_baremetal(
            self, mock_init_agg, mock_init_inst):
        self.flags(scheduler_use_baremetal_filters=True)
        host_manager = ironic_host_manager.IronicHostManager()

        # ensure the defaults come from baremetal_scheduler_default_filters
        # and not scheduler_default_filters
        default_filters = host_manager.default_filters
        self.assertEqual(1, len(default_filters))
        self.assertIsInstance(default_filters[0], FakeFilterClass2)
Exemplo n.º 4
0
    def test_host_manager_enabled_filters_uses_baremetal(
            self, mock_init_agg, mock_init_inst):
        self.flags(use_baremetal_filters=True, group='filter_scheduler')
        host_manager = ironic_host_manager.IronicHostManager()

        # ensure the defaults come from scheduler.baremetal_enabled_filters
        # and not enabled_filters
        enabled_filters = host_manager.enabled_filters
        self.assertEqual(1, len(enabled_filters))
        self.assertIsInstance(enabled_filters[0], FakeFilterClass2)
Exemplo n.º 5
0
 def setUp(self):
     super(IronicHostManagerTestFilters, self).setUp()
     self.flags(scheduler_available_filters=['%s.%s' % (__name__, cls) for
                                             cls in ['FakeFilterClass1',
                                                     'FakeFilterClass2']])
     self.host_manager = ironic_host_manager.IronicHostManager()
     self.fake_hosts = [ironic_host_manager.IronicNodeState(
             'fake_host%s' % x, 'fake-node') for x in range(1, 5)]
     self.fake_hosts += [ironic_host_manager.IronicNodeState(
             'fake_multihost', 'fake-node%s' % x) for x in range(1, 5)]
Exemplo n.º 6
0
 def setUp(self, mock_init_agg, mock_init_inst):
     super(IronicHostManagerTestFilters, self).setUp()
     self.flags(available_filters=[
         __name__ + '.FakeFilterClass1', __name__ + '.FakeFilterClass2'],
                group='filter_scheduler')
     self.flags(enabled_filters=['FakeFilterClass1'],
                group='filter_scheduler')
     self.flags(baremetal_enabled_filters=['FakeFilterClass2'],
                group='filter_scheduler')
     self.host_manager = ironic_host_manager.IronicHostManager()
     self.fake_hosts = [ironic_host_manager.IronicNodeState(
             'fake_host%s' % x, 'fake-node') for x in range(1, 5)]
     self.fake_hosts += [ironic_host_manager.IronicNodeState(
             'fake_multihost', 'fake-node%s' % x) for x in range(1, 5)]
Exemplo n.º 7
0
 def setUp(self):
     super(IronicHostManagerChangedNodesTestCase, self).setUp()
     self.host_manager = ironic_host_manager.IronicHostManager()
     ironic_driver = "nova.virt.ironic.driver.IronicDriver"
     supported_instances = '[["i386", "baremetal", "baremetal"]]'
     self.compute_node = dict(id=1, local_gb=10, memory_mb=1024, vcpus=1,
                         vcpus_used=0, local_gb_used=0, memory_mb_used=0,
                         updated_at=None, cpu_info='baremetal cpu',
                             stats=jsonutils.dumps(dict(
                                 ironic_driver=ironic_driver,
                                 cpu_arch='i386')),
                         supported_instances=supported_instances,
                         free_disk_gb=10, free_ram_mb=1024,
                         hypervisor_type='ironic',
                         hypervisor_version = 1,
                         hypervisor_hostname = 'fake_host')
Exemplo n.º 8
0
 def setUp(self):
     super(IronicHostManagerChangedNodesTestCase, self).setUp()
     self.host_manager = ironic_host_manager.IronicHostManager()
     self.fake_hosts = [
         ironic_host_manager.IronicNodeState('host1', 'node1uuid'),
         ironic_host_manager.IronicNodeState('host2', 'node2uuid'),
         ironic_host_manager.IronicNodeState('host3', 'node3uuid'),
         ironic_host_manager.IronicNodeState('host4', 'node4uuid')
     ]
     self.compute_node = dict(
         id=1,
         local_gb=10,
         memory_mb=1024,
         vcpus=1,
         vcpus_used=0,
         local_gb_used=0,
         memory_mb_used=0,
         updated_at=None,
         cpu_info='baremetal cpu',
         stats=dict(ironic_driver="nova.virt.ironic.driver.IronicDriver",
                    cpu_arch='i386'),
         supported_instances='[["i386", "baremetal", "baremetal"]]',
         free_disk_gb=10,
         free_ram_mb=1024)
Exemplo n.º 9
0
 def setUp(self, mock_init_agg, mock_init_inst):
     super(IronicHostManagerTestCase, self).setUp()
     self.host_manager = ironic_host_manager.IronicHostManager()
 def setUp(self):
     super(IronicHostManagerTestCase, self).setUp()
     self.host_manager = ironic_host_manager.IronicHostManager()