summaryrefslogtreecommitdiff
path: root/nova/tests/functional/libvirt/test_numa_servers.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2019-10-11 10:25:45 +0100
committerStephen Finucane <sfinucan@redhat.com>2019-11-15 16:06:57 +0000
commit57f335090b9e56d764c02705a42ce2d3690d8955 (patch)
tree5a51591c5a39817e035039e6e2dd49870bb77857 /nova/tests/functional/libvirt/test_numa_servers.py
parent931ce9b9d2481b5eb50e0bc987f925b55b6ef13b (diff)
downloadnova-57f335090b9e56d764c02705a42ce2d3690d8955.tar.gz
functional: Rework '_delete_server'
We want 'ServerBase' to inherit from 'InstanceHelperMixin'. They both have implementations of a "wait until server is deleted" function. The 'ServerBase' implementation is called '_wait_for_deletion' and takes a 'server_id', while the 'InstanceHelperMixin' implementation is called '_wait_until_deleted' and takes a full server JSON-y dict. A later change, I0c56841d098d3e9d72db65be3143f3c893f0b6ba, will rework the 'ServersTestBase' version to bring it inline with 'InstanceHelperMixin' version. However, 'ServerBase._delete_server' currently calls a '_wait_for_deletion' function and passes it a 'server_id'. As such, '_delete_server' itself is only passed a server_id. After the future change, this 'server_id' will no longer be enough as '_delete_server' will need to call the newly merged '_wait_until_deleted' that takes a full server JSON-y dict, so '_delete_server' itself needs to receive a full server JSON-y dict. Do this work now to simplify the future patch. Change-Id: Iceafa5ff2b7abff7c6d974ba49036ef03fb1c85f 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.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py
index 3ca4bb6094..98f4554458 100644
--- a/nova/tests/functional/libvirt/test_numa_servers.py
+++ b/nova/tests/functional/libvirt/test_numa_servers.py
@@ -113,7 +113,7 @@ class NUMAServersTest(NUMAServersTestBase):
self.assertEqual(end_status, found_server['status'])
- self.addCleanup(self._delete_server, created_server_id)
+ self.addCleanup(self._delete_server, found_server)
return created_server
def test_create_server_with_numa_topology(self):
@@ -743,9 +743,9 @@ class ReshapeForPCPUsTest(NUMAServersTestBase):
{'DISK_GB': 20, 'MEMORY_MB': 2048, 'PCPU': 2},
allocations[compute_rp_uuid]['resources'])
- self._delete_server(server1['id'])
- self._delete_server(server2['id'])
- self._delete_server(server3['id'])
+ self._delete_server(server1)
+ self._delete_server(server2)
+ self._delete_server(server3)
class NUMAServersWithNetworksTest(NUMAServersTestBase):