From 0e833e3b2090ca9e2f5d6f35c15d088aa9d0983d Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Thu, 22 Feb 2024 22:11:16 +0000 Subject: [PATCH] Update ``PortNumaAffinityPolicyExtensionTestCase`` tested policies In [1], the available port NUMA policies constant is updated with a new one. Because this new policy, included in a new extension, has not been yet added to Neutron, it is needed to specify what policies are valid and tested in Neutron. Related-Bug: #2052786 [1]https://review.opendev.org/c/openstack/neutron-lib/+/903531 Change-Id: I5366864d0acc479aa111456e5bf0c57bb963c528 --- .../unit/extensions/test_port_numa_affinity_policy.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/neutron/tests/unit/extensions/test_port_numa_affinity_policy.py b/neutron/tests/unit/extensions/test_port_numa_affinity_policy.py index 66503f80487..dab245a7edc 100644 --- a/neutron/tests/unit/extensions/test_port_numa_affinity_policy.py +++ b/neutron/tests/unit/extensions/test_port_numa_affinity_policy.py @@ -23,6 +23,12 @@ from neutron.db import port_numa_affinity_policy_db as pnap_db from neutron.tests.unit.db import test_db_base_plugin_v2 +TESTED_POLICIES = (constants.PORT_NUMA_POLICY_REQUIRED, + constants.PORT_NUMA_POLICY_PREFERRED, + constants.PORT_NUMA_POLICY_LEGACY, + ) + + class PortNumaAffinityPolicyExtensionTestPlugin( db_base_plugin_v2.NeutronDbPluginV2, pnap_db.PortNumaAffinityPolicyDbMixin): @@ -78,9 +84,9 @@ class PortNumaAffinityPolicyExtensionTestCase( self.assertEqual(numa_affinity_policy, res['port']['numa_affinity_policy']) - @ddt.data(*constants.PORT_NUMA_POLICIES, None) + @ddt.data(*TESTED_POLICIES, None) def test_create_and_update_port_numa_affinity_policy(self, numa_affinity_policy): port = self._create_and_check_port_nap(numa_affinity_policy) - for new_nap in (*constants.PORT_NUMA_POLICIES, None): + for new_nap in (*TESTED_POLICIES, None): self._update_and_check_port_nap(port, new_nap)