diff --git a/bin/tests/system/cpu/prereq.sh b/bin/tests/system/cpu/prereq.sh deleted file mode 100644 index 7f9f6c06d5..0000000000 --- a/bin/tests/system/cpu/prereq.sh +++ /dev/null @@ -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 diff --git a/bin/tests/system/cpu/tests_sh_cpu.py b/bin/tests/system/cpu/tests_sh_cpu.py index f2f30c6abd..48ed3309fe 100644 --- a/bin/tests/system/cpu/tests_sh_cpu.py +++ b/bin/tests/system/cpu/tests_sh_cpu.py @@ -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() diff --git a/bin/tests/system/isctest/mark.py b/bin/tests/system/isctest/mark.py index 0dbb0ca8f3..e80dc62053 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -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")