Skip to content

Commit 5979c64

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Test numa and vcpu topologies bug: #1910466"
2 parents 44ae850 + fe25fa1 commit 5979c64

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

nova/tests/functional/libvirt/test_numa_servers.py

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def test_create_server_with_numa_topology(self):
103103
nodes.
104104
"""
105105

106-
host_info = fakelibvirt.HostInfo(cpu_nodes=2, cpu_sockets=1,
107-
cpu_cores=2, cpu_threads=2)
106+
host_info = fakelibvirt.HostInfo(
107+
cpu_nodes=2, cpu_sockets=1, cpu_cores=2, cpu_threads=2)
108108
self.start_compute(host_info=host_info, hostname='compute1')
109109

110110
extra_spec = {'hw:numa_nodes': '2'}
@@ -119,6 +119,41 @@ def test_create_server_with_numa_topology(self):
119119
self.assertNotIn('cpu_topology', inst.numa_topology.cells[0])
120120
self.assertNotIn('cpu_topology', inst.numa_topology.cells[1])
121121

122+
def test_create_server_with_numa_topology_and_cpu_topology_and_pinning(
123+
self):
124+
"""Create a server with two NUMA nodes.
125+
126+
This should pass and result in a guest NUMA topology with two NUMA
127+
nodes, pinned cpus and numa affined memory.
128+
"""
129+
130+
host_info = fakelibvirt.HostInfo(
131+
cpu_nodes=2, cpu_sockets=1, cpu_cores=4, cpu_threads=1,
132+
kB_mem=(1024 * 1024 * 16)) # 16 GB
133+
self.start_compute(host_info=host_info, hostname='compute1')
134+
135+
extra_spec = {
136+
'hw:numa_nodes': '2',
137+
'hw:cpu_max_sockets': '2',
138+
'hw:cpu_max_cores': '2',
139+
'hw:cpu_max_threads': '8',
140+
'hw:cpu_policy': 'dedicated',
141+
'hw:mem_page_size': 'any'
142+
}
143+
flavor_id = self._create_flavor(vcpu=8, extra_spec=extra_spec)
144+
self._run_build_test(flavor_id, end_status='ERROR')
145+
146+
# FIXME(sean-k-mooney): The instance should boot but
147+
# it fails due to https://bugs.launchpad.net/nova/+bug/1910466
148+
msg = "IndexError: list index out of range"
149+
self.assertIn(msg, self.stdlog.logger.output)
150+
# ctx = nova_context.get_admin_context()
151+
# inst = objects.Instance.get_by_uuid(ctx, server['id'])
152+
# self.assertEqual(2, len(inst.numa_topology.cells))
153+
# self.assertLessEqual(inst.vcpu_model.topology.sockets, 2)
154+
# self.assertLessEqual(inst.vcpu_model.topology.cores, 2)
155+
# self.assertLessEqual(inst.vcpu_model.topology.threads, 8)
156+
122157
def test_create_server_with_numa_fails(self):
123158
"""Create a two NUMA node instance on a host with only one node.
124159

0 commit comments

Comments
 (0)