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
This commit is contained in:
Rodolfo Alonso Hernandez 2024-02-22 22:11:16 +00:00
parent ebb7ec1eed
commit 0e833e3b20
1 changed files with 8 additions and 2 deletions

View File

@ -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)