summaryrefslogtreecommitdiff
path: root/nova/tests/functional/regressions
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2020-09-25 14:46:10 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-06-29 11:40:04 +0100
commit97d25371b3cbd20eab3b13b230fb87dfee8478bf (patch)
treee42ee0d125a276e751a26c98aa3da86374aa5b22 /nova/tests/functional/regressions
parent1f6c35171213c954317595d84c62f1dfddc69a5a (diff)
downloadnova-97d25371b3cbd20eab3b13b230fb87dfee8478bf.tar.gz
scheduler: Remove 'USES_ALLOCATION_CANDIDATES'
There is only one scheduler driver now. This variable is no longer necessary. We remove a couple of test that validated behavior for scheduler drivers that didn't support allocation candidates (there are none) and update the test for the 'nova-manage placement heal_allocations' command to drop allocations instead of relying on them not being created. Change-Id: I64dc67e2bacd7a6c86153db5ae983dfb54bd40eb Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'nova/tests/functional/regressions')
-rw-r--r--nova/tests/functional/regressions/test_bug_1671648.py13
-rw-r--r--nova/tests/functional/regressions/test_bug_1741125.py14
-rw-r--r--nova/tests/functional/regressions/test_bug_1741307.py100
3 files changed, 0 insertions, 127 deletions
diff --git a/nova/tests/functional/regressions/test_bug_1671648.py b/nova/tests/functional/regressions/test_bug_1671648.py
index f382fc9795..b7f148cd76 100644
--- a/nova/tests/functional/regressions/test_bug_1671648.py
+++ b/nova/tests/functional/regressions/test_bug_1671648.py
@@ -135,16 +135,3 @@ class TestRetryBetweenComputeNodeBuilds(test.TestCase):
# Assert that we retried.
self.assertEqual(2, self.attempts)
-
-
-class TestRetryBetweenComputeNodeBuildsNoAllocations(
- TestRetryBetweenComputeNodeBuilds):
- """Tests the reschedule scenario using a scheduler driver which does
- not use Placement.
- """
- def setUp(self):
- super(TestRetryBetweenComputeNodeBuildsNoAllocations, self).setUp()
- # We need to mock the FilterScheduler to not use Placement so that
- # allocations won't be created during scheduling.
- self.scheduler_service.manager.driver.USES_ALLOCATION_CANDIDATES = \
- False
diff --git a/nova/tests/functional/regressions/test_bug_1741125.py b/nova/tests/functional/regressions/test_bug_1741125.py
index 72d69b8e9c..3f5da03043 100644
--- a/nova/tests/functional/regressions/test_bug_1741125.py
+++ b/nova/tests/functional/regressions/test_bug_1741125.py
@@ -78,17 +78,3 @@ class TestServerResizeReschedule(integrated_helpers.ProviderUsageBaseTestCase):
'VERIFY_RESIZE')
self.assertEqual(self.flavor2['name'],
server['flavor']['original_name'])
-
-
-class TestServerResizeRescheduleWithNoAllocations(
- TestServerResizeReschedule):
- """Tests the reschedule scenario using a scheduler driver which does not
- use Placement.
- """
-
- def setUp(self):
- super(TestServerResizeRescheduleWithNoAllocations, self).setUp()
- # We need to mock the FilterScheduler to not use Placement so that
- # allocations won't be created during scheduling.
- self.scheduler_service.manager.driver.USES_ALLOCATION_CANDIDATES = \
- False
diff --git a/nova/tests/functional/regressions/test_bug_1741307.py b/nova/tests/functional/regressions/test_bug_1741307.py
deleted file mode 100644
index a23f6cc185..0000000000
--- a/nova/tests/functional/regressions/test_bug_1741307.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# 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 nova import test
-from nova.tests import fixtures as nova_fixtures
-from nova.tests.functional import fixtures as func_fixtures
-from nova.tests.functional import integrated_helpers
-
-
-class TestResizeWithNoAllocationScheduler(
- test.TestCase, integrated_helpers.InstanceHelperMixin):
- """Regression tests for bug #1741307
-
- Some scheduler drivers, like the old CachingScheduler driver, do not use
- Placement to make claims (allocations) against compute nodes during
- scheduling like the FilterScheduler does.
- During a cold migrate / resize, the FilterScheduler will "double up" the
- instance allocations so the instance has resource allocations made against
- both the source node and the chosen destination node. Conductor will then
- attempt to "swap" the source node allocation to the migration record. If
- using a non-Placement driver, there are no allocations for the instance on
- the source node and conductor fails. Note that if the compute running the
- instance was running Ocata code or older, then the compute itself would
- create the allocations in Placement via the ResourceTracker, but once all
- computes are upgraded to Pike or newer, the compute no longer creates
- allocations in Placement because it assumes the scheduler is doing that,
- which is not the case with these outlier scheduler drivers.
-
- This is a regression test to show the failure before it's fixed and then
- can be used to confirm the fix.
- """
-
- microversion = 'latest'
-
- def setUp(self):
- super(TestResizeWithNoAllocationScheduler, self).setUp()
-
- self.useFixture(nova_fixtures.RealPolicyFixture())
- self.useFixture(nova_fixtures.GlanceFixture(self))
- self.useFixture(nova_fixtures.NeutronFixture(self))
- self.useFixture(func_fixtures.PlacementFixture())
-
- api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(
- api_version='v2.1'))
-
- self.api = api_fixture.admin_api
- self.api.microversion = self.microversion
-
- self.start_service('conductor')
-
- # Create two compute nodes/services.
- for host in ('host1', 'host2'):
- self.start_service('compute', host=host)
-
- scheduler_service = self.start_service('scheduler')
- # We need to mock the FilterScheduler to not use Placement so that
- # allocations won't be created during scheduling.
- scheduler_service.manager.driver.USES_ALLOCATION_CANDIDATES = False
-
- flavors = self.api.get_flavors()
- self.old_flavor = flavors[0]
- self.new_flavor = flavors[1]
-
- def test_resize(self):
- # Create our server without networking just to keep things simple.
- server_req = self._build_server(
- image_uuid='155d900f-4e14-4e4c-a73d-069cbf4541e6',
- flavor_id=self.old_flavor['id'],
- networks='none')
- server = self.api.post_server({'server': server_req})
- server = self._wait_for_state_change(server, 'ACTIVE')
-
- original_host = server['OS-EXT-SRV-ATTR:host']
- target_host = 'host1' if original_host == 'host2' else 'host2'
-
- # Issue the resize request.
- post = {
- 'resize': {
- 'flavorRef': self.new_flavor['id']
- }
- }
- self.api.post_server_action(server['id'], post)
-
- # Poll the server until the resize is done.
- server = self._wait_for_state_change(server, 'VERIFY_RESIZE')
- # Assert that the server was migrated to the other host.
- self.assertEqual(target_host, server['OS-EXT-SRV-ATTR:host'])
- # Confirm the resize.
- post = {'confirmResize': None}
- self.api.post_server_action(server['id'], post,
- check_response_status=[204])