Skip to contentSkip to conversation

python3-pyroute2: Add missing python3-resource runtime dependency

PATCH New Khem Raj 1 participant 10 messages Oct 31

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/10 python3-pyroute2: Add missing python3-resource runtime dependency

From: Khem Raj <[email protected]>

pyroute2/ndb/task_manager.py imports the resource module and it is pulled in when importing pyroute2, so every ptest module failed to import with:

ModuleNotFoundError: No module named 'resource'

---
 meta-python/recipes-devtools/python/python3-pyroute2_0.9.7.bb | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-devtools/python/python3-pyroute2_0.9.7.bb +1 -0
index d83b65f6da..a0abcd2514 100644
@@ -20,6 +20,7 @@ RDEPENDS:${PN} += " \
     python3-pickle \
     python3-pkgutil \
     python3-pprint \
+    python3-resource \
     python3-shell \
     python3-sqlite3 \
     python3-unittest \
author
#1 lore raw

PATCH 2/10 python3-platformdirs: Fix ptest failures on musl

From: Khem Raj <[email protected]>

test_runtime_dir_unreachable_xdg_runtime_dir_warns hardcodes the glibc strerror(ELOOP) text "Too many levels of symbolic links", whereas musl reports "Symbolic link loop". Backport the upstream fix which uses os.strerror() instead.

---
 ...e-host-strerror-in-warning-tests-630.patch | 43 +++++++++++++++++++
 .../python/python3-platformdirs_4.13.5.bb     |  4 +-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-platformdirs/0001-test-unix-use-host-strerror-in-warning-tests-630.patch
meta-python/recipes-devtools/python/python3-platformdirs/0001-test-unix-use-host-strerror-in-warning-tests-630.patch new file +43 -0
new file mode 100644
index 0000000000..e702c7e842
@@ -0,0 +1,43 @@
+From c243545c7ee2561ed0b5475c1b43f626d1284111 Mon Sep 17 00:00:00 2001
+From: Yusuf Efe <[email protected]>
+Date: Wed, 28 Oct 2026 08:45:21 +0300
+Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(unix):=20use=20host=20strerror?=
+ =?UTF-8?q?=20in=20warning=20tests=20(#630)?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Bernát Gábor <[email protected]>
+
+Upstream-Status: Backport [https://github.com/tox-dev/platformdirs/commit/c243545c7ee2561ed0b5475c1b43f626d1284111]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tests/test_unix.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_unix.py b/tests/test_unix.py
+index e68f2b8..1afb622 100644
+--- a/tests/test_unix.py
++++ b/tests/test_unix.py
+@@ -1,6 +1,7 @@
+ from __future__ import annotations
+ 
+ import contextlib
++import errno
+ import importlib
+ import inspect
+ import os
+@@ -401,8 +402,8 @@ _PROBLEMS: typing.Final = {
+     "mode-500": "has mode 0500, not 0700",
+ }
+ _UNREACHABLE: typing.Final = {
+-    "file": "Not a directory",
+-    "symlink-loop": "Too many levels of symbolic links",
++    "file": os.strerror(errno.ENOTDIR),
++    "symlink-loop": os.strerror(errno.ELOOP),
+ }
+ _DEFAULT_PREFIXES: typing.Final = {
+     "linux": "run/user",
+-- 
+2.43.0
+
meta-python/recipes-devtools/python/python3-platformdirs_4.13.5.bb +3 -1
index 40c7b25333..a5bb41f283 100644
@@ -7,7 +7,9 @@ SRC_URI[sha256sum] = "05831adf87d392760f4b5c3a0a95579ab5a10b18b9b9bd43680dcb4754
 
 inherit pypi python_hatchling ptest-python-pytest
 
-SRC_URI += "file://run-ptest"
+SRC_URI += "file://run-ptest \
+            file://0001-test-unix-use-host-strerror-in-warning-tests-630.patch \
+            "
 
 DEPENDS += " \
     python3-hatch-vcs-native \
author
#2 lore raw

PATCH 3/10 python3-opentelemetry-api: Add missing runtime dependency

In reply to Khem Raj

From: Khem Raj <[email protected]>

opentelemetry-api requires typing-extensions.

---
 .../recipes-devtools/python/python3-opentelemetry-api_1.45.2.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-python/recipes-devtools/python/python3-opentelemetry-api_1.45.2.bb +2 -0
index 4d903d1373..50d0ce77a4 100644
@@ -7,3 +7,5 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 SRC_URI[sha256sum] = "d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4"
 
 inherit pypi python_hatchling
+
+RDEPENDS:${PN} += "python3-typing-extensions"
author
#3 lore raw

PATCH 4/10 python3-opentelemetry-semantic-conventions: Add missing runtime dependencies

In reply to Khem Raj

From: Khem Raj <[email protected]>

opentelemetry-semantic-conventions requires opentelemetry-api and typing-extensions.

---
 .../python3-opentelemetry-semantic-conventions_0.66b1.bb     | 5 +++++
 1 file changed, 5 insertions(+)
meta-python/recipes-devtools/python/python3-opentelemetry-semantic-conventions_0.66b1.bb +5 -0
index 8684b0e35d..44a333255a 100644
@@ -8,3 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 SRC_URI[sha256sum] = "497ca63bf383723411e8eaf60c8779e9877633c936bb641080adab59d0eb6ec8"
 
 inherit pypi python_hatchling
+
+RDEPENDS:${PN} += " \
+    python3-opentelemetry-api \
+    python3-typing-extensions \
+"
author
#4 lore raw

PATCH 5/10 python3-opentelemetry-sdk: Add missing runtime dependencies

In reply to Khem Raj

From: Khem Raj <[email protected]>

opentelemetry-sdk requires opentelemetry-api, opentelemetry-semantic-conventions and typing-extensions, without them importing opentelemetry.sdk fails with:

ModuleNotFoundError: No module named 'opentelemetry.semconv'

---
 .../python/python3-opentelemetry-sdk_1.45.2.bb              | 6 ++++++
 1 file changed, 6 insertions(+)
meta-python/recipes-devtools/python/python3-opentelemetry-sdk_1.45.2.bb +6 -0
index bba2b8bfe8..2cb352052d 100644
@@ -7,3 +7,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 SRC_URI[sha256sum] = "7eec4de13dd21ff3a1670dcb0e02079e692736f94d733dfdce5af461d884248d"
 
 inherit pypi python_hatchling
+
+RDEPENDS:${PN} += " \
+    python3-opentelemetry-api \
+    python3-opentelemetry-semantic-conventions \
+    python3-typing-extensions \
+"
author
#5 lore raw

PATCH 6/10 python3-fastapi: Upgrade 0.141.1 -> 0.162.0

In reply to Khem Raj

From: Khem Raj <[email protected]>

Release notes: https://github.com/fastapi/fastapi/releases

* opentelemetry-api is now a runtime dependency
* Add opentelemetry-sdk and git to ptest dependencies, used by the new telemetry and translation script tests
* Ignore telemetry tests that need logfire, the opentelemetry OTLP exporter and the opentelemetry fastapi instrumentation, which are not packaged in meta-python
* Fixes the ptest hang in test_frontend_dependency_restores_existing_dependency_stacks with starlette 1.10, fixed upstream in 0.142.0

---
 .../recipes-devtools/python/python3-fastapi/run-ptest  | 10 +++++++++-
 ...3-fastapi_0.141.1.bb => python3-fastapi_0.162.0.bb} |  5 ++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
 rename meta-python/recipes-devtools/python/{python3-fastapi_0.141.1.bb => python3-fastapi_0.162.0.bb} (89%)
meta-python/recipes-devtools/python/python3-fastapi/run-ptest +9 -1
index b4d99ee36b..4a8a5b7a87 100644
@@ -2,4 +2,12 @@
 
 # ignore the test from the tutorial
 # those depends on python packages that are not part of OE
-pytest --automake --ignore tests/test_tutorial
+# the ignored telemetry tests need logfire, the opentelemetry otlp exporter
+# and the opentelemetry fastapi instrumentation, which are not part of OE
+pytest --automake --ignore tests/test_tutorial \
+       --ignore tests/test_telemetry/test_background.py \
+       --ignore tests/test_telemetry/test_data.py \
+       --ignore tests/test_telemetry/test_environment_integrations.py \
+       --ignore tests/test_telemetry/test_integrations.py \
+       --ignore tests/test_telemetry/test_native_integrations.py \
+       --ignore tests/test_telemetry/test_runtime.py
meta-python/recipes-devtools/python/python3-fastapi_0.162.0.bb renamed from meta-python/recipes-devtools/python/python3-fastapi_0.141.1.bb +4 -1
similarity index 89%
rename from meta-python/recipes-devtools/python/python3-fastapi_0.141.1.bb
rename to meta-python/recipes-devtools/python/python3-fastapi_0.162.0.bb
index 38a691953c..4c5a5b5dc8 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "https://fastapi.tiangolo.com/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=95792ff3fe8e11aa49ceb247e66e4810"
 
-SRC_URI[sha256sum] = "e8822fc40db1e1858054d7a949a888695bc9bdce70139178e33bd2871a453ca1"
+SRC_URI[sha256sum] = "6a22c1e2e6e32e0633ee7e170f00009a29b8228b16feb219ee42f32fd8d88a8f"
 
 SRC_URI += "file://run-ptest"
 
@@ -22,14 +22,17 @@ RDEPENDS:${PN} += "\
     python3-annotated-doc \
     python3-fastapi-cli \
     python3-json \
+    python3-opentelemetry-api \
     python3-pydantic \
     python3-starlette \
     python3-typing-extensions \
 "
 
 RDEPENDS:${PN}-ptest += "\
+                        git \
                         python3-coverage \
                         python3-httpx \
+                        python3-opentelemetry-sdk \
                         python3-orjson \
                         python3-dirty-equals \
                         python3-pytest-httpx \
author
#6 lore raw

PATCH 7/10 kernel-selftest: Fix building the net selftests

In reply to Khem Raj

The net selftests generate their netlink code with tools/net/ynl, which needs the netlink specs from Documentation/netlink, python3 with pyyaml and jsonschema, and the top-level MAINTAINERS file: ynl_gen_c.py finds the kernel root by walking up until it sees MAINTAINERS and loops forever when it is not there. libbpf needs elfutils and zlib, reuseport_bpf_numa numactl and tcp_mmap openssl.

net/lib installs the whole ynl tree, so drop its build artifacts and bytecode, which trip the staticdev and buildpaths QA checks, and pass the prefix maps to clang so the BPF objects don't carry build paths either.

The python tests load the netlink specs at runtime, so add pyyaml there as well.

AI-Generated: Uses Claude Code

---
 .../kernel-selftest/kernel-selftest.bb         | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +16 -2
index 018ac74b85..4254eccfd6 100644
@@ -5,6 +5,9 @@ LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
 
 DEPENDS = "rsync-native llvm-native libcap"
+# net: libbpf (elfutils, zlib), YNL code generation (python3-pyyaml-native,
+# python3-jsonschema-native), reuseport_bpf_numa (numactl) and tcp_mmap (openssl)
+DEPENDS += "elfutils numactl openssl python3-jsonschema-native python3-pyyaml-native zlib"
 
 S = "${UNPACKDIR}"
 
@@ -49,7 +52,7 @@ PACKAGECONFIG[mm] = ",,libcap liburing numactl, libgcc bash"
 do_patch[depends] += "virtual/kernel:do_shared_workdir"
 do_compile[depends] += "virtual/kernel:do_install"
 
-inherit module-base kernel-arch ptest siteinfo
+inherit module-base kernel-arch ptest python3native siteinfo
 
 DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map"
 
@@ -123,7 +126,7 @@ EXTRA_OEMAKE = '\
     CC="${CC} ${DEBUG_PREFIX_MAP}" \
     AR="${AR}" \
     LD="${LD}" \
-    CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \
+    CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP} -ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}=/usr/src/kernel -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \
     DESTDIR="${D}" \
     V=1 \
 '
@@ -136,6 +139,8 @@ EXTRA_OEMAKE:append:toolchain-clang = "\
 CLEANBROKEN = "1"
 
 KERNEL_SELFTEST_SRC ?= "Makefile \
+                        Documentation/netlink \
+                        MAINTAINERS \
                         include \
                         kernel \
                         lib \
@@ -187,6 +192,13 @@ do_install() {
     if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then
         sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py
     fi
+    # net/lib installs the whole tools/net/ynl tree, including its build
+    # artifacts and the bytecode from running it at build time; only the
+    # python library is used at runtime.
+    if [ -d ${D}/usr/kernel-selftest/net/lib/ynl ]; then
+        find ${D}/usr/kernel-selftest/net/lib/ynl \( -name '*.a' -o -name '*.o' -o -name '*.d' \) -delete
+        find ${D}/usr/kernel-selftest/net/lib/ynl -name __pycache__ -type d -prune -exec rm -rf {} +
+    fi
     chown root:root  -R ${D}/usr/kernel-selftest
 }
 
@@ -227,6 +239,8 @@ FILES:${PN} += "/usr/kernel-selftest"
 # needs to enforce per-test timeouts; busybox has no timeout applet by default.
 # mount_setattr_test creates an ext4 image with mkfs.ext4.
 RDEPENDS:${PN} += "python3 perl perl-module-io-handle bash libcap libgcc coreutils e2fsprogs-mke2fs"
+# The net python tests load netlink specs with the YNL library.
+RDEPENDS:${PN} += "python3-pyyaml"
 
 INSANE_SKIP:${PN} += "libdir"
 
author
#7 lore raw

PATCH 8/10 kernel-selftest: Add the modules and tools the tests need

In reply to Khem Raj

Many selftests modprobe what they need (gpio-mockup, netdevsim, vrf, the tc qdiscs, classifiers and actions, ...), but the image only had a couple of kernel modules, so recommend all of them.

The net tests also need real iproute2, iputils ping and ping6, ethtool, iperf3, socat, jq, bc and taskset; busybox ip and ping lack most of the options they use, and busybox's ping6 has no -M, which pmtu.sh picks up over ping when it exists.

AI-Generated: Uses Claude Code

---
 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 8 ++++++++
 1 file changed, 8 insertions(+)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +8 -0
index 4254eccfd6..b1266fe553 100644
@@ -241,6 +241,14 @@ FILES:${PN} += "/usr/kernel-selftest"
 RDEPENDS:${PN} += "python3 perl perl-module-io-handle bash libcap libgcc coreutils e2fsprogs-mke2fs"
 # The net python tests load netlink specs with the YNL library.
 RDEPENDS:${PN} += "python3-pyyaml"
+# Tools the net selftests use; busybox ip and ping lack most of the options
+# they need.
+RDEPENDS:${PN}-ptest += "bc ethtool iperf3 iproute2 iproute2-bridge iproute2-nstat \
+                         iproute2-ss iproute2-tc iptables iputils-arping iputils-ping iputils-ping6 jq socat \
+                         util-linux-taskset"
+# Many selftests modprobe the modules they need (gpio-mockup, netdevsim, vrf,
+# the tc qdiscs, classifiers and actions, ...) and fail without them.
+RRECOMMENDS:${PN} += "kernel-modules"
 
 INSANE_SKIP:${PN} += "libdir"
 
author
#8 lore raw

PATCH 9/10 kernel-selftest: Fix tests that fail on qemu

In reply to Khem Raj

Add fixes for tests that fail on qemux86-64 because of bugs in the tests, and make tests that fail when an optional kernel feature or device is missing skip instead:

- core: unshare_test fails when fs.nr_open is at its maximum
- proc: proc-empty-vm treats pkey_alloc() ENOSPC as a failure, and read fails when a task exits while it walks /proc
- sched: cs_prctl_test is not installed from the output directory and fails without core scheduling
- gpio: gpio-mockup expects an empty range to be accepted, and gpio-cdev-uaf fails without CONFIG_GPIO_CDEV_V1
- splice: short_splice_read fails without test_module
- syscall_user_dispatch: sud_benchmark needs a frame pointer
- lsm: lsm_get_self_attr_test checks the wrong errno and lsm_list_modules_test fails without securityfs
- cgroup: test_cpu fails without CONFIG_CFS_BANDWIDTH
- binderfs: binderfs_stress fails without binderfs
- kvm: nx_huge_pages_test.sh fails without KVM
- watchdog: watchdog-test fails without a watchdog device
- net: udpgro_fwd.sh hangs the whole run without vxlan, and icmp.sh fails without tcpdump

AI-Generated: Uses Claude Code

---
 .../kernel-selftest/kernel-selftest.bb        |  18 +++
 ...-skip-the-cpu.max-tests-without-CONF.patch |  69 ++++++++++
 ...ix-unshare_test-with-large-fs.nr_ope.patch |  82 +++++++++++
 ...stems-binderfs-skip-binderfs_stress-.patch |  65 +++++++++
 ...xpect-gpio-mockup-to-reject-an-empty.patch |  52 +++++++
 ...kip-the-gpio-cdev-uaf-v1-tests-witho.patch | 127 ++++++++++++++++++
 ...ip-nx_huge_pages_test.sh-without-KVM.patch |  36 +++++
 ...eck-lsm_get_self_attr-errno-before-a.patch |  45 +++++++
 ...ip-correct_lsm_list_modules-without-.patch |  33 +++++
 ...ftests-net-icmp-skip-without-tcpdump.patch |  30 +++++
 ...pgro_fwd-don-t-hang-when-the-iperf3-.patch |  33 +++++
 ...pgro_fwd-skip-the-UDP-tunnel-tests-w.patch |  52 +++++++
 ...roc-empty-vm-treat-pkey_alloc-ENOSPC.patch |  35 +++++
 ...ead-tolerate-tasks-exiting-during-th.patch |  70 ++++++++++
 ...install-cs_prctl_test-from-the-outpu.patch |  34 +++++
 ...skip-cs_prctl_test-when-core-schedul.patch |  55 ++++++++
 ...-skip-the-kernfs-checks-without-test.patch |  45 +++++++
 ...l_user_dispatch-build-sud_benchmark-.patch |  35 +++++
 ...og-skip-when-there-is-no-watchdog-de.patch |  46 +++++++
 19 files changed, 962 insertions(+)
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-cgroup-skip-the-cpu.max-tests-without-CONF.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-core-fix-unshare_test-with-large-fs.nr_ope.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-filesystems-binderfs-skip-binderfs_stress-.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-expect-gpio-mockup-to-reject-an-empty.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-skip-the-gpio-cdev-uaf-v1-tests-witho.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-kvm-skip-nx_huge_pages_test.sh-without-KVM.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-check-lsm_get_self_attr-errno-before-a.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-skip-correct_lsm_list_modules-without-.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-icmp-skip-without-tcpdump.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-don-t-hang-when-the-iperf3-.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-skip-the-UDP-tunnel-tests-w.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-proc-empty-vm-treat-pkey_alloc-ENOSPC.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-read-tolerate-tasks-exiting-during-th.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-install-cs_prctl_test-from-the-outpu.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-skip-cs_prctl_test-when-core-schedul.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-splice-skip-the-kernfs-checks-without-test.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-syscall_user_dispatch-build-sud_benchmark-.patch
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-watchdog-skip-when-there-is-no-watchdog-de.patch
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +18 -0
index b1266fe553..96b837fb20 100644
@@ -26,6 +26,24 @@ SRC_URI += "file://run-ptest \
             file://0001-selftests-filelock-fix-the-test-plan-count-in-ofdloc.patch \
             file://0001-selftests-cgroup-memcontrol-keep-anon-page-touches-f.patch \
             file://0001-selftests-filesystems-idmapped_tmpfile-chown-the-lay.patch \
+            file://0001-selftests-core-fix-unshare_test-with-large-fs.nr_ope.patch \
+            file://0001-selftests-proc-proc-empty-vm-treat-pkey_alloc-ENOSPC.patch \
+            file://0001-selftests-proc-read-tolerate-tasks-exiting-during-th.patch \
+            file://0001-selftests-sched-install-cs_prctl_test-from-the-outpu.patch \
+            file://0001-selftests-sched-skip-cs_prctl_test-when-core-schedul.patch \
+            file://0001-selftests-gpio-expect-gpio-mockup-to-reject-an-empty.patch \
+            file://0001-selftests-gpio-skip-the-gpio-cdev-uaf-v1-tests-witho.patch \
+            file://0001-selftests-splice-skip-the-kernfs-checks-without-test.patch \
+            file://0001-selftests-syscall_user_dispatch-build-sud_benchmark-.patch \
+            file://0001-selftests-lsm-check-lsm_get_self_attr-errno-before-a.patch \
+            file://0001-selftests-lsm-skip-correct_lsm_list_modules-without-.patch \
+            file://0001-selftests-cgroup-skip-the-cpu.max-tests-without-CONF.patch \
+            file://0001-selftests-filesystems-binderfs-skip-binderfs_stress-.patch \
+            file://0001-selftests-kvm-skip-nx_huge_pages_test.sh-without-KVM.patch \
+            file://0001-selftests-watchdog-skip-when-there-is-no-watchdog-de.patch \
+            file://0001-selftests-net-udpgro_fwd-don-t-hang-when-the-iperf3-.patch \
+            file://0001-selftests-net-udpgro_fwd-skip-the-UDP-tunnel-tests-w.patch \
+            file://0001-selftests-net-icmp-skip-without-tcpdump.patch \
             ${@bb.utils.contains('PACKAGECONFIG', 'mm', '${MM_PATCH}', '', d)} \
             "
 
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-cgroup-skip-the-cpu.max-tests-without-CONF.patch new file +69 -0

69 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-core-fix-unshare_test-with-large-fs.nr_ope.patch new file +82 -0

82 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-filesystems-binderfs-skip-binderfs_stress-.patch new file +65 -0

65 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-expect-gpio-mockup-to-reject-an-empty.patch new file +52 -0

52 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-skip-the-gpio-cdev-uaf-v1-tests-witho.patch new file +127 -0

127 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-kvm-skip-nx_huge_pages_test.sh-without-KVM.patch new file +36 -0
new file mode 100644
index 0000000000..b67d03f06c
@@ -0,0 +1,36 @@
+From f5789245c843627b4982f3ded204186b4914dedb Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 15:03:17 -0700
+Subject: [PATCH] selftests/kvm: skip nx_huge_pages_test.sh without KVM
+
+The script reads the kvm module parameters with "set -e" in effect, so on
+a kernel without KVM it exits with an error instead of skipping:
+
+  cat: /sys/module/kvm/parameters/nx_huge_pages: No such file or directory
+  not ok 1 selftests: kvm: nx_huge_pages_test.sh # exit=1
+
+The other KVM tests skip when /dev/kvm is missing. Skip this one as well
+when the nx_huge_pages parameter does not exist.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/kvm/x86/nx_huge_pages_test.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/tools/testing/selftests/kvm/x86/nx_huge_pages_test.sh b/tools/testing/selftests/kvm/x86/nx_huge_pages_test.sh
+index caad084b8bfd..0bacd025b601 100755
+--- a/tools/testing/selftests/kvm/x86/nx_huge_pages_test.sh
++++ b/tools/testing/selftests/kvm/x86/nx_huge_pages_test.sh
+@@ -8,6 +8,11 @@
+
+ set -e
+
++if [ ! -f /sys/module/kvm/parameters/nx_huge_pages ]; then
++	echo "KVM is not available"
++	exit 4 # KSFT_SKIP=4
++fi
++
+ NX_HUGE_PAGES=$(cat /sys/module/kvm/parameters/nx_huge_pages)
+ NX_HUGE_PAGES_RECOVERY_RATIO=$(cat /sys/module/kvm/parameters/nx_huge_pages_recovery_ratio)
+ NX_HUGE_PAGES_RECOVERY_PERIOD=$(cat /sys/module/kvm/parameters/nx_huge_pages_recovery_period_ms)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-check-lsm_get_self_attr-errno-before-a.patch new file +45 -0

45 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-skip-correct_lsm_list_modules-without-.patch new file +33 -0
new file mode 100644
index 0000000000..a6eeb5dbf5
@@ -0,0 +1,33 @@
+From aec608f3643722f98098618f72fcc3c75a14c407 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 15:01:22 -0700
+Subject: [PATCH] selftests/lsm: skip correct_lsm_list_modules without
+ securityfs
+
+correct_lsm_list_modules compares the lsm_list_modules() result with
+/sys/kernel/security/lsm. When the kernel is built without
+CONFIG_SECURITYFS that file does not exist and the test fails:
+
+  lsm_list_modules_test.c:85:correct_lsm_list_modules:Expected 0 (0) == read_sysfs_lsms(sysfs_lsms, page_size) (-1)
+
+Skip the test in that case.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/testing/selftests/lsm/lsm_list_modules_test.c b/tools/testing/selftests/lsm/lsm_list_modules_test.c
+index 54d59044ace1..f5108c0eb99e 100644
+--- a/tools/testing/selftests/lsm/lsm_list_modules_test.c
++++ b/tools/testing/selftests/lsm/lsm_list_modules_test.c
+@@ -82,6 +82,8 @@ TEST(correct_lsm_list_modules)
+
+ 	ASSERT_NE(NULL, sysfs_lsms);
+ 	ASSERT_NE(NULL, syscall_lsms);
++	if (access("/sys/kernel/security/lsm", R_OK))
++		SKIP(return, "/sys/kernel/security/lsm is not available");
+ 	ASSERT_EQ(0, read_sysfs_lsms(sysfs_lsms, page_size));
+
+ 	count = lsm_list_modules(syscall_lsms, &size, 0);
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-icmp-skip-without-tcpdump.patch new file +30 -0
new file mode 100644
index 0000000000..ea03ad4f65
@@ -0,0 +1,30 @@
+From bd02c9f9ff8b78eada28d6d6c8a23b0d044d10ba Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 17:19:28 -0700
+Subject: [PATCH] selftests: net: icmp: skip without tcpdump
+
+icmp.sh captures the ICMP reply with tcpdump. Without it the capture
+file stays empty and the test fails with "got ICMP response from ,
+should be 192.0.0.8".
+
+Skip the test when tcpdump is not installed.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/net/icmp.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/testing/selftests/net/icmp.sh b/tools/testing/selftests/net/icmp.sh
+index 0714e8b34d12..eff9da3238b4 100755
+--- a/tools/testing/selftests/net/icmp.sh
++++ b/tools/testing/selftests/net/icmp.sh
+@@ -20,6 +20,8 @@
+
+ source lib.sh
+
++require_command tcpdump
++
+ H1_IP=172.16.0.1/32
+ H1_IP6=2001:db8:1::1
+ RT1=172.16.1.0/24
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-don-t-hang-when-the-iperf3-.patch new file +33 -0
new file mode 100644
index 0000000000..a02319ff90
@@ -0,0 +1,33 @@
+From c0649196a87bf5d80336ba9ff703f06c8e50d954 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 16:51:47 -0700
+Subject: [PATCH] selftests: net: udpgro_fwd: don't hang when the iperf3
+ client fails
+
+run_test_csum() starts a one-shot iperf3 server and waits for it after
+running the client. If the client can't connect, e.g. because the vxlan
+devices could not be created, the server never gets a client and the
+test blocks in wait until the kselftest timeout kills it.
+
+Kill the server when the client fails, so the test reports the failure
+and moves on.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/net/udpgro_fwd.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/testing/selftests/net/udpgro_fwd.sh b/tools/testing/selftests/net/udpgro_fwd.sh
+index 9b722c1e4b0f..854b65c752e9 100755
+--- a/tools/testing/selftests/net/udpgro_fwd.sh
++++ b/tools/testing/selftests/net/udpgro_fwd.sh
+@@ -177,6 +177,8 @@ run_test_csum() {
+ 	local spid="$!"
+ 	ip netns exec "$NS_SRC" iperf3 -c "$dst" -t 2 >/dev/null
+ 	local retc="$?"
++	# the server only exits after serving a client
++	[ "$retc" -ne 0 ] && kill "$spid" 2>/dev/null
+ 	wait "$spid"
+ 	local rets="$?"
+ 	if [ "$rets" -ne 0 ] || [ "$retc" -ne 0 ]; then
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-skip-the-UDP-tunnel-tests-w.patch new file +52 -0

52 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-proc-empty-vm-treat-pkey_alloc-ENOSPC.patch new file +35 -0
new file mode 100644
index 0000000000..e1f1484ef1
@@ -0,0 +1,35 @@
+From d41aa0d89994e56d629a4f22526c3310e0b1a6ae Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 14:51:52 -0700
+Subject: [PATCH] selftests/proc: proc-empty-vm: treat pkey_alloc()
+ ENOSPC as no pkey support
+
+On x86, mm_pkey_alloc() returns -1 when OSPKE is not enabled, which
+pkey_alloc() reports as ENOSPC. This happens on any CPU without PKU, for
+example QEMU's Skylake-Client model, and with nopku, and the test then
+bails out before checking anything:
+
+  protection_key_support: error: rv -1, errno 28
+
+Treat ENOSPC the same as the other "not supported" errors.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/proc/proc-empty-vm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/testing/selftests/proc/proc-empty-vm.c b/tools/testing/selftests/proc/proc-empty-vm.c
+index b3f898aab4ab..cc619539e336 100644
+--- a/tools/testing/selftests/proc/proc-empty-vm.c
++++ b/tools/testing/selftests/proc/proc-empty-vm.c
+@@ -77,6 +77,9 @@ static int protection_key_support(void)
+ 	} else if (rv == -1 && errno == EINVAL) {
+ 		// ospke=n
+ 		return 0;
++	} else if (rv == -1 && errno == ENOSPC) {
++		// ospke=n on x86 since mm_pkey_alloc() checks arch_pkeys_enabled()
++		return 0;
+ 	} else {
+ 		fprintf(stderr, "%s: error: rv %ld, errno %d\n", __func__, rv, errno);
+ 		exit(EXIT_FAILURE);
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-read-tolerate-tasks-exiting-during-th.patch new file +70 -0

70 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-install-cs_prctl_test-from-the-outpu.patch new file +34 -0
new file mode 100644
index 0000000000..532f99f3bf
@@ -0,0 +1,34 @@
+From a24b4ff5908c55fa77e1c63192769d8b0449c82d Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 14:56:28 -0700
+Subject: [PATCH] selftests/sched: install cs_prctl_test from the output
+ directory
+
+cs_prctl_test is built, so it belongs in TEST_GEN_PROGS. Listing it in
+TEST_PROGS makes "make install" copy it from the source directory, which
+only works for in-tree builds. With O= the binary is in the output
+directory and nothing gets installed:
+
+  rsync: [sender] link_stat ".../selftests/sched/cs_prctl_test" failed: No such file or directory (2)
+
+and run_kselftest.sh then reports "file cs_prctl_test is missing".
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/sched/Makefile | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/tools/testing/selftests/sched/Makefile b/tools/testing/selftests/sched/Makefile
+index 099ee9213557..f5228cfd3eb6 100644
+--- a/tools/testing/selftests/sched/Makefile
++++ b/tools/testing/selftests/sched/Makefile
+@@ -8,7 +8,6 @@ CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -Wl,-rpath=./ \
+ 	  $(CLANG_FLAGS)
+ LDLIBS += -lpthread
+
+-TEST_GEN_FILES := cs_prctl_test
+-TEST_PROGS := cs_prctl_test
++TEST_GEN_PROGS := cs_prctl_test
+
+ include ../lib.mk
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-skip-cs_prctl_test-when-core-schedul.patch new file +55 -0

55 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-splice-skip-the-kernfs-checks-without-test.patch new file +45 -0

45 lines not on this page · raw message

meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-syscall_user_dispatch-build-sud_benchmark-.patch new file +35 -0
new file mode 100644
index 0000000000..100f0aca57
@@ -0,0 +1,35 @@
+From 5bd11503bf3a582f3be9eef427b2d3384ff03ba2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Oct 2026 14:59:30 -0700
+Subject: [PATCH] selftests/syscall_user_dispatch: build sud_benchmark
+ with a frame pointer
+
+On x86-64, handle_sigsys() returns from the SIGSYS handler by hand: it
+runs "leaveq; add $0x8, %rsp" and then issues rt_sigreturn from inside
+the dispatcher region. That relies on the handler having a frame pointer,
+which is only the case when the test is built without optimization. With
+CFLAGS="-O2" the frame pointer is omitted, rt_sigreturn finds a bogus
+frame and the test crashes:
+
+  sud_benchmark[3299] bad frame in rt_sigreturn frame:... sp:1 ...
+
+Always build sud_benchmark with -fno-omit-frame-pointer.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/testing/selftests/syscall_user_dispatch/Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tools/testing/selftests/syscall_user_dispatch/Makefile b/tools/testing/selftests/syscall_user_dispatch/Makefile
+index 03c120270953..1f60b49c2d45 100644
+--- a/tools/testing/selftests/syscall_user_dispatch/Makefile
++++ b/tools/testing/selftests/syscall_user_dispatch/Makefile
+@@ -7,3 +7,7 @@ CFLAGS += -Wall -I$(LINUX_HDR_PATH)
+
+ TEST_GEN_PROGS := sud_test sud_benchmark
+ include ../lib.mk
++
++# handle_sigsys() unwinds its own stack frame with inline assembly to return
++# through rt_sigreturn, which only works if it has a frame pointer.
++$(OUTPUT)/sud_benchmark: CFLAGS += -fno-omit-frame-pointer
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-watchdog-skip-when-there-is-no-watchdog-de.patch new file +46 -0

46 lines not on this page · raw message

author
#9 lore raw

PATCH 10/10 kernel-selftest: Skip tests the running kernel can't support

In reply to Khem Raj

Many tests, most of them in net, fail rather than skip when the kernel lacks a feature they need (vxlan, geneve, macvlan, vrf, netdevsim, TLS, tc actions and qdiscs, audit for the landlock tests, ...). Skip them based on the running kernel's config, so the results show regressions instead of the kernel configuration.

Also skip the udpgro tests when iptables can't set up NAT (legacy iptables on a kernel with only nftables), tc-testing when scapy is not installed, landlock's fs_bench, which only reports timings and needs twice the default timeout in qemu, mseal's sysmap_is_sealed when the kernel doesn't seal the system mappings, and the ptrace vmaccess and tty_tiocsti tests, which check for kernel changes that are not in mainline.

AI-Generated: Uses Claude Code

---
 .../kernel-selftest/kernel-selftest/run-ptest | 93 ++++++++++++++++++-
 1 file changed, 92 insertions(+), 1 deletion(-)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest +92 -1
index e8a136dce8..85fa63b5e4 100755
@@ -8,10 +8,101 @@
 # runner blocked (and silent) until they finish, so ptest-runner kills the
 # whole suite. Skip it.
 #
+# ptrace:vmaccess and tty:tty_tiocsti_test check for kernel changes that are
+# not in mainline: PTRACE_ATTACH failing with EAGAIN during a multi-threaded
+# exec instead of blocking (the attach test always times out), and TIOCSTI
+# checking the credentials of the file opener rather than the caller. Skip
+# them.
+#
+# landlock:fs_bench only reports timings, and walking its 10000 nested
+# directories takes about 90 seconds in qemu, twice the default timeout.
+SKIP="-S ftrace:ftracetest-ktap -S filesystems:file_stressor \
+      -S ptrace:vmaccess -S tty:tty_tiocsti_test -S landlock:fs_bench"
+
+# sysmap_is_sealed can't tell at runtime whether the kernel seals the system
+# mappings, so skip it when the running kernel's config says it doesn't.
+if [ -r /proc/config.gz ] && \
+   zcat /proc/config.gz | grep -q '^# CONFIG_MSEAL_SYSTEM_MAPPINGS is not set'; then
+    SKIP="$SKIP -S mseal_system_mappings:sysmap_is_sealed"
+fi
+
+# Tests that fail, rather than skip, when the kernel lacks a feature they
+# need (the options are in each collection's "config" file). Skip a test when
+# the running kernel has any of its options neither built in nor as a module.
+NEEDS_CONFIG="
+landlock:audit_test AUDIT
+landlock:fs_test AUDIT
+landlock:net_test AUDIT
+landlock:ptrace_test AUDIT
+landlock:scoped_abstract_unix_test AUDIT
+net:bridge_vlan_dump.sh BRIDGE_VLAN_FILTERING
+net:busy_poll_test.sh NETDEVSIM
+net:cmsg_so_mark.sh IPV6_MULTIPLE_TABLES
+net:cmsg_so_priority.sh NET_ACT_GACT
+net:cmsg_time.sh NET_SCH_ETF
+net:ecmp_rehash.sh NET_ACT_GACT
+net:fdb_notify.sh MACVLAN VXLAN
+net:fib_nexthops.sh VXLAN
+net:fib_rule_tests.sh IPV6_MULTIPLE_TABLES NET_VRF
+net:fq_band_pktlimit.sh NET_SCH_FQ
+net:gre_gso.sh IPV6_GRE
+net:gre_ipv6_lladdr.sh IPV6_MULTIPLE_TABLES
+net:icmp_redirect.sh NET_VRF
+net:ip_local_port_range.sh MPTCP
+net:ipvtap_test.sh IPVTAP
+net:l2tp.sh L2TP_V3 L2TP_ETH L2TP_IP
+net:link_netns.py IPVLAN IPV6_GRE MACSEC MACVLAN MACVTAP NETKIT
+net:netdev-l2addr.sh NETDEVSIM
+net:netns-name.sh NETDEVSIM
+net:nk_qlease.py NETDEVSIM NETKIT
+net:nl_netdev.py NETDEVSIM
+net:protodown.sh MACVLAN VXLAN
+net:rtnetlink.sh IPV6_GRE MACSEC MACVLAN NET_VRF VXLAN
+net:srv6_end_dx4_netfilter_test.sh LWTUNNEL
+net:srv6_end_dx6_netfilter_test.sh LWTUNNEL
+net:tap MACVTAP
+net:test_bpf.sh TEST_BPF
+net:test_neigh.sh NET_ACT_GACT NET_CLS_MATCHALL
+net:test_vxlan_fdb_changelink.sh VXLAN
+net:test_vxlan_vnifilter_notify.sh VXLAN
+net:test_vxlan_vnifiltering.sh VXLAN
+net:tfo_passive.sh NETDEVSIM
+net:tls TLS
+net:tun GENEVE
+net:txtimestamp.sh IFB
+net:udpgro_frglist.sh NET_CLS_BPF
+net:vlan_bridge_binding.sh BRIDGE_VLAN_FILTERING
+net:vrf-xfrm-tests.sh NET_VRF XFRM_INTERFACE
+net:vrf_route_leaking.sh NET_VRF
+"
+if [ -r /proc/config.gz ]; then
+    KCONFIG=$(zcat /proc/config.gz)
+    SKIP="$SKIP $(echo "$NEEDS_CONFIG" | while read -r test options; do
+        for option in $options; do
+            if ! echo "$KCONFIG" | grep -q "^CONFIG_$option=[ym]"; then
+                echo "-S $test"
+                break
+            fi
+        done
+    done)"
+fi
+
+# udpgro.sh and udpgro_fwd.sh set up NAT with iptables, which fails when it
+# uses the legacy backend and the kernel only has nftables.
+if ! iptables -t nat -n -L >/dev/null 2>&1; then
+    SKIP="$SKIP -S net:udpgro.sh -S net:udpgro_fwd.sh"
+fi
+
+# tc-testing's tdc.py needs scapy (in meta-networking) and exits at once
+# without it.
+if ! python3 -c 'import scapy' >/dev/null 2>&1; then
+    SKIP="$SKIP -S tc-testing:tdc.sh"
+fi
+
 # Turn the runner's per-test TAP lines ("ok 3 selftests: cgroup: test_core",
 # "not ok 4 ... # exit=1", "ok 5 ... # SKIP") into PASS:/FAIL:/SKIP: lines
 # that ptest log parsers understand, keeping the original output too.
-/usr/kernel-selftest/run_kselftest.sh -s -S ftrace:ftracetest-ktap -S filesystems:file_stressor 2>&1 | awk '
+/usr/kernel-selftest/run_kselftest.sh -s $SKIP 2>&1 | awk '
 { print; fflush() }
 /^(not )?ok [0-9]+ selftests: / {
     res = "PASS"