From 29c609be2361dc236cd724d1386f5fdc26ec3671 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Sat, 4 Oct 2025 12:58:46 +0200 Subject: [PATCH] [func]Test with optimize_for_wide_provider_trees Placement implemented a workaround optimization for large provider trees. This patch enables that optimization to run the pci_in_placement related nova functional tests with this config enabled. Change-Id: I0b5e13673cb4cc7c57aeae50914ace443dfc18fa Signed-off-by: Balazs Gibizer --- nova/tests/functional/integrated_helpers.py | 4 +++- nova/tests/functional/libvirt/test_pci_in_placement.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index 5f01a62563..fcaab93b73 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -1376,7 +1376,9 @@ class _IntegratedTestBase(test.TestCase, PlacementInstanceHelperMixin): if self.CAST_AS_CALL: self.useFixture(nova_fixtures.CastAsCallFixture(self)) - self.placement = self.useFixture(func_fixtures.PlacementFixture()).api + self.placement_fixture = self.useFixture( + func_fixtures.PlacementFixture()) + self.placement = self.placement_fixture.api self.neutron = self.useFixture(nova_fixtures.NeutronFixture(self)) self.cinder = self.useFixture(nova_fixtures.CinderFixture(self)) self.glance = self.useFixture(nova_fixtures.GlanceFixture(self)) diff --git a/nova/tests/functional/libvirt/test_pci_in_placement.py b/nova/tests/functional/libvirt/test_pci_in_placement.py index 1e04b02a8d..1386e1c49f 100644 --- a/nova/tests/functional/libvirt/test_pci_in_placement.py +++ b/nova/tests/functional/libvirt/test_pci_in_placement.py @@ -87,6 +87,14 @@ class PlacementPCIReportingTests(test_pci_sriov_servers._PCIServersTestBase): def setUp(self): super().setUp() + # Use tuned placement config to exercise the more complex code + # path when pci_in_placement is used + self.placement_fixture.conf_fixture.config( + group='workarounds', optimize_for_wide_provider_trees=True) + self.placement_fixture.conf_fixture.config( + group='placement', + allocation_candidates_generation_strategy="breadth-first") + self.flags(group="pci", report_in_placement=True) # These tests should not depend on the host's sysfs