From cc833359870d3962326c35094adea2f525ec8141 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 7 Aug 2017 17:49:39 +0200 Subject: [PATCH] replace chance with filter scheduler in func tests FilterScheduler is the only scheduler driver that properly integrated with placement api so this patch changes the functional test environment to use the FilterScheduler instead of the ChanceScheduler. The amount of vcpu the SmallFakeDriver reports need to be bumped to 2 as during resize to same host the filter scheduler doubles the allocation on the host. Simply relying on the 16.0 default allocation ratio does not work as the max_unit of the vcpu does not use the allocation ratio to avoid that a single server overallocates the cpu. The only change in unit test is test_create_instance_with_oversubscribed_cpu which also loads the SmallFakeDriver and asserts available resources on it. Change-Id: I12de2e195022593ea2a3e2894f2c3b5226930d4f --- doc/api_samples/os-hosts/host-get-resp.json | 2 +- .../os-hypervisors/hypervisors-detail-resp.json | 2 +- doc/api_samples/os-hypervisors/hypervisors-show-resp.json | 2 +- .../os-hypervisors/hypervisors-statistics-resp.json | 2 +- .../os-hypervisors/v2.28/hypervisors-detail-resp.json | 2 +- .../os-hypervisors/v2.28/hypervisors-show-resp.json | 2 +- .../os-hypervisors/v2.28/hypervisors-statistics-resp.json | 2 +- .../os-hypervisors/v2.33/hypervisors-detail-resp.json | 2 +- .../os-hypervisors/v2.53/hypervisors-detail-resp.json | 2 +- .../v2.53/hypervisors-detail-with-servers-resp.json | 2 +- .../os-hypervisors/v2.53/hypervisors-show-resp.json | 2 +- .../v2.53/hypervisors-show-with-servers-resp.json | 2 +- .../os-hypervisors/v2.53/hypervisors-statistics-resp.json | 2 +- .../api_samples/os-hosts/host-get-resp.json.tpl | 2 +- .../os-hypervisors/hypervisors-detail-resp.json.tpl | 2 +- .../os-hypervisors/hypervisors-show-resp.json.tpl | 2 +- .../os-hypervisors/hypervisors-statistics-resp.json.tpl | 2 +- .../os-hypervisors/v2.28/hypervisors-detail-resp.json.tpl | 2 +- .../os-hypervisors/v2.28/hypervisors-show-resp.json.tpl | 2 +- .../v2.28/hypervisors-statistics-resp.json.tpl | 2 +- .../os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl | 2 +- .../os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl | 2 +- .../v2.53/hypervisors-detail-with-servers-resp.json.tpl | 2 +- .../os-hypervisors/v2.53/hypervisors-show-resp.json.tpl | 2 +- .../v2.53/hypervisors-show-with-servers-resp.json.tpl | 2 +- .../v2.53/hypervisors-statistics-resp.json.tpl | 2 +- nova/tests/functional/integrated_helpers.py | 4 ++-- .../notification_sample_tests/notification_sample_base.py | 1 - nova/tests/functional/regressions/test_bug_1522536.py | 1 - nova/tests/functional/regressions/test_bug_1548980.py | 1 - nova/tests/functional/regressions/test_bug_1595962.py | 1 - nova/tests/functional/regressions/test_bug_1671648.py | 4 ---- nova/tests/functional/regressions/test_bug_1675570.py | 1 - nova/tests/functional/regressions/test_bug_1679750.py | 2 -- nova/tests/functional/regressions/test_bug_1682693.py | 1 - nova/tests/functional/regressions/test_bug_1689692.py | 1 - nova/tests/functional/test_list_servers_ip_filter.py | 7 ++++--- nova/tests/functional/test_servers.py | 4 ---- nova/tests/unit/compute/test_compute.py | 2 +- nova/virt/fake.py | 2 +- 40 files changed, 34 insertions(+), 50 deletions(-) diff --git a/doc/api_samples/os-hosts/host-get-resp.json b/doc/api_samples/os-hosts/host-get-resp.json index fc19d3a170fc..c92fafc187f3 100644 --- a/doc/api_samples/os-hosts/host-get-resp.json +++ b/doc/api_samples/os-hosts/host-get-resp.json @@ -2,7 +2,7 @@ "host": [ { "resource": { - "cpu": 1, + "cpu": 2, "disk_gb": 1028, "host": "c1a7de0ac9d94e4baceae031d05caae3", "memory_mb": 8192, diff --git a/doc/api_samples/os-hypervisors/hypervisors-detail-resp.json b/doc/api_samples/os-hypervisors/hypervisors-detail-resp.json index 18e33ad61b39..c8090887d8fe 100644 --- a/doc/api_samples/os-hypervisors/hypervisors-detail-resp.json +++ b/doc/api_samples/os-hypervisors/hypervisors-detail-resp.json @@ -23,7 +23,7 @@ "id": 2, "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ] diff --git a/doc/api_samples/os-hypervisors/hypervisors-show-resp.json b/doc/api_samples/os-hypervisors/hypervisors-show-resp.json index 2a2183d1be86..1874160a252f 100644 --- a/doc/api_samples/os-hypervisors/hypervisors-show-resp.json +++ b/doc/api_samples/os-hypervisors/hypervisors-show-resp.json @@ -22,7 +22,7 @@ "id": 2, "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/doc/api_samples/os-hypervisors/hypervisors-statistics-resp.json b/doc/api_samples/os-hypervisors/hypervisors-statistics-resp.json index 2cfb51e7030a..917594a8ed2f 100644 --- a/doc/api_samples/os-hypervisors/hypervisors-statistics-resp.json +++ b/doc/api_samples/os-hypervisors/hypervisors-statistics-resp.json @@ -10,7 +10,7 @@ "memory_mb": 8192, "memory_mb_used": 512, "running_vms": 0, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } \ No newline at end of file diff --git a/doc/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json b/doc/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json index db5934bfb76c..c7bd282f4340 100644 --- a/doc/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json +++ b/doc/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json @@ -36,7 +36,7 @@ "id": 2, "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ] diff --git a/doc/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json b/doc/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json index 03c9a5d2492e..84da68bb63ce 100644 --- a/doc/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json +++ b/doc/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json @@ -35,7 +35,7 @@ "id": 2, "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/doc/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json b/doc/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json index 2cfb51e7030a..917594a8ed2f 100644 --- a/doc/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json +++ b/doc/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json @@ -10,7 +10,7 @@ "memory_mb": 8192, "memory_mb_used": 512, "running_vms": 0, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } \ No newline at end of file diff --git a/doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json b/doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json index 42adb643fe3b..a571df450ebb 100644 --- a/doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json +++ b/doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json @@ -36,7 +36,7 @@ "id": 7, "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ], diff --git a/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json b/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json index 843af88e973a..6a29046897ec 100644 --- a/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json +++ b/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json @@ -36,7 +36,7 @@ "id": "62f62f6e-a713-4cbe-87d3-3ecf8a1e0f8d", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ], diff --git a/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json b/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json index c9342cb416e3..51046e6d0bb3 100644 --- a/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json +++ b/doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json @@ -46,7 +46,7 @@ "id": "5d343e1d-938e-4284-b98b-6a2b5406ba76", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ] diff --git a/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json b/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json index ba26210541b7..cbdf4129c278 100644 --- a/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json +++ b/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json @@ -35,7 +35,7 @@ "id": "5d343e1d-938e-4284-b98b-6a2b5406ba76", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json b/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json index 5477cb084d67..1f0b34400d6c 100644 --- a/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json +++ b/doc/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json @@ -45,7 +45,7 @@ "id": "5d343e1d-938e-4284-b98b-6a2b5406ba76", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/doc/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json b/doc/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json index 2cfb51e7030a..917594a8ed2f 100644 --- a/doc/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json +++ b/doc/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json @@ -10,7 +10,7 @@ "memory_mb": 8192, "memory_mb_used": 512, "running_vms": 0, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } \ No newline at end of file diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hosts/host-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hosts/host-get-resp.json.tpl index efb234b436ef..a7016e5c0faf 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hosts/host-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hosts/host-get-resp.json.tpl @@ -2,7 +2,7 @@ "host": [ { "resource": { - "cpu": 1, + "cpu": 2, "disk_gb": 1028, "host": "%(host_name)s", "memory_mb": 8192, diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-detail-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-detail-resp.json.tpl index 54be4d2c8fb6..1fc438d22957 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-detail-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-detail-resp.json.tpl @@ -23,7 +23,7 @@ "id": "%(int:service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ] diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-show-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-show-resp.json.tpl index 29e9109290af..6a8f159009b2 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-show-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-show-resp.json.tpl @@ -22,7 +22,7 @@ "id": "%(int:service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-statistics-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-statistics-resp.json.tpl index 2cfb51e7030a..917594a8ed2f 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-statistics-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/hypervisors-statistics-resp.json.tpl @@ -10,7 +10,7 @@ "memory_mb": 8192, "memory_mb_used": 512, "running_vms": 0, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } \ No newline at end of file diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json.tpl index 9013accf7cb2..0282d6a61dae 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-detail-resp.json.tpl @@ -36,7 +36,7 @@ "id": "%(int:service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ] diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json.tpl index 7284a88dbacf..437968451bd5 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json.tpl @@ -35,7 +35,7 @@ "id": "%(int:service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json.tpl index 2cfb51e7030a..917594a8ed2f 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.28/hypervisors-statistics-resp.json.tpl @@ -10,7 +10,7 @@ "memory_mb": 8192, "memory_mb_used": 512, "running_vms": 0, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } \ No newline at end of file diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl index a45e6a2a07af..2b9ff8c8ece6 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl @@ -36,7 +36,7 @@ "id": 7, "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ], diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl index f218d516f2a2..17e5585391eb 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl @@ -36,7 +36,7 @@ "id": "%(service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ], diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json.tpl index 2fc221df728a..a876f02d6696 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-with-servers-resp.json.tpl @@ -46,7 +46,7 @@ "id": "%(service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } ] diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json.tpl index 760189ded40b..d1f6c45c3363 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-resp.json.tpl @@ -35,7 +35,7 @@ "id": "%(service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json.tpl index 255f60796d7d..c1adcf45e6bc 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json.tpl @@ -45,7 +45,7 @@ "id": "%(service_id)s", "disabled_reason": null }, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json.tpl index 2cfb51e7030a..917594a8ed2f 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-statistics-resp.json.tpl @@ -10,7 +10,7 @@ "memory_mb": 8192, "memory_mb_used": 512, "running_vms": 0, - "vcpus": 1, + "vcpus": 2, "vcpus_used": 0 } } \ No newline at end of file diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index 2c5b9c2af277..de50edcdb669 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -77,18 +77,18 @@ class _IntegratedTestBase(test.TestCase): self.flags(use_neutron=self.USE_NEUTRON) nova.tests.unit.image.fake.stub_out_image_service(self) - self._setup_services() self.useFixture(cast_as_call.CastAsCall(self)) self.useFixture(nova_fixtures.PlacementFixture()) + self._setup_services() + self.addCleanup(nova.tests.unit.image.fake.FakeImageService_reset) def _setup_compute_service(self): return self.start_service('compute') def _setup_scheduler_service(self): - self.flags(group='scheduler', driver='chance_scheduler') return self.start_service('scheduler') def _setup_services(self): diff --git a/nova/tests/functional/notification_sample_tests/notification_sample_base.py b/nova/tests/functional/notification_sample_tests/notification_sample_base.py index 22266ea9545c..4a7942cc1f62 100644 --- a/nova/tests/functional/notification_sample_tests/notification_sample_base.py +++ b/nova/tests/functional/notification_sample_tests/notification_sample_base.py @@ -78,7 +78,6 @@ class NotificationSampleTestBase(test.TestCase, self.useFixture(utils_fixture.TimeFixture(test_services.fake_utcnow())) - self.flags(driver='chance_scheduler', group='scheduler') # the image fake backend needed for image discovery nova.tests.unit.image.fake.stub_out_image_service(self) self.addCleanup(nova.tests.unit.image.fake.FakeImageService_reset) diff --git a/nova/tests/functional/regressions/test_bug_1522536.py b/nova/tests/functional/regressions/test_bug_1522536.py index 2f335c011f55..bc32fd366ee5 100644 --- a/nova/tests/functional/regressions/test_bug_1522536.py +++ b/nova/tests/functional/regressions/test_bug_1522536.py @@ -38,7 +38,6 @@ class TestServerGet(test.TestCase): nova.tests.unit.image.fake.stub_out_image_service(self) self.start_service('conductor') - self.flags(driver='chance_scheduler', group='scheduler') self.start_service('scheduler') self.compute = self.start_service('compute') diff --git a/nova/tests/functional/regressions/test_bug_1548980.py b/nova/tests/functional/regressions/test_bug_1548980.py index 1bf472ccdd93..cea688f7de6d 100644 --- a/nova/tests/functional/regressions/test_bug_1548980.py +++ b/nova/tests/functional/regressions/test_bug_1548980.py @@ -46,7 +46,6 @@ class TestServerGet(test.TestCase): nova.tests.unit.image.fake.stub_out_image_service(self) self.start_service('conductor') - self.flags(driver='chance_scheduler', group='scheduler') self.start_service('scheduler') self.compute = self.start_service('compute') self.consoleauth = self.start_service('consoleauth') diff --git a/nova/tests/functional/regressions/test_bug_1595962.py b/nova/tests/functional/regressions/test_bug_1595962.py index df0fb6af7a3e..7070b94a5ed9 100644 --- a/nova/tests/functional/regressions/test_bug_1595962.py +++ b/nova/tests/functional/regressions/test_bug_1595962.py @@ -67,7 +67,6 @@ class TestSerialConsoleLiveMigrate(test.TestCase): self.flags(host="test_compute1") self.start_service('conductor') - self.flags(driver='chance_scheduler', group='scheduler') self.start_service('scheduler') self.compute = self.start_service('compute', host='test_compute1') self.consoleauth = self.start_service('consoleauth') diff --git a/nova/tests/functional/regressions/test_bug_1671648.py b/nova/tests/functional/regressions/test_bug_1671648.py index e013f0a2d668..08f874a7a3f0 100644 --- a/nova/tests/functional/regressions/test_bug_1671648.py +++ b/nova/tests/functional/regressions/test_bug_1671648.py @@ -63,10 +63,6 @@ class TestRetryBetweenComputeNodeBuilds(test.TestCase): self.start_service('conductor') self.start_service('consoleauth') - - # Configure a minimal filter scheduler setup. - self.flags(enabled_filters=['ComputeFilter', 'RetryFilter'], - group='filter_scheduler') self.start_service('scheduler') # We start two compute services because we're going to fake one diff --git a/nova/tests/functional/regressions/test_bug_1675570.py b/nova/tests/functional/regressions/test_bug_1675570.py index d39602c77641..b07546f7e83f 100644 --- a/nova/tests/functional/regressions/test_bug_1675570.py +++ b/nova/tests/functional/regressions/test_bug_1675570.py @@ -61,7 +61,6 @@ class TestLocalDeleteAttachedVolumes(test.TestCase): nova.tests.unit.image.fake.stub_out_image_service(self) self.start_service('conductor') - self.flags(driver='chance_scheduler', group='scheduler') self.start_service('scheduler') self.start_service('compute') # The consoleauth service is needed for deleting console tokens. diff --git a/nova/tests/functional/regressions/test_bug_1679750.py b/nova/tests/functional/regressions/test_bug_1679750.py index b93ce5107c5c..161044668435 100644 --- a/nova/tests/functional/regressions/test_bug_1679750.py +++ b/nova/tests/functional/regressions/test_bug_1679750.py @@ -41,8 +41,6 @@ class TestLocalDeleteAllocations(test.TestCase, self.start_service('conductor') self.start_service('consoleauth') - self.flags(enabled_filters=['RetryFilter', 'ComputeFilter'], - group='filter_scheduler') self.start_service('scheduler') self.compute = self.start_service('compute') diff --git a/nova/tests/functional/regressions/test_bug_1682693.py b/nova/tests/functional/regressions/test_bug_1682693.py index c16229ead530..485bab9bb2ca 100644 --- a/nova/tests/functional/regressions/test_bug_1682693.py +++ b/nova/tests/functional/regressions/test_bug_1682693.py @@ -50,7 +50,6 @@ class ServerTagsFilteringTest(test.TestCase, self.api.microversion = 'latest' self.start_service('conductor') - self.flags(driver='chance_scheduler', group='scheduler') self.start_service('scheduler') self.start_service('compute') # The consoleauth service is needed for deleting console tokens when diff --git a/nova/tests/functional/regressions/test_bug_1689692.py b/nova/tests/functional/regressions/test_bug_1689692.py index 820d2837d11d..1b6cf48d835e 100644 --- a/nova/tests/functional/regressions/test_bug_1689692.py +++ b/nova/tests/functional/regressions/test_bug_1689692.py @@ -52,7 +52,6 @@ class ServerListLimitMarkerCell0Test(test.TestCase, self.api.microversion = 'latest' self.start_service('conductor') - self.flags(driver='chance_scheduler', group='scheduler') self.start_service('scheduler') # We don't start the compute service because we want NoValidHost so # all of the instances go into ERROR state and get put into cell0. diff --git a/nova/tests/functional/test_list_servers_ip_filter.py b/nova/tests/functional/test_list_servers_ip_filter.py index b9719ad54bfa..e52ee9ad1faf 100644 --- a/nova/tests/functional/test_list_servers_ip_filter.py +++ b/nova/tests/functional/test_list_servers_ip_filter.py @@ -37,10 +37,11 @@ class TestListServersIpFilter(test.TestCase): # the image fake backend needed for image discovery nova.tests.unit.image.fake.stub_out_image_service(self) + self.useFixture(nova_fixtures.PlacementFixture()) + self.start_service('conductor') - # Use the chance scheduler to bypass filtering and just pick the single - # compute host that we have. - self.flags(driver='chance_scheduler', group='scheduler') + self.flags(enabled_filters=['ComputeFilter'], + group='filter_scheduler') self.start_service('scheduler') self.start_service('compute') self.start_service('consoleauth') diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py index 4cc25e06985f..e596e8b8394d 100644 --- a/nova/tests/functional/test_servers.py +++ b/nova/tests/functional/test_servers.py @@ -1068,15 +1068,11 @@ class ServerMovingTests(test.TestCase, integrated_helpers.InstanceHelperMixin): REQUIRES_LOCKING = True microversion = 'latest' - _enabled_filters = ['RetryFilter', 'ComputeFilter'] - def setUp(self): # NOTE(danms): The test defaults to using SmallFakeDriver, # which only has one vcpu, which can't take the doubled allocation # we're now giving it. So, use the bigger MediumFakeDriver here. self.flags(compute_driver='fake.MediumFakeDriver') - self.flags(enabled_filters=self._enabled_filters, - group='filter_scheduler') super(ServerMovingTests, self).setUp() self.useFixture(policy_fixture.RealPolicyFixture()) diff --git a/nova/tests/unit/compute/test_compute.py b/nova/tests/unit/compute/test_compute.py index aebfebef38d0..203fe7840c96 100644 --- a/nova/tests/unit/compute/test_compute.py +++ b/nova/tests/unit/compute/test_compute.py @@ -1700,7 +1700,7 @@ class ComputeTestCase(BaseTestCase, # get total memory as reported by virt driver: resources = self.compute.driver.get_available_resource(NODENAME) - self.assertEqual(1, resources['vcpus']) + self.assertEqual(2, resources['vcpus']) # build an instance, specifying an amount of memory that exceeds # total_mem_mb, but is less than the oversubscribed limit: diff --git a/nova/virt/fake.py b/nova/virt/fake.py index a44d75512fb1..5cb076aae226 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -596,7 +596,7 @@ class SmallFakeDriver(FakeDriver): # instead of requiring new samples every time those # values are adjusted allow them to be overwritten here. - vcpus = 1 + vcpus = 2 memory_mb = 8192 local_gb = 1028