Merge "fakelibvirt: make kB_mem default not laughable"
This commit is contained in:
commit
29c841b9bc
|
@ -18,7 +18,6 @@ import io
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
import mock
|
import mock
|
||||||
from oslo_utils import units
|
|
||||||
|
|
||||||
from nova import conf
|
from nova import conf
|
||||||
from nova.tests import fixtures as nova_fixtures
|
from nova.tests import fixtures as nova_fixtures
|
||||||
|
@ -91,9 +90,7 @@ class ServersTestBase(integrated_helpers._IntegratedTestBase):
|
||||||
):
|
):
|
||||||
if not host_info:
|
if not host_info:
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo(
|
||||||
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=2,
|
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=(16 * units.Gi) // units.Ki,
|
|
||||||
)
|
|
||||||
|
|
||||||
# sanity check
|
# sanity check
|
||||||
self.assertGreater(16, host_info.cpus,
|
self.assertGreater(16, host_info.cpus,
|
||||||
|
|
|
@ -118,13 +118,11 @@ class NUMALiveMigrationPositiveBase(NUMALiveMigrationBase):
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='host_a',
|
hostname='host_a',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=1,
|
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=1))
|
||||||
kB_mem=10740000))
|
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='host_b',
|
hostname='host_b',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=1,
|
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=1))
|
||||||
kB_mem=10740000))
|
|
||||||
|
|
||||||
# Create a 2-CPU flavor
|
# Create a 2-CPU flavor
|
||||||
extra_spec = {'hw:cpu_policy': 'dedicated'}
|
extra_spec = {'hw:cpu_policy': 'dedicated'}
|
||||||
|
@ -470,14 +468,10 @@ class NUMALiveMigrationLegacyBase(NUMALiveMigrationPositiveBase):
|
||||||
def _test(self, pin_source, pin_cond, expect_success=True):
|
def _test(self, pin_source, pin_cond, expect_success=True):
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='source',
|
hostname='source',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo())
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
|
||||||
kB_mem=10740000))
|
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='dest',
|
hostname='dest',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo())
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
|
||||||
kB_mem=10740000))
|
|
||||||
|
|
||||||
ctxt = context.get_admin_context()
|
ctxt = context.get_admin_context()
|
||||||
src_mgr = self.computes['source'].manager
|
src_mgr = self.computes['source'].manager
|
||||||
|
@ -597,13 +591,11 @@ class NUMALiveMigrationNegativeTests(NUMALiveMigrationBase):
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='host_a',
|
hostname='host_a',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=3, cpu_threads=1,
|
cpu_nodes=1, cpu_sockets=1, cpu_cores=3, cpu_threads=1))
|
||||||
kB_mem=10740000))
|
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='host_b',
|
hostname='host_b',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=1))
|
||||||
kB_mem=10740000))
|
|
||||||
|
|
||||||
extra_spec = {'hw:numa_nodes': 1,
|
extra_spec = {'hw:numa_nodes': 1,
|
||||||
'hw:cpu_policy': 'dedicated'}
|
'hw:cpu_policy': 'dedicated'}
|
||||||
|
@ -638,14 +630,12 @@ class NUMALiveMigrationNegativeTests(NUMALiveMigrationBase):
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='host_a',
|
hostname='host_a',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
|
||||||
kB_mem=1024000, mempages={
|
kB_mem=1024000, mempages={
|
||||||
0: fakelibvirt.create_mempages([(4, 256000), (1024, 1000)])
|
0: fakelibvirt.create_mempages([(4, 256000), (1024, 1000)])
|
||||||
}))
|
}))
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='host_b',
|
hostname='host_b',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
|
||||||
kB_mem=1024000, mempages={
|
kB_mem=1024000, mempages={
|
||||||
0: fakelibvirt.create_mempages([(4, 256000), (2048, 500)]),
|
0: fakelibvirt.create_mempages([(4, 256000), (2048, 500)]),
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -105,8 +105,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {'hw:numa_nodes': '2'}
|
extra_spec = {'hw:numa_nodes': '2'}
|
||||||
|
@ -128,8 +127,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
separate host NUMA node.
|
separate host NUMA node.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo()
|
||||||
cpu_cores=2, kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {'hw:numa_nodes': '2'}
|
extra_spec = {'hw:numa_nodes': '2'}
|
||||||
|
@ -145,8 +143,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=2,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=2,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=(1024 * 1024 * 16)) # GB
|
|
||||||
# create 1024 * 2 MB huge pages, and allocate the rest of the 16 GB as
|
# create 1024 * 2 MB huge pages, and allocate the rest of the 16 GB as
|
||||||
# small pages
|
# small pages
|
||||||
for cell in host_info.numa_topology.cells:
|
for cell in host_info.numa_topology.cells:
|
||||||
|
@ -177,8 +174,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=2,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=2,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=(1024 * 1024 * 16)) # GB
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
# create 512 * 2 MB huge pages, and allocate the rest of the 16 GB as
|
# create 512 * 2 MB huge pages, and allocate the rest of the 16 GB as
|
||||||
|
@ -207,8 +203,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
||||||
cpu_cores=5, cpu_threads=2,
|
cpu_cores=5, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {
|
extra_spec = {
|
||||||
|
@ -240,8 +235,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo(
|
||||||
cpu_nodes=2, cpu_sockets=1, cpu_cores=4, cpu_threads=1,
|
cpu_nodes=2, cpu_sockets=1, cpu_cores=4, cpu_threads=1)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
# sanity check the created host topology object; this is really just a
|
# sanity check the created host topology object; this is really just a
|
||||||
|
@ -297,8 +291,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo(
|
||||||
cpu_nodes=2, cpu_sockets=1, cpu_cores=4, cpu_threads=1,
|
cpu_nodes=2, cpu_sockets=1, cpu_cores=4, cpu_threads=1)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
# sanity check the created host topology object; this is really just a
|
# sanity check the created host topology object; this is really just a
|
||||||
|
@ -338,8 +331,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set='0-7')
|
self.flags(vcpu_pin_set='0-7')
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {
|
extra_spec = {
|
||||||
|
@ -367,9 +359,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
# host has hyperthreads, which means we're going to end up consuming
|
# host has hyperthreads, which means we're going to end up consuming
|
||||||
# $flavor.vcpu hosts cores plus the thread sibling(s) for each core
|
# $flavor.vcpu hosts cores plus the thread sibling(s) for each core
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=2,
|
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=(1024 * 1024 * 16), # GB
|
|
||||||
)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {
|
extra_spec = {
|
||||||
|
@ -402,8 +392,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
||||||
cpu_cores=5, cpu_threads=2,
|
cpu_cores=5, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {
|
extra_spec = {
|
||||||
|
@ -423,8 +412,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {
|
extra_spec = {
|
||||||
|
@ -454,9 +442,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
|
|
||||||
# host has hyperthreads, which means it should be rejected
|
# host has hyperthreads, which means it should be rejected
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo(
|
||||||
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=2,
|
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=(1024 * 1024 * 16), # GB
|
|
||||||
)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {
|
extra_spec = {
|
||||||
|
@ -478,8 +464,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {'resources:PCPU': '2'}
|
extra_spec = {'resources:PCPU': '2'}
|
||||||
|
@ -506,8 +491,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
||||||
cpu_cores=5, cpu_threads=2,
|
cpu_cores=5, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {'resources:PCPU': 2}
|
extra_spec = {'resources:PCPU': 2}
|
||||||
|
@ -526,8 +510,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vcpu_pin_set=None)
|
self.flags(vcpu_pin_set=None)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
extra_spec = {'resources:PCPU': '2'}
|
extra_spec = {'resources:PCPU': '2'}
|
||||||
|
@ -575,8 +558,7 @@ class NUMAServersTest(NUMAServersTestBase):
|
||||||
self.flags(vif_plugging_timeout=0)
|
self.flags(vif_plugging_timeout=0)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
|
|
||||||
# Start services
|
# Start services
|
||||||
self.start_compute(host_info=host_info, hostname='test_compute0')
|
self.start_compute(host_info=host_info, hostname='test_compute0')
|
||||||
|
@ -1300,7 +1282,7 @@ class NUMAServersRebuildTests(NUMAServersTestBase):
|
||||||
# the free space to ensure the numa topology filter does not
|
# the free space to ensure the numa topology filter does not
|
||||||
# eliminate the host.
|
# eliminate the host.
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1,
|
||||||
cpu_cores=4, kB_mem=15740000)
|
cpu_cores=4)
|
||||||
self.start_compute(host_info=host_info)
|
self.start_compute(host_info=host_info)
|
||||||
|
|
||||||
server = self._create_active_server(
|
server = self._create_active_server(
|
||||||
|
@ -1324,8 +1306,7 @@ class NUMAServersRebuildTests(NUMAServersTestBase):
|
||||||
# cpu_cores is set to 2 to ensure that we have enough space
|
# cpu_cores is set to 2 to ensure that we have enough space
|
||||||
# to boot the vm but not enough space to rebuild
|
# to boot the vm but not enough space to rebuild
|
||||||
# by doubling the resource use during scheduling.
|
# by doubling the resource use during scheduling.
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo()
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info)
|
self.start_compute(host_info=host_info)
|
||||||
|
|
||||||
server = self._create_active_server(
|
server = self._create_active_server(
|
||||||
|
@ -1344,7 +1325,7 @@ class NUMAServersRebuildTests(NUMAServersTestBase):
|
||||||
flavor_id = self._create_flavor(extra_spec=extra_spec)
|
flavor_id = self._create_flavor(extra_spec=extra_spec)
|
||||||
|
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo(
|
||||||
cpu_nodes=2, cpu_sockets=1, cpu_cores=4, kB_mem=15740000)
|
cpu_nodes=2, cpu_sockets=1, cpu_cores=4)
|
||||||
self.start_compute(host_info=host_info)
|
self.start_compute(host_info=host_info)
|
||||||
|
|
||||||
server = self._create_active_server(
|
server = self._create_active_server(
|
||||||
|
|
|
@ -617,8 +617,7 @@ class SRIOVAttachDetachTest(_PCIServersTestBase):
|
||||||
# second port and asserts that it fails as no free PCI device left on
|
# second port and asserts that it fails as no free PCI device left on
|
||||||
# the host.
|
# the host.
|
||||||
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2)
|
||||||
kB_mem=15740000)
|
|
||||||
pci_info = fakelibvirt.HostPCIDevicesInfo(num_pfs=1, num_vfs=1)
|
pci_info = fakelibvirt.HostPCIDevicesInfo(num_pfs=1, num_vfs=1)
|
||||||
fake_connection = self._get_connection(host_info, pci_info)
|
fake_connection = self._get_connection(host_info, pci_info)
|
||||||
self.mock_conn.return_value = fake_connection
|
self.mock_conn.return_value = fake_connection
|
||||||
|
|
|
@ -96,8 +96,7 @@ class VPMEMTestBase(integrated_helpers.LibvirtProviderUsageBaseTestCase):
|
||||||
fake_connection = self._get_connection(
|
fake_connection = self._get_connection(
|
||||||
# Need a host to support creating more servers with vpmems
|
# Need a host to support creating more servers with vpmems
|
||||||
host_info=fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
host_info=fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
|
||||||
cpu_cores=2, cpu_threads=2,
|
cpu_cores=2, cpu_threads=2),
|
||||||
kB_mem=15740000),
|
|
||||||
hostname=hostname)
|
hostname=hostname)
|
||||||
self.mock_conn.return_value = fake_connection
|
self.mock_conn.return_value = fake_connection
|
||||||
compute = self._start_compute(host=hostname)
|
compute = self._start_compute(host=hostname)
|
||||||
|
|
|
@ -64,13 +64,11 @@ class TestLiveMigrationWithoutMultiplePortBindings(
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='start_host',
|
hostname='start_host',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=2,
|
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=2))
|
||||||
kB_mem=10740000))
|
|
||||||
self.start_compute(
|
self.start_compute(
|
||||||
hostname='end_host',
|
hostname='end_host',
|
||||||
host_info=fakelibvirt.HostInfo(
|
host_info=fakelibvirt.HostInfo(
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=2,
|
cpu_nodes=1, cpu_sockets=1, cpu_cores=4, cpu_threads=2))
|
||||||
kB_mem=10740000))
|
|
||||||
|
|
||||||
self.ctxt = context.get_admin_context()
|
self.ctxt = context.get_admin_context()
|
||||||
# TODO(sean-k-mooney): remove this when it is part of ServersTestBase
|
# TODO(sean-k-mooney): remove this when it is part of ServersTestBase
|
||||||
|
|
|
@ -39,8 +39,7 @@ class TestVolAttachmentsAfterFailureToScheduleOrBuild(base.ServersTestBase):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
|
|
||||||
# Launch a single libvirt based compute service with a single NUMA node
|
# Launch a single libvirt based compute service with a single NUMA node
|
||||||
host_info = fakelibvirt.HostInfo(
|
host_info = fakelibvirt.HostInfo()
|
||||||
cpu_nodes=1, cpu_sockets=1, cpu_cores=2, kB_mem=15740000)
|
|
||||||
self.start_compute(host_info=host_info, hostname='compute1')
|
self.start_compute(host_info=host_info, hostname='compute1')
|
||||||
|
|
||||||
# Use a flavor requesting 2 NUMA nodes that we know will always fail
|
# Use a flavor requesting 2 NUMA nodes that we know will always fail
|
||||||
|
|
|
@ -579,7 +579,7 @@ class HostMdevDevicesInfo(object):
|
||||||
class HostInfo(object):
|
class HostInfo(object):
|
||||||
|
|
||||||
def __init__(self, cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
def __init__(self, cpu_nodes=1, cpu_sockets=1, cpu_cores=2, cpu_threads=1,
|
||||||
kB_mem=4096, mempages=None):
|
kB_mem=16780000, mempages=None):
|
||||||
"""Create a new Host Info object
|
"""Create a new Host Info object
|
||||||
|
|
||||||
:param cpu_nodes: (int) the number of NUMA cell, 1 for unusual
|
:param cpu_nodes: (int) the number of NUMA cell, 1 for unusual
|
||||||
|
|
|
@ -102,7 +102,7 @@ class FakeLibvirtTests(test.NoDBTestCase):
|
||||||
obj_fields.Architecture.X86_64))
|
obj_fields.Architecture.X86_64))
|
||||||
|
|
||||||
self.assertLessEqual(1024, res[1], "Memory unusually high.")
|
self.assertLessEqual(1024, res[1], "Memory unusually high.")
|
||||||
self.assertGreaterEqual(16384, res[1], "Memory unusually low.")
|
self.assertGreaterEqual(17000000, res[1], "Memory unusually low.")
|
||||||
self.assertLessEqual(1, res[2], "Active CPU count unusually high.")
|
self.assertLessEqual(1, res[2], "Active CPU count unusually high.")
|
||||||
self.assertGreaterEqual(32, res[2], "Active CPU count unusually low.")
|
self.assertGreaterEqual(32, res[2], "Active CPU count unusually low.")
|
||||||
self.assertLessEqual(800, res[3], "CPU speed unusually high.")
|
self.assertLessEqual(800, res[3], "CPU speed unusually high.")
|
||||||
|
|
Loading…
Reference in New Issue