From 0996acc9410231e8434a46d331705258642f4c30 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 9 Jun 2025 10:54:28 +0100 Subject: [PATCH] tests: Remove unnecessary API version overrides The default version is v2.1, which is what we want. No need to override these values. We also remove a seemingly useless test that is implicitly duplicated by other tests. Change-Id: I3e42acf467ecd5ba6af5713a2d22e68698b8f09e Signed-off-by: Stephen Finucane --- .../api_sample_tests/api_sample_base.py | 1 - .../api_sample_tests/test_compare_result.py | 8 ++--- .../api_sample_tests/test_fixed_ips.py | 1 - .../functional/api_sample_tests/test_fping.py | 1 - .../test_virtual_interfaces.py | 1 - .../functional/compute/test_live_migration.py | 1 - .../functional/db/test_virtual_interface.py | 5 ++- .../functional/libvirt/test_live_migration.py | 4 --- .../libvirt/test_numa_live_migration.py | 4 --- .../functional/libvirt/test_numa_servers.py | 3 -- .../libvirt/test_rescue_deleted_base.py | 6 +--- .../functional/libvirt/test_server_shares.py | 1 - nova/tests/functional/libvirt/test_vgpu.py | 2 -- .../notification_sample_tests/test_keypair.py | 5 ++- .../regressions/test_bug_1404867.py | 1 - .../regressions/test_bug_1669054.py | 1 - .../regressions/test_bug_1732947.py | 1 - .../regressions/test_bug_1823370.py | 1 - .../regressions/test_bug_1843708.py | 1 - .../regressions/test_bug_1886418.py | 1 - .../regressions/test_bug_1902925.py | 2 -- .../regressions/test_bug_1939545.py | 2 -- .../regressions/test_bug_1944619.py | 2 -- .../regressions/test_bug_1980720.py | 4 +-- .../regressions/test_bug_2007968.py | 2 -- .../regressions/test_bug_2040264.py | 2 -- nova/tests/functional/test_aggregates.py | 2 -- .../functional/test_flavor_extraspecs.py | 2 -- .../tests/functional/test_instance_actions.py | 11 +++--- nova/tests/functional/test_login.py | 35 ------------------ nova/tests/functional/test_multiattach.py | 2 -- nova/tests/functional/test_nova_manage.py | 3 -- nova/tests/functional/test_server_group.py | 7 ---- nova/tests/functional/test_servers.py | 36 +++++-------------- nova/tests/functional/wsgi/test_interfaces.py | 1 - nova/tests/functional/wsgi/test_servers.py | 1 - 36 files changed, 22 insertions(+), 141 deletions(-) delete mode 100644 nova/tests/functional/test_login.py diff --git a/nova/tests/functional/api_sample_tests/api_sample_base.py b/nova/tests/functional/api_sample_tests/api_sample_base.py index f722d1efc0..c801ae6d18 100644 --- a/nova/tests/functional/api_sample_tests/api_sample_base.py +++ b/nova/tests/functional/api_sample_tests/api_sample_base.py @@ -56,7 +56,6 @@ class ApiSampleTestBaseV21(testscenarios.WithScenarios, api_samples_test_base.ApiSampleTestBase): SUPPORTS_CELLS = False - api_major_version = 'v2' # any additional fixtures needed for this scenario _additional_fixtures = [] sample_dir = None diff --git a/nova/tests/functional/api_sample_tests/test_compare_result.py b/nova/tests/functional/api_sample_tests/test_compare_result.py index 1b68439184..bdf26e13e1 100644 --- a/nova/tests/functional/api_sample_tests/test_compare_result.py +++ b/nova/tests/functional/api_sample_tests/test_compare_result.py @@ -42,7 +42,7 @@ class TestCompareResult(test.NoDBTestCase): ast_instance = api_samples_test_base.ApiSampleTestBase('setUp') # required by ApiSampleTestBase - ast_instance.api_major_version = 'v2' + ast_instance.api_major_version = 'v2.1' ast_instance.USE_PROJECT_ID = 'True' # automagically create magic methods usually handled by test classes @@ -280,7 +280,7 @@ class TestCompareResult(test.NoDBTestCase): [ { u'href': - (u'http://openstack.example.com/v2/%s/server/' + (u'http://openstack.example.com/v2.1/%s/server/' '858f295a-8543-45fa-804a-08f8356d616d' % api_samples_test_base.PROJECT_ID ), @@ -327,7 +327,7 @@ class TestCompareResult(test.NoDBTestCase): [ { u'href': - (u'http://openstack.example.com/v2/openstack/server/' + (u'http://openstack.example.com/v2.1/openstack/server/' '858f295a-8543-45fa-804a-08f8356d616d'), u'rel': u'self' }, @@ -368,7 +368,7 @@ class TestCompareResult(test.NoDBTestCase): [ { u'href': - (u'http://openstack.example.com/v2/openstack/server/' + (u'http://openstack.example.com/v2.1/openstack/server/' '858f295a-8543-45fa-804a-08f8356d616d'), u'rel': u'self' }, diff --git a/nova/tests/functional/api_sample_tests/test_fixed_ips.py b/nova/tests/functional/api_sample_tests/test_fixed_ips.py index 62c3d6133e..fe60f20ba5 100644 --- a/nova/tests/functional/api_sample_tests/test_fixed_ips.py +++ b/nova/tests/functional/api_sample_tests/test_fixed_ips.py @@ -18,7 +18,6 @@ from nova.tests.functional import api_samples_test_base class FixedIpTest(api_samples_test_base.ApiSampleTestBase): - api_major_version = 'v2' def test_fixed_ip_reserve(self): ex = self.assertRaises(api_client.OpenStackApiException, diff --git a/nova/tests/functional/api_sample_tests/test_fping.py b/nova/tests/functional/api_sample_tests/test_fping.py index f77501d95d..bcb4bfbf99 100644 --- a/nova/tests/functional/api_sample_tests/test_fping.py +++ b/nova/tests/functional/api_sample_tests/test_fping.py @@ -20,7 +20,6 @@ from nova.tests.functional import api_samples_test_base class FpingSampleJsonTests(api_samples_test_base.ApiSampleTestBase): - api_major_version = 'v2' def test_get_fping(self): ex = self.assertRaises(api_client.OpenStackApiException, diff --git a/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py b/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py index 8dcfedb2d4..81ce206574 100644 --- a/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py +++ b/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py @@ -19,7 +19,6 @@ from nova.tests.functional import api_samples_test_base class VirtualInterfacesJsonTest(api_samples_test_base.ApiSampleTestBase): - api_major_version = 'v2' def test_vifs_list(self): uuid = uuids.instance_1 diff --git a/nova/tests/functional/compute/test_live_migration.py b/nova/tests/functional/compute/test_live_migration.py index f19c091ba7..8effb67e43 100644 --- a/nova/tests/functional/compute/test_live_migration.py +++ b/nova/tests/functional/compute/test_live_migration.py @@ -46,7 +46,6 @@ class FakeCinderError(object): class LiveMigrationCinderFailure(integrated_helpers._IntegratedTestBase): # Default self.api to the self.admin_api as live migration is admin only ADMIN_API = True - api_major_version = 'v2.1' microversion = 'latest' def setUp(self): diff --git a/nova/tests/functional/db/test_virtual_interface.py b/nova/tests/functional/db/test_virtual_interface.py index fc9f9ecc1a..a3cf6dbf57 100644 --- a/nova/tests/functional/db/test_virtual_interface.py +++ b/nova/tests/functional/db/test_virtual_interface.py @@ -56,10 +56,9 @@ def _verify_list_fulfillment(context, instance_uuid): class VirtualInterfaceListMigrationTestCase( - integrated_helpers._IntegratedTestBase): - + integrated_helpers._IntegratedTestBase +): ADMIN_API = True - api_major_version = 'v2.1' def setUp(self): super(VirtualInterfaceListMigrationTestCase, self).setUp() diff --git a/nova/tests/functional/libvirt/test_live_migration.py b/nova/tests/functional/libvirt/test_live_migration.py index 3b50f10f3f..a4cb49c010 100644 --- a/nova/tests/functional/libvirt/test_live_migration.py +++ b/nova/tests/functional/libvirt/test_live_migration.py @@ -33,8 +33,6 @@ class LiveMigrationWithLockBase( use it simultaneously. Every test using this mechanism should use separate class instance. """ - - api_major_version = 'v2.1' microversion = '2.74' ADMIN_API = True @@ -217,8 +215,6 @@ class LiveMigrationWithCpuSharedSet( libvirt_base.ServersTestBase, integrated_helpers.InstanceHelperMixin ): - - api_major_version = 'v2.1' # Microversion 2.74 is required to boot a server on a specific host, # which is used in the below tests. microversion = '2.74' diff --git a/nova/tests/functional/libvirt/test_numa_live_migration.py b/nova/tests/functional/libvirt/test_numa_live_migration.py index 0617a4c6f4..8a28552bdf 100644 --- a/nova/tests/functional/libvirt/test_numa_live_migration.py +++ b/nova/tests/functional/libvirt/test_numa_live_migration.py @@ -39,7 +39,6 @@ class NUMALiveMigrationBase( """Base for all the test classes here. Gives us the NUMATopologyFilter and small helper methods. """ - api_major_version = 'v2.1' microversion = 'latest' ADDITIONAL_FILTERS = ['NUMATopologyFilter'] ADMIN_API = True @@ -436,8 +435,6 @@ class NUMALiveMigrationLegacyBase(NUMALiveMigrationPositiveBase): live migration to go through (if forced through the API, thus bypassing the scheduler). """ - - api_major_version = 'v2.1' # NOTE(artom) After 2.67 we can no longer bypass the scheduler for live # migration, which we need to do here to force the live migration to a host # that's already full. @@ -585,7 +582,6 @@ class NUMALiveMigrationNegativeTests(NUMALiveMigrationBase): destination host (even if the scheduler was bypassed by forcing in the API). """ - api_major_version = 'v2.1' # NOTE(artom) We're trying to test the new NUMA live migration claims, not # the scheduler, so we use microversion 2.67, which is the last one where # we can still bypass the scheduler and force a live migration to a host. diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py index ce34bbc82e..a40b31f839 100644 --- a/nova/tests/functional/libvirt/test_numa_servers.py +++ b/nova/tests/functional/libvirt/test_numa_servers.py @@ -1106,9 +1106,6 @@ class NUMAServerTestWithCountingQuotaFromPlacement(NUMAServersTest): class ReshapeForPCPUsTest(NUMAServersTestBase): - - api_major_version = 'v2.1' - # TODO(stephenfin): We're using this because we want to be able to force # the host during scheduling. We should instead look at overriding policy ADMIN_API = True diff --git a/nova/tests/functional/libvirt/test_rescue_deleted_base.py b/nova/tests/functional/libvirt/test_rescue_deleted_base.py index c2fba51078..5fdfa5775f 100644 --- a/nova/tests/functional/libvirt/test_rescue_deleted_base.py +++ b/nova/tests/functional/libvirt/test_rescue_deleted_base.py @@ -27,11 +27,7 @@ LOG = logging.getLogger(__name__) CONF = conf.CONF -class RescueServerTestWithDeletedBaseImage( - base.ServersTestBase -): - - api_major_version = 'v2.1' +class RescueServerTestWithDeletedBaseImage(base.ServersTestBase): microversion = '2.87' # BUG #2002606 diff --git a/nova/tests/functional/libvirt/test_server_shares.py b/nova/tests/functional/libvirt/test_server_shares.py index fe6256a564..07fbbdb568 100644 --- a/nova/tests/functional/libvirt/test_server_shares.py +++ b/nova/tests/functional/libvirt/test_server_shares.py @@ -33,7 +33,6 @@ LOG = logging.getLogger(__name__) class ServerSharesTestBase(base.ServersTestBase): - api_major_version = 'v2.1' microversion = 'latest' ADMIN_API = True FAKE_LIBVIRT_VERSION = 8000000 diff --git a/nova/tests/functional/libvirt/test_vgpu.py b/nova/tests/functional/libvirt/test_vgpu.py index f9f6f3e863..aba59f2aae 100644 --- a/nova/tests/functional/libvirt/test_vgpu.py +++ b/nova/tests/functional/libvirt/test_vgpu.py @@ -36,9 +36,7 @@ LOG = logging.getLogger(__name__) class VGPUTestBase(base.ServersTestBase): - # We want to target some hosts for some created instances - api_major_version = 'v2.1' microversion = 'latest' ADMIN_API = True diff --git a/nova/tests/functional/notification_sample_tests/test_keypair.py b/nova/tests/functional/notification_sample_tests/test_keypair.py index 01c59b0f36..e96cf3fca3 100644 --- a/nova/tests/functional/notification_sample_tests/test_keypair.py +++ b/nova/tests/functional/notification_sample_tests/test_keypair.py @@ -14,9 +14,8 @@ from nova.tests.functional.notification_sample_tests \ class TestKeypairNotificationSample( - notification_sample_base.NotificationSampleTestBase): - - api_major_version = 'v2.1' + notification_sample_base.NotificationSampleTestBase +): microversion = 'latest' def test_keypair_create_delete(self): diff --git a/nova/tests/functional/regressions/test_bug_1404867.py b/nova/tests/functional/regressions/test_bug_1404867.py index 40fc199ad6..39b0a248b3 100644 --- a/nova/tests/functional/regressions/test_bug_1404867.py +++ b/nova/tests/functional/regressions/test_bug_1404867.py @@ -29,7 +29,6 @@ class DeleteWithReservedVolumes(integrated_helpers._IntegratedTestBase): The regression is that Nova would not clean up the reserved volumes and the volume would be stuck in 'attaching' state. """ - api_major_version = 'v2.1' microversion = 'latest' def _setup_compute_service(self): diff --git a/nova/tests/functional/regressions/test_bug_1669054.py b/nova/tests/functional/regressions/test_bug_1669054.py index b20e1530cc..ef3c3ac66c 100644 --- a/nova/tests/functional/regressions/test_bug_1669054.py +++ b/nova/tests/functional/regressions/test_bug_1669054.py @@ -30,7 +30,6 @@ class ResizeEvacuateTestCase(integrated_helpers._IntegratedTestBase): # Set variables used in the parent class. REQUIRES_LOCKING = False ADMIN_API = True - api_major_version = 'v2.1' microversion = '2.11' # Need at least 2.11 for the force-down API def test_resize_then_evacuate(self): diff --git a/nova/tests/functional/regressions/test_bug_1732947.py b/nova/tests/functional/regressions/test_bug_1732947.py index db518fa8ce..9de45e7649 100644 --- a/nova/tests/functional/regressions/test_bug_1732947.py +++ b/nova/tests/functional/regressions/test_bug_1732947.py @@ -27,7 +27,6 @@ class RebuildVolumeBackedSameImage(integrated_helpers._IntegratedTestBase): API to see if the provided image_ref for rebuild is different than the original image. """ - api_major_version = 'v2.1' # We need microversion <=2.93 to get the old BFV rebuild behavior # that was the environment for this regression. microversion = '2.92' diff --git a/nova/tests/functional/regressions/test_bug_1823370.py b/nova/tests/functional/regressions/test_bug_1823370.py index af134070cd..ca6440a7dd 100644 --- a/nova/tests/functional/regressions/test_bug_1823370.py +++ b/nova/tests/functional/regressions/test_bug_1823370.py @@ -30,7 +30,6 @@ class MultiCellEvacuateTestCase(integrated_helpers._IntegratedTestBase): NUMBER_OF_CELLS = 2 REQUIRES_LOCKING = False ADMIN_API = True - api_major_version = 'v2.1' microversion = '2.11' # Need at least 2.11 for the force-down API def setUp(self): diff --git a/nova/tests/functional/regressions/test_bug_1843708.py b/nova/tests/functional/regressions/test_bug_1843708.py index 2eda92125b..774f48dbb3 100644 --- a/nova/tests/functional/regressions/test_bug_1843708.py +++ b/nova/tests/functional/regressions/test_bug_1843708.py @@ -23,7 +23,6 @@ class RebuildWithKeypairTestCase(integrated_helpers._IntegratedTestBase): This tests a rebuild scenario with new key pairs. """ - api_major_version = 'v2.1' microversion = 'latest' def test_rebuild_with_keypair(self): diff --git a/nova/tests/functional/regressions/test_bug_1886418.py b/nova/tests/functional/regressions/test_bug_1886418.py index 640e3134fe..7e2d18ddf0 100644 --- a/nova/tests/functional/regressions/test_bug_1886418.py +++ b/nova/tests/functional/regressions/test_bug_1886418.py @@ -14,7 +14,6 @@ from nova.tests.functional import integrated_helpers class TestServices(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' microversion = 'latest' def setUp(self): diff --git a/nova/tests/functional/regressions/test_bug_1902925.py b/nova/tests/functional/regressions/test_bug_1902925.py index 59105c6cc6..241d4ceafe 100644 --- a/nova/tests/functional/regressions/test_bug_1902925.py +++ b/nova/tests/functional/regressions/test_bug_1902925.py @@ -15,10 +15,8 @@ from nova.tests.functional import integrated_helpers class ComputeVersion5xPinnedRpcTests(integrated_helpers._IntegratedTestBase): - compute_driver = 'fake.MediumFakeDriver' ADMIN_API = True - api_major_version = 'v2.1' microversion = 'latest' def setUp(self): diff --git a/nova/tests/functional/regressions/test_bug_1939545.py b/nova/tests/functional/regressions/test_bug_1939545.py index bd5fb65f6e..78b29b48e9 100644 --- a/nova/tests/functional/regressions/test_bug_1939545.py +++ b/nova/tests/functional/regressions/test_bug_1939545.py @@ -34,8 +34,6 @@ class TestLiveMigrateUpdateDevicePath( Bug #1939545 covering the case where the returned path from os-brick isn't being saved into the connection_info of the associated bdm in Nova. """ - - api_major_version = 'v2.1' microversion = 'latest' ADMIN_API = True diff --git a/nova/tests/functional/regressions/test_bug_1944619.py b/nova/tests/functional/regressions/test_bug_1944619.py index 430a6e3981..72b68cfb06 100644 --- a/nova/tests/functional/regressions/test_bug_1944619.py +++ b/nova/tests/functional/regressions/test_bug_1944619.py @@ -36,8 +36,6 @@ class TestRollbackWithHWOffloadedOVS( that might cause the pre-live migration process to fail and rollback_live_migration_at_source reproduce the device re-attach failure. """ - - api_major_version = 'v2.1' microversion = 'latest' ADMIN_API = True diff --git a/nova/tests/functional/regressions/test_bug_1980720.py b/nova/tests/functional/regressions/test_bug_1980720.py index ad2e6e6ba2..f730e25750 100644 --- a/nova/tests/functional/regressions/test_bug_1980720.py +++ b/nova/tests/functional/regressions/test_bug_1980720.py @@ -22,10 +22,8 @@ from unittest import mock class LibvirtDriverTests( - base.ServersTestBase, - integrated_helpers.InstanceHelperMixin + base.ServersTestBase, integrated_helpers.InstanceHelperMixin ): - api_major_version = 'v2.1' microversion = 'latest' def setUp(self): diff --git a/nova/tests/functional/regressions/test_bug_2007968.py b/nova/tests/functional/regressions/test_bug_2007968.py index 874dda2725..503279b7a2 100644 --- a/nova/tests/functional/regressions/test_bug_2007968.py +++ b/nova/tests/functional/regressions/test_bug_2007968.py @@ -20,8 +20,6 @@ from nova.tests.functional.libvirt import base class Bug2007968RegressionTest(base.ServersTestBase): """Regression test for bug 2007968 """ - - api_major_version = 'v2.1' microversion = 'latest' def setUp(self): diff --git a/nova/tests/functional/regressions/test_bug_2040264.py b/nova/tests/functional/regressions/test_bug_2040264.py index c0e88c1154..3c28ea14fd 100644 --- a/nova/tests/functional/regressions/test_bug_2040264.py +++ b/nova/tests/functional/regressions/test_bug_2040264.py @@ -15,10 +15,8 @@ from nova.tests.functional import integrated_helpers class ComputeVersion6xPinnedRpcTests(integrated_helpers._IntegratedTestBase): - compute_driver = 'fake.MediumFakeDriver' ADMIN_API = True - api_major_version = 'v2.1' microversion = 'latest' def setUp(self): diff --git a/nova/tests/functional/test_aggregates.py b/nova/tests/functional/test_aggregates.py index a3f14000dc..772a3b4792 100644 --- a/nova/tests/functional/test_aggregates.py +++ b/nova/tests/functional/test_aggregates.py @@ -25,7 +25,6 @@ CONF = nova.conf.CONF class AggregatesTest(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2' ADMIN_API = True def _add_hosts_to_aggregate(self): @@ -54,7 +53,6 @@ class AggregatesTest(integrated_helpers._IntegratedTestBase): class AggregatesV281Test(AggregatesTest): - api_major_version = 'v2.1' microversion = '2.81' def setUp(self): diff --git a/nova/tests/functional/test_flavor_extraspecs.py b/nova/tests/functional/test_flavor_extraspecs.py index d158067e6d..7a1a60d459 100644 --- a/nova/tests/functional/test_flavor_extraspecs.py +++ b/nova/tests/functional/test_flavor_extraspecs.py @@ -19,7 +19,6 @@ from nova.tests.functional import integrated_helpers class FlavorExtraSpecsTest(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2' def setUp(self): super(FlavorExtraSpecsTest, self).setUp() @@ -71,7 +70,6 @@ class FlavorExtraSpecsTest(integrated_helpers._IntegratedTestBase): class FlavorExtraSpecsV286Test(FlavorExtraSpecsTest): - api_major_version = 'v2.1' microversion = '2.86' def test_create_invalid_spec(self): diff --git a/nova/tests/functional/test_instance_actions.py b/nova/tests/functional/test_instance_actions.py index d13b6ce4e2..ae7641dad9 100644 --- a/nova/tests/functional/test_instance_actions.py +++ b/nova/tests/functional/test_instance_actions.py @@ -25,7 +25,7 @@ from nova.tests.functional import fixtures as func_fixtures from nova.tests.functional import integrated_helpers -class InstanceActionsTestV2(integrated_helpers._IntegratedTestBase): +class InstanceActionsTest(integrated_helpers._IntegratedTestBase): """Tests Instance Actions API""" def test_get_instance_actions(self): @@ -41,11 +41,7 @@ class InstanceActionsTestV2(integrated_helpers._IntegratedTestBase): server['id']) -class InstanceActionsTestV21(InstanceActionsTestV2): - api_major_version = 'v2.1' - - -class InstanceActionsTestV221(InstanceActionsTestV21): +class InstanceActionsTestV221(InstanceActionsTest): microversion = '2.21' def setUp(self): @@ -75,7 +71,8 @@ class HypervisorError(Exception): class InstanceActionEventFaultsTestCase( - test.TestCase, integrated_helpers.InstanceHelperMixin): + test.TestCase, integrated_helpers.InstanceHelperMixin +): """Tests for the instance action event details reporting from the API""" def setUp(self): diff --git a/nova/tests/functional/test_login.py b/nova/tests/functional/test_login.py deleted file mode 100644 index 8cb7e3e44b..0000000000 --- a/nova/tests/functional/test_login.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2011 Justin Santa Barbara -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from oslo_log import log as logging - -from nova.tests.functional import integrated_helpers - - -LOG = logging.getLogger(__name__) - - -class LoginTest(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2' - - def test_login(self): - # Simple check - we list flavors - so we know we're logged in. - flavors = self.api.get_flavors() - for flavor in flavors: - LOG.debug("flavor: %s", flavor) - - -class LoginTestV21(LoginTest): - api_major_version = 'v2.1' diff --git a/nova/tests/functional/test_multiattach.py b/nova/tests/functional/test_multiattach.py index c3c307d471..e700f1e14c 100644 --- a/nova/tests/functional/test_multiattach.py +++ b/nova/tests/functional/test_multiattach.py @@ -22,8 +22,6 @@ class TestMultiattachVolumes(integrated_helpers._IntegratedTestBase): Uses the CinderFixture fixture with a specific volume ID to represent a multiattach volume. """ - # These are all used in _IntegratedTestBase. - api_major_version = 'v2.1' microversion = '2.60' def setUp(self): diff --git a/nova/tests/functional/test_nova_manage.py b/nova/tests/functional/test_nova_manage.py index df4c58ce25..1a1a8c60a8 100644 --- a/nova/tests/functional/test_nova_manage.py +++ b/nova/tests/functional/test_nova_manage.py @@ -179,7 +179,6 @@ class NovaManageDBIronicTest(test.TestCase): class TestIronicComputeNodeMove(NovaManageDBIronicTest): """Functional tests for "nova-manage db ironic_compute_node_move" CLI.""" - api_major_version = 'v2.1' def setUp(self): super(TestIronicComputeNodeMove, self).setUp() @@ -2120,7 +2119,6 @@ class TestNovaManagePlacementAudit( class TestDBArchiveDeletedRows(integrated_helpers._IntegratedTestBase): """Functional tests for the "nova-manage db archive_deleted_rows" CLI.""" - api_major_version = 'v2.1' def setUp(self): super(TestDBArchiveDeletedRows, self).setUp() @@ -2167,7 +2165,6 @@ class TestDBArchiveDeletedRowsTaskLog(integrated_helpers._IntegratedTestBase): """Functional tests for the "nova-manage db archive_deleted_rows --task-log" CLI. """ - api_major_version = 'v2.1' def setUp(self): # Override time to ensure we cross audit period boundaries in a diff --git a/nova/tests/functional/test_server_group.py b/nova/tests/functional/test_server_group.py index ee608d9044..24bbb5843d 100644 --- a/nova/tests/functional/test_server_group.py +++ b/nova/tests/functional/test_server_group.py @@ -38,7 +38,6 @@ CONF = cfg.CONF class ServerGroupTestBase(test.TestCase, integrated_helpers.InstanceHelperMixin): REQUIRES_LOCKING = True - api_major_version = 'v2.1' microversion = None _enabled_filters = (CONF.filter_scheduler.enabled_filters + @@ -581,7 +580,6 @@ class ServerGroupTestV21(ServerGroupTestBase): class ServerGroupAffinityConfTest(ServerGroupTestBase): - api_major_version = 'v2.1' # Load only anti-affinity filter so affinity will be missing _enabled_filters = ['ServerGroupAntiAffinityFilter'] @@ -598,7 +596,6 @@ class ServerGroupAffinityConfTest(ServerGroupTestBase): class ServerGroupAntiAffinityConfTest(ServerGroupTestBase): - api_major_version = 'v2.1' # Load only affinity filter so anti-affinity will be missing _enabled_filters = ['ServerGroupAffinityFilter'] @@ -615,7 +612,6 @@ class ServerGroupAntiAffinityConfTest(ServerGroupTestBase): class ServerGroupSoftAffinityConfTest(ServerGroupTestBase): - api_major_version = 'v2.1' microversion = '2.15' soft_affinity = {'name': 'fake-name-4', 'policies': ['soft-affinity']} @@ -638,7 +634,6 @@ class ServerGroupSoftAffinityConfTest(ServerGroupTestBase): class ServerGroupSoftAntiAffinityConfTest(ServerGroupTestBase): - api_major_version = 'v2.1' microversion = '2.15' soft_anti_affinity = {'name': 'fake-name-3', 'policies': ['soft-anti-affinity']} @@ -661,7 +656,6 @@ class ServerGroupSoftAntiAffinityConfTest(ServerGroupTestBase): class ServerGroupTestV215(ServerGroupTestV21): - api_major_version = 'v2.1' microversion = '2.15' soft_anti_affinity = {'name': 'fake-name-3', @@ -910,7 +904,6 @@ class ServerGroupTestV215(ServerGroupTestV21): class ServerGroupTestV264(ServerGroupTestV215): - api_major_version = 'v2.1' microversion = '2.64' anti_affinity = {'name': 'fake-name-1', 'policy': 'anti-affinity'} affinity = {'name': 'fake-name-2', 'policy': 'affinity'} diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py index cf8df5bb76..d1e66045ca 100644 --- a/nova/tests/functional/test_servers.py +++ b/nova/tests/functional/test_servers.py @@ -889,7 +889,7 @@ class ServersTestV21(ServersTest): class ServersTestV219(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' + microversion = '2.19' def _create_server(self, set_desc = True, desc = None): server = self._build_server() @@ -992,7 +992,6 @@ class ServersTestV219(integrated_helpers._IntegratedTestBase): self.assertEqual(400, cm.exception.response.status_code) def test_create_server_with_description(self): - self.api.microversion = '2.19' # Create and get a server with a description self._create_server_and_verify(True, 'test description') # Create and get a server with an empty description @@ -1003,7 +1002,6 @@ class ServersTestV219(integrated_helpers._IntegratedTestBase): self._create_server_and_verify(False) def test_update_server_with_description(self): - self.api.microversion = '2.19' # Create a server with an initial description server = self._create_server(True, 'test desc 1')[1] server_id = server['id'] @@ -1023,8 +1021,6 @@ class ServersTestV219(integrated_helpers._IntegratedTestBase): self._delete_server(server) def test_rebuild_server_with_description(self): - self.api.microversion = '2.19' - # Create a server with an initial description server = self._create_server(True, 'test desc 1')[1] server_id = server['id'] @@ -1078,7 +1074,6 @@ class ServersTestV219(integrated_helpers._IntegratedTestBase): self._create_assertRaisesRegex('test create 2.18') def test_description_errors(self): - self.api.microversion = '2.19' # Create servers with invalid descriptions. These throw 400. # Invalid unicode with non-printable control char self._create_assertRaisesRegex(u'invalid\0dstring') @@ -1100,11 +1095,10 @@ class ServersTestV219(integrated_helpers._IntegratedTestBase): class ServerTestV220(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' + microversion = '2.20' def setUp(self): super(ServerTestV220, self).setUp() - self.api.microversion = '2.20' self.ctxt = context.get_admin_context() def _create_server(self): @@ -1175,12 +1169,11 @@ class ServerTestV220(integrated_helpers._IntegratedTestBase): class ServerTestV269(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' + microversion = '2.69' NUMBER_OF_CELLS = 3 def setUp(self): super(ServerTestV269, self).setUp() - self.api.microversion = '2.69' self.ctxt = context.get_admin_context() self.project_id = self.api.project_id @@ -1363,7 +1356,6 @@ class ServerTestV269(integrated_helpers._IntegratedTestBase): # We get the results only from the up cells, this ignoring the down # cells if list_records_by_skipping_down_cells config option is True. self.admin_api = self.api_fixture.admin_api - self.admin_api.microversion = '2.69' servers = self.admin_api.get_servers( search_opts={'hostname': "cell3-inst0"}) self.assertEqual(1, len(servers)) @@ -1371,7 +1363,6 @@ class ServerTestV269(integrated_helpers._IntegratedTestBase): def test_get_servers_detail_all_tenants_with_down_cells(self): self.admin_api = self.api_fixture.admin_api - self.admin_api.microversion = '2.69' servers = self.admin_api.get_servers(search_opts={'all_tenants': True}) # 4 servers from the up cells and 4 servers from the down cells # plus the 2 instances from cell1 and cell3 which are in a different @@ -1397,7 +1388,6 @@ class ServerTestV269(integrated_helpers._IntegratedTestBase): class ServerRebuildTestCase(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' # We have to cap the microversion at 2.38 because that's the max we # can use to update image metadata via our compute images proxy API. microversion = '2.38' @@ -1624,7 +1614,7 @@ class ServerRebuildTestCase(integrated_helpers._IntegratedTestBase): class ServerRebuildTestCaseV293(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' + microversion = '2.93' def setUp(self): super(ServerRebuildTestCaseV293, self).setUp() @@ -1651,7 +1641,6 @@ class ServerRebuildTestCaseV293(integrated_helpers._IntegratedTestBase): return self._wait_for_state_change(server, 'ACTIVE') def _test_rebuild(self, server): - self.api.microversion = '2.93' # Now rebuild the server with a different image than was used to create # our fake volume. rebuild_image_ref = self.glance.auto_disk_config_enabled_image['id'] @@ -1708,18 +1697,9 @@ class ServerRebuildTestCaseV293(integrated_helpers._IntegratedTestBase): class ServersTestV280(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' + microversion = '2.80' - def setUp(self): - super(ServersTestV280, self).setUp() - self.api = self.api_fixture.api - self.admin_api = self.api_fixture.admin_api - - self.api.microversion = '2.80' - self.admin_api.microversion = '2.80' - - def test_get_migrations_after_cold_migrate_server_in_same_project( - self): + def test_get_migrations_after_cold_migrate_server_in_same_project(self): # Create a server by non-admin server = self.api.post_server({ 'server': { @@ -1751,7 +1731,8 @@ class ServersTestV280(integrated_helpers._IntegratedTestBase): self.assertEqual([], migrations) def test_get_migrations_after_live_migrate_server_in_different_project( - self): + self + ): # Create a server by non-admin server = self.api.post_server({ 'server': { @@ -4860,7 +4841,6 @@ class TraitsBasedSchedulingTest(integrated_helpers.ProviderUsageBaseTestCase): class ServerTestV256Common(integrated_helpers._IntegratedTestBase): - api_major_version = 'v2.1' microversion = '2.56' ADMIN_API = True diff --git a/nova/tests/functional/wsgi/test_interfaces.py b/nova/tests/functional/wsgi/test_interfaces.py index b50ad94efd..30790f32ac 100644 --- a/nova/tests/functional/wsgi/test_interfaces.py +++ b/nova/tests/functional/wsgi/test_interfaces.py @@ -25,7 +25,6 @@ class InterfaceFullstack(integrated_helpers._IntegratedTestBase): os-interface API specifies a port ID created by Neutron. """ - api_major_version = 'v2.1' def test_detach_interface_negative_invalid_state(self): # Create server with network diff --git a/nova/tests/functional/wsgi/test_servers.py b/nova/tests/functional/wsgi/test_servers.py index 5ae088798b..06c82ecbe3 100644 --- a/nova/tests/functional/wsgi/test_servers.py +++ b/nova/tests/functional/wsgi/test_servers.py @@ -35,7 +35,6 @@ class ServersPreSchedulingTestCase(test.TestCase, an in memory database for persistence. It does not allow requests to get past scheduling. """ - api_major_version = 'v2.1' def setUp(self): super(ServersPreSchedulingTestCase, self).setUp()