]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Move the cpu prereq.sh check to a with_cpu_affinity marker
authorNicki Křížek <nicki@isc.org>
Wed, 1 Jul 2026 13:40:07 +0000 (13:40 +0000)
committerNicki Křížek <nicki@isc.org>
Fri, 10 Jul 2026 11:17:41 +0000 (13:17 +0200)
Assisted-by: Claude:claude-opus-4-8
bin/tests/system/cpu/prereq.sh [deleted file]
bin/tests/system/cpu/tests_sh_cpu.py
bin/tests/system/isctest/mark.py

diff --git a/bin/tests/system/cpu/prereq.sh b/bin/tests/system/cpu/prereq.sh
deleted file mode 100644 (file)
index 7f9f6c0..0000000
+++ /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
index f2f30c6abd4091b1a95f21881d15e8c3817ea28a..48ed3309fe5b02d6c77600d944a341ed9349872b 100644 (file)
 
 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()
index 0dbb0ca8f35083a40bfe83cd0add1f14addea5be..e80dc6205391b865bc2214d9be0c116666030c07 100644 (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")