From 0dfbcd74642b16432b800b51f304a89d762e3ff1 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 20 Mar 2019 22:23:27 +0000 Subject: [PATCH] Don't register placement opts mutiple times in a test The test_local_delete_removes_allocations_after_compute_restart test was trying to register placement config opts 3 times when only once is necessary, and if there are CLI opts being registered, only once is allowed. With change I4cd3d637878eb5bb798b78fd73f5be99e141da9d in placement, those opts gained some CLI opts, causing this test to fail. The depends-on is to a change in the placement-side PlacementFixture to make it possible to not register opts when calling the fixture, allowing the safe reuse of the already registered config. Depends-On: I360a306b5d05ada75274733038b73ec2f2bdc4d4 Change-Id: I042e41ac8c41c0e5f0389904eb548e0e97d54c60 Closes-Bug: #1821092 --- nova/tests/functional/regressions/test_bug_1679750.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nova/tests/functional/regressions/test_bug_1679750.py b/nova/tests/functional/regressions/test_bug_1679750.py index 8d5c55e30f52..581108e3a118 100644 --- a/nova/tests/functional/regressions/test_bug_1679750.py +++ b/nova/tests/functional/regressions/test_bug_1679750.py @@ -71,7 +71,8 @@ class TestLocalDeleteAllocations(test.TestCase, set_config=True)) # Get allocations, make sure they are 0. with func_fixtures.PlacementFixture( - conf_fixture=placement_config, db=False) as placement: + conf_fixture=placement_config, db=False, + register_opts=False) as placement: compute = self.start_service('compute') placement_api = placement.api resp = placement_api.get('/resource_providers') @@ -103,7 +104,8 @@ class TestLocalDeleteAllocations(test.TestCase, self._wait_until_deleted(server) with func_fixtures.PlacementFixture( - conf_fixture=placement_config, db=False) as placement: + conf_fixture=placement_config, db=False, + register_opts=False) as placement: placement_api = placement.api # Assert usages are still non-zero. usages_during = self._get_usages(placement_api, rp_uuid)