Move the cpu prereq.sh check to a with_cpu_affinity marker

Assisted-by: Claude:claude-opus-4-8
This commit is contained in:
Nicki Křížek 2026-07-01 13:40:07 +00:00
parent c644b7acfb
commit 26c26e63fc
3 changed files with 13 additions and 22 deletions

View file

@ -1,21 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
command -v cpuset >/dev/null || command -v numactl >/dev/null || command -v taskset >/dev/null || {
echo_i "This test requires cpuset, numactl, or taskset." >&2
exit 255
}
exit 0

View file

@ -11,13 +11,20 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
import isctest.mark
EXTRA_ARTIFACTS = pytest.mark.extra_artifacts(
[
"named.run.*",
"ns1/managed-keys.*",
]
)
pytestmark = [
isctest.mark.with_cpu_affinity,
EXTRA_ARTIFACTS,
]
def test_cpu(run_tests_sh):
run_tests_sh()

View file

@ -127,6 +127,11 @@ without_tsan = pytest.mark.skipif(
os.getenv("FEATURE_TSAN") == "1", reason="incompatible with ThreadSanitizer (TSAN)"
)
with_cpu_affinity = pytest.mark.skipif(
not (shutil.which("cpuset") or shutil.which("numactl") or shutil.which("taskset")),
reason="cpuset, numactl, or taskset is required",
)
softhsm2_environment = pytest.mark.skipif(
not (
os.getenv("SOFTHSM2_CONF")