diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py index 09d936221d4d..3847f18831b0 100644 --- a/nova/tests/functional/libvirt/test_numa_servers.py +++ b/nova/tests/functional/libvirt/test_numa_servers.py @@ -92,9 +92,9 @@ class NUMAServersTest(NUMAServersTestBase): def test_create_server_with_numa_topology(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) fake_connection = self._get_connection(host_info=host_info) self.mock_conn.return_value = fake_connection @@ -106,9 +106,9 @@ class NUMAServersTest(NUMAServersTestBase): def test_create_server_with_pinning(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=1, cpu_sockets=1, - cpu_cores=5, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1, + cpu_cores=5, cpu_threads=2, + kB_mem=15740000) fake_connection = self._get_connection(host_info=host_info) self.mock_conn.return_value = fake_connection @@ -128,8 +128,8 @@ class NUMAServersTest(NUMAServersTestBase): def test_create_server_with_numa_fails(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=1, cpu_sockets=1, - cpu_cores=2, kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1, + cpu_cores=2, kB_mem=15740000) fake_connection = self._get_connection(host_info=host_info) self.mock_conn.return_value = fake_connection @@ -159,9 +159,9 @@ class NUMAServersWithNetworksTest(NUMAServersTestBase): self.neutron = self.useFixture(base.LibvirtNeutronFixture(self)) def _test_create_server_with_networks(self, flavor_id, networks): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) fake_connection = self._get_connection(host_info=host_info) self.mock_conn.return_value = fake_connection @@ -300,9 +300,9 @@ class NUMAServersWithNetworksTest(NUMAServersTestBase): self.assertIn('NoValidHost', six.text_type(ex)) def test_cold_migrate_with_physnet(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) # Start services self.computes = {} @@ -366,14 +366,14 @@ class NUMAServersWithNetworksTest(NUMAServersTestBase): def test_cold_migrate_with_physnet_fails(self): host_infos = [ # host 1 has room on both nodes - fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000), + fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000), # host 2 has no second node, where the desired physnet is # reported to be attached - fakelibvirt.NUMAHostInfo(cpu_nodes=1, cpu_sockets=1, - cpu_cores=1, cpu_threads=1, - kB_mem=15740000), + fakelibvirt.HostInfo(cpu_nodes=1, cpu_sockets=1, + cpu_cores=1, cpu_threads=1, + kB_mem=15740000), ] # Start services diff --git a/nova/tests/functional/libvirt/test_pci_sriov_servers.py b/nova/tests/functional/libvirt/test_pci_sriov_servers.py index a52977b941c1..3d1ed4a86c1d 100644 --- a/nova/tests/functional/libvirt/test_pci_sriov_servers.py +++ b/nova/tests/functional/libvirt/test_pci_sriov_servers.py @@ -128,9 +128,9 @@ class SRIOVServersTest(_PCIServersTestBase): def test_create_server_with_VF(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo() fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -143,9 +143,9 @@ class SRIOVServersTest(_PCIServersTestBase): def test_create_server_with_PF(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo() fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -158,9 +158,9 @@ class SRIOVServersTest(_PCIServersTestBase): def test_create_server_with_PF_no_VF(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo(num_pfs=1, num_vfs=4) fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -178,9 +178,9 @@ class SRIOVServersTest(_PCIServersTestBase): def test_create_server_with_VF_no_PF(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo(num_pfs=1, num_vfs=4) fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -231,9 +231,9 @@ class GetServerDiagnosticsServerWithVfTestV21(_PCIServersTestBase): def test_get_server_diagnostics_server_with_VF(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo() fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -295,9 +295,9 @@ class PCIServersTest(_PCIServersTestBase): assigned pci device. """ - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo(num_pci=1, numa_node=1) fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -316,9 +316,9 @@ class PCIServersTest(_PCIServersTestBase): memory resources from one NUMA node and a PCI device from another. """ - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo(num_pci=1, numa_node=0) fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection @@ -365,9 +365,9 @@ class PCIServersWithNUMAPoliciesTest(_PCIServersTestBase): NUMA policies are in use. """ - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) pci_info = fakelibvirt.HostPCIDevicesInfo(num_pci=1, numa_node=0) fake_connection = self._get_connection(host_info, pci_info) self.mock_conn.return_value = fake_connection diff --git a/nova/tests/functional/libvirt/test_rt_servers.py b/nova/tests/functional/libvirt/test_rt_servers.py index 7b1735eee901..14664bf88f27 100644 --- a/nova/tests/functional/libvirt/test_rt_servers.py +++ b/nova/tests/functional/libvirt/test_rt_servers.py @@ -44,9 +44,9 @@ class RealTimeServersTest(base.ServersTestBase): self.api.post_server, {'server': server}) def test_success(self): - host_info = fakelibvirt.NUMAHostInfo(cpu_nodes=2, cpu_sockets=1, - cpu_cores=2, cpu_threads=2, - kB_mem=15740000) + host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1, + cpu_cores=2, cpu_threads=2, + kB_mem=15740000) fake_connection = self._get_connection(host_info=host_info) self.mock_conn.return_value = fake_connection diff --git a/nova/tests/unit/virt/libvirt/fakelibvirt.py b/nova/tests/unit/virt/libvirt/fakelibvirt.py index 7f96943de56f..a3bc3d083804 100644 --- a/nova/tests/unit/virt/libvirt/fakelibvirt.py +++ b/nova/tests/unit/virt/libvirt/fakelibvirt.py @@ -506,13 +506,6 @@ class HostInfo(object): self.numa_topology = numa_topology self.disabled_cpus_list = cpu_disabled or [] - -class NUMAHostInfo(HostInfo): - """A NUMA-by-default variant of HostInfo.""" - - def __init__(self, **kwargs): - super(NUMAHostInfo, self).__init__(**kwargs) - if not self.numa_topology: topology = NUMATopology(self.cpu_nodes, self.cpu_sockets, self.cpu_cores, self.cpu_threads,