summaryrefslogtreecommitdiff
path: root/nova/tests/functional/test_servers.py
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2020-09-29 17:32:56 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-01-08 10:10:21 +0000
commit1f67ce24961a156dba56cacc75cbdd0800a7feee (patch)
tree0bb74f06d411299270524ac844e00c89886eea1b /nova/tests/functional/test_servers.py
parentef7598ac2896d08a89e50ccb82a47244e63d6248 (diff)
downloadnova-1f67ce24961a156dba56cacc75cbdd0800a7feee.tar.gz
api: Drop statistics-style fields from os-hypervisors
Introduce API microversion 2.88, which makes the following changes to a number of 'os-hypervisors'. Specifically, the following fields are dropped from both the '/os-hypervisors/detail' (detailed list) and '/os-hypervisors/{hypervisor_id}' (show) APIs: - current_workload - cpu_info - vcpus - vcpus_used - free_disk_gb - local_gb - local_gb_used - disk_available_least - free_ram_mb - memory_mb - memory_mb_used - running_vms In addition, the '/os-hypervisors/statistics' API, which provided a summary of the above stats but for all hypervisors in the deployment, is dropped entirely. Finally, the '/os-hypervisors/{hypervisor}/uptime' API, which provided a similar response to the '/os-hypervisors/{hypervisor}' API but with an additional 'uptime' field, has been removed in favour of including this field in the primary '/os-hypervisors/{hypervisor}' API. A small tweak to 'tox.ini' that allows us to share some venvs is included. Part of blueprint modernize-os-hypervisors-api Change-Id: I515e484ade6c6455f82a3067940a418a0d7d965a Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'nova/tests/functional/test_servers.py')
-rw-r--r--nova/tests/functional/test_servers.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py
index 3f23b8ed92..4277fbd1dc 100644
--- a/nova/tests/functional/test_servers.py
+++ b/nova/tests/functional/test_servers.py
@@ -3956,10 +3956,12 @@ class VolumeBackedServerTest(integrated_helpers.ProviderUsageBaseTestCase):
# 10gb root, 20gb ephemeral, 5gb swap
expected_usage = 35
self.assertEqual(expected_usage, resources['DISK_GB'])
- # Ensure the compute node is reporting the correct disk usage
- self.assertEqual(
- expected_usage,
- self.admin_api.get_hypervisor_stats()['local_gb_used'])
+ # Ensure the compute node is reporting the correct disk usage. We're
+ # using v2.87 explicitly as the api returns 404 starting with 2.88
+ with nova_utils.temporary_mutation(self.api, microversion='2.87'):
+ self.assertEqual(
+ expected_usage,
+ self.admin_api.get_hypervisor_stats()['local_gb_used'])
def test_volume_backed_image_type_filter(self):
# Enable the image type support filter and ensure that a
@@ -3978,10 +3980,12 @@ class VolumeBackedServerTest(integrated_helpers.ProviderUsageBaseTestCase):
# 0gb root, 20gb ephemeral, 5gb swap
expected_usage = 25
self.assertEqual(expected_usage, resources['DISK_GB'])
- # Ensure the compute node is reporting the correct disk usage
- self.assertEqual(
- expected_usage,
- self.admin_api.get_hypervisor_stats()['local_gb_used'])
+ # Ensure the compute node is reporting the correct disk usage. We're
+ # using v2.87 explicitly as the api returns 404 starting with 2.88
+ with nova_utils.temporary_mutation(self.api, microversion='2.87'):
+ self.assertEqual(
+ expected_usage,
+ self.admin_api.get_hypervisor_stats()['local_gb_used'])
# Now let's hack the RequestSpec.is_bfv field to mimic migrating an
# old instance created before RequestSpec.is_bfv was set in the API,