From e8ffa780d8cc21e39dab0ea6f79966aeba312e93 Mon Sep 17 00:00:00 2001 From: jamepark4 <jparker@redhat.com> Date: Tue, 28 May 2024 14:28:59 -0400 Subject: [PATCH] Add realtime mask as parameter Update realtime mask to be configurable since the dedicated cpus may not match the '1-2' mask currently present in test. Also update job deployment to use '1-2' in devstack environment. Change-Id: Ia04227209ac45595826ee4715bf1b5052faa9c64 --- devstack/plugin.sh | 1 + devstack/settings | 1 + whitebox_tempest_plugin/api/compute/test_cpu_pinning.py | 8 ++++++-- whitebox_tempest_plugin/config.py | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index c8940541..bd48099e 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -28,6 +28,7 @@ function configure { iniset $TEMPEST_CONFIG whitebox-hardware cpu_topology "$WHITEBOX_CPU_TOPOLOGY" iniset $TEMPEST_CONFIG whitebox-hardware dedicated_cpus_per_numa "$WHITEBOX_DEDICATED_CPUS_PER_NUMA" iniset $TEMPEST_CONFIG whitebox-hardware shared_cpus_per_numa "$WHITEBOX_SHARED_CPUS_PER_NUMA" + iniset $TEMPEST_CONFIG whitebox-hardware realtime_mask "$WHITEBOX_REALTIME_MASK" iniset $TEMPEST_CONFIG whitebox-hardware configured_hugepage_sizes "$WHITEBOX_CONFIGURED_HUGEPAGES" iniset $TEMPEST_CONFIG compute-feature-enabled virtio_rng "$COMPUTE_FEATURE_VIRTIO_RNG" diff --git a/devstack/settings b/devstack/settings index 17f3dc58..567754c0 100644 --- a/devstack/settings +++ b/devstack/settings @@ -12,6 +12,7 @@ WHITEBOX_HUGEPAGE_GUEST_RAM_SIZE=${WHITEBOX_HUGEPAGE_GUEST_RAM_SIZE:-1024} WHITEBOX_CPU_TOPOLOGY=${WHITEBOX_CPU_TOPOLOGY:-''} WHITEBOX_DEDICATED_CPUS_PER_NUMA=${WHITEBOX_DEDICATED_CPUS_PER_NUMA:-4} WHITEBOX_SHARED_CPUS_PER_NUMA=${WHITEBOX_SHARED_CPUS_PER_NUMA:-2} +WHITEBOX_REALTIME_MASK=${WHITEBOX_REALTIME_MASK:-'1-2'} WHITEBOX_CONFIGURED_HUGEPAGES=${WHITEBOX_CONFIGURED_HUGEPAGES:-'2048,1048576'} COMPUTE_FEATURE_VIRTIO_RNG=${COMPUTE_FEATURE_VIRTIO_RNG:-'True'} diff --git a/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py b/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py index 76c5495f..2d57fec3 100644 --- a/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py +++ b/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py @@ -235,8 +235,12 @@ class CPUPolicyTest(BasePinningTest): cpu_pinnings_a, cpu_pinnings_b)) + @testtools.skipUnless(CONF.whitebox_hardware.realtime_mask, + 'Realtime mask was not provided.') def test_realtime_cpu(self): - realtime_mask = '1-2' + realtime_mask = CONF.whitebox_hardware.realtime_mask + realtime_set = hardware.parse_cpu_spec(realtime_mask) + vcpu_count = len(realtime_set) + 1 specs = self.dedicated_cpu_policy.copy() specs.update({ @@ -244,7 +248,7 @@ class CPUPolicyTest(BasePinningTest): 'hw:cpu_realtime_mask': realtime_mask, }) - flavor = self.create_flavor(vcpus=3, extra_specs=specs) + flavor = self.create_flavor(vcpus=vcpu_count, extra_specs=specs) server = self.create_test_server( flavor=flavor['id'], wait_until='ACTIVE') diff --git a/whitebox_tempest_plugin/config.py b/whitebox_tempest_plugin/config.py index 09c53b25..1f5e8a74 100644 --- a/whitebox_tempest_plugin/config.py +++ b/whitebox_tempest_plugin/config.py @@ -243,6 +243,10 @@ hardware_opts = [ 'shared_cpus_per_numa', default=0, help='Number of pCPUs allocated for cpu_shared_set per NUMA'), + cfg.StrOpt( + 'realtime_mask', + default=None, + help='CPU mask used when configuring hw:cpu_realtime_mask'), cfg.StrOpt( 'sriov_physnet', default=None,