diff options
author | Stephen Finucane <sfinucan@redhat.com> | 2019-09-23 14:41:03 +0100 |
---|---|---|
committer | Stephen Finucane <sfinucan@redhat.com> | 2019-09-23 14:41:03 +0100 |
commit | a4ca0b531cb3eabdeee6aab925220067ebd81172 (patch) | |
tree | f4996ce9d94f503c7e43650e10044affdde83af0 /nova/tests/functional/libvirt/test_numa_servers.py | |
parent | 4f261f98e19d28fa29ff6a4d62a6a3a8a4114575 (diff) | |
download | nova-a4ca0b531cb3eabdeee6aab925220067ebd81172.tar.gz |
Remove 'test_cold_migrate_with_physnet_fails' test
This never actually worked. What we wanted to do was test a setup where
we had two hosts, one with the necessary configuration needed for a
specific request and one without, and attempt to cold migrate the
instance from the former to the latter resulting in a fail. However,
because it's not possible to use different configuration for different
hosts, we were attempting to "break" the configuration on one host.
Unfortunately, the driver correctly detects this broken behavior,
resulting in an error message like so:
ERROR [nova.compute.manager] Error updating resources for node test_compute1.
Traceback (most recent call last):
File "nova/compute/manager.py", line 8524, in _update_available_resource_for_node
startup=startup)
File "nova/compute/resource_tracker.py", line 867, in update_available_resource
resources = self.driver.get_available_resource(nodename)
File "nova/virt/libvirt/driver.py", line 7907, in get_available_resource
numa_topology = self._get_host_numa_topology()
File "nova/virt/libvirt/driver.py", line 7057, in _get_host_numa_topology
physnet_affinities = _get_physnet_numa_affinity()
File "nova/virt/libvirt/driver.py", line 7039, in _get_physnet_numa_affinity
raise exception.InvalidNetworkNUMAAffinity(reason=msg)
InvalidNetworkNUMAAffinity: Invalid NUMA network affinity configured: node 1 for
physnet foo is not present in host affinity set {0: set([])}
There isn't really an alternative. We can't configure compute nodes
separately so that's ruled out and the virt driver will correctly detect
any other attempts to break the configuration. Since the test never
actually worked, the correct thing to do seems to be to remove it.
Change-Id: I14637d788205408dcf9a007d7727358c03033dcd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'nova/tests/functional/libvirt/test_numa_servers.py')
-rw-r--r-- | nova/tests/functional/libvirt/test_numa_servers.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py index c7021dbbc8..440680a83c 100644 --- a/nova/tests/functional/libvirt/test_numa_servers.py +++ b/nova/tests/functional/libvirt/test_numa_servers.py @@ -1006,61 +1006,3 @@ class NUMAServersWithNetworksTest(NUMAServersTestBase): network_metadata = args[1].network_metadata self.assertIsNotNone(network_metadata) self.assertEqual(set(['foo']), network_metadata.physnets) - - def test_cold_migrate_with_physnet_fails(self): - host_infos = [ - # host 1 has room on both nodes - 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.HostInfo(cpu_nodes=1, cpu_sockets=1, - cpu_cores=1, cpu_threads=1, - kB_mem=15740000), - ] - - # Start services - self.computes = {} - for host in ['test_compute0', 'test_compute1']: - host_info = host_infos.pop(0) - fake_connection = self._get_connection( - host_info=host_info, hostname=host) - - # This is fun. Firstly we need to do a global'ish mock so we can - # actually start the service. - with mock.patch('nova.virt.libvirt.host.Host.get_connection', - return_value=fake_connection): - compute = self.start_service('compute', host=host) - - # Once that's done, we need to do some tweaks to each individual - # compute "service" to make sure they return unique objects - compute.driver._host.get_connection = lambda: fake_connection - self.computes[host] = compute - - # Create server - extra_spec = {'hw:numa_nodes': '1'} - flavor_id = self._create_flavor(extra_spec=extra_spec) - networks = [ - {'uuid': base.LibvirtNeutronFixture.network_1['id']}, - ] - - good_server = self._build_server(flavor_id) - good_server['networks'] = networks - post = {'server': good_server} - - created_server = self.api.post_server(post) - server = self._wait_for_state_change(created_server, 'BUILD') - - self.assertEqual('ACTIVE', server['status']) - - # TODO(stephenfin): The mock of 'migrate_disk_and_power_off' should - # probably be less...dumb - with mock.patch('nova.virt.libvirt.driver.LibvirtDriver' - '.migrate_disk_and_power_off', return_value='{}'): - ex = self.assertRaises(client.OpenStackApiException, - self.api.post_server_action, - server['id'], {'migrate': None}) - - self.assertEqual(400, ex.response.status_code) - self.assertIn('No valid host', six.text_type(ex)) |