From patchwork Mon Nov 16 22:00:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 104547 Received: from mail-dy1-f169.google.com (mail-dy1-f169.google.com [74.125.82.169]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4738.1794866444109300867 for ; Mon, 16 Nov 2026 14:00:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=kh3DAQJa; spf=pass (domain: gmail.com, ip: 74.125.82.169, mailfrom: raj.khem@gmail.com) Received: by mail-dy1-f169.google.com with SMTP id 5a478bee46e88-3712b6d9843so3301054eec.1 for ; Mon, 16 Nov 2026 14:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794866443; x=1795471243; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=cl0/7NKM2iuvsOU1E/MlrpphgUyCSu7wkOPFnU3gaIA=; b=kh3DAQJa0bs8+r6vdJ3AWRR1hBqAXfd5Li4299QLXHUTgGa0QrpGn0jSQg7fPuuqx6 juYZkhJl3zUa4HFNiAvH/hRsPRNN7DY48JnjFwVV93bwVZDIRbTWPs7g0FBSZYTSJ7ZY e1mi4SLsAqTh/WyIy5YTN28KUvab97bI2A4xuRlwXSqTSASgUadCctuNUh6l0oaPuDa5 Iz5znzGK2ROqYGzT+LDJeYd4RV/UmKb8m7UPodwmAIpv/fDbTnRHfTF6sLuNqMojOmmj eEXjMKcCQ2QLw3mQAHsZD9tGR3sOW6/xt0ae6v4T+IV7msAeodiLIk3qe3lVce1zixsm 5kKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794866443; x=1795471243; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cl0/7NKM2iuvsOU1E/MlrpphgUyCSu7wkOPFnU3gaIA=; b=20cPXRsgoPRIw1zt1hMbatNZXlPIKnIsUrjChRwgvQBifF8fAFKeKn0wPfJF/GvMIv +jrjjMIDuQBn0hZ2rPV5N3CiQCbKoJHiQDgxwfXppcA14/SeDd39F+5dO+Kg6tMdMA3s kdWRz5yA+eg8SeP+ZRUJmu2oCAqrjDfq9oe0JsHdowrU3+FLoo5l/S3PWNq89qtW6lZG RVGXswKu3QhfeN4i852XHnpjC7UA9BhyXIDgmVSx24mCt3QaygDE1OCA3HYUc/2YmZj2 lirtWbxLXBQAb1Gu161zjvi8Qgpp/rBv5VBOfJb1XCK7sypwzUOa8qZ0MWN3WKo4GFW5 2mkw== X-Gm-Message-State: APuU4Z/U7TotvQ5ingM7OrKCzHmRsOIfLT6HToh+tbyXOCQc94YdHHaB 02wdeu5q2h1UtZhNSPUPMByfUL7SvubVY4tb5GS7W2dvdFQqKZC+ygpAsnjYO+B8 X-Gm-Gg: AZFdTZfrvjBcd0ALMShTiuTBiGpRhZkNzp3ZAIGxF+7ovaOGqmEvz0eXIbe5OD3Gev4 /s+++X2nKXhfI4Z65bMLfvze5RXtJF2WprIjAMPj5EDpQ7r5CKP0aUrPhvRcy1henSJhUyPNMWb KmeIBvHJZja9NkY2rP/9DcqzgwnDzvF6e5WPg3p2oPv/9Az/sy46iCosDmiK24H87w4gUXpE9yi Pj9ofubeUADIpv1j2S4Jo5gALZ2tsmBa2JLhjLBBoInaLEbMaCKY4Tz7gAsRdroAYGDu5NrEn2G 1gk42lCOzehXeF97oOz8mKbB9lU518J57/rfSo+Cs2dyyUlo+Hj9LtRisEpWcpJ8yXn1kyi9oFu QD7wRZL6ONhmLMlCwqasoExzfr+ka3gBp3rdH9FkOyeKTSYs+B1aP3vqJu1qCcCN2Un54+N6kQT nakTJHyxSWWORfO/3MQgQZRNTFDAnP6BHZytRz7g4K1KJYZ9IikEvP40m8tKc6RUk7lEmkHYpvy kHSH9pVIIWdU3UXd4Gv8mygMzSSSieyKh1/TCDU8HHXJZYOBMzWpCCLwv+zkvNPXSOf8uza46SS Cp1ronff95+OakuOD0zAgYEHlY5ZFgFhBH4zijrybPOBfAKxhEjIngkQ5xTt6A2HSogYQSdia8v qrTZTrgK9hBJdVkNNPFYz9k793o7Yo1Q5j7nAch7yfEw/G9DmD4Mjya6KqYNapJ1fjQgWKRbhID bkUeag7n0RPDIidXa7+CsI8413ZsCbaopCeAlbzxc445BCOtJynVJW4FynyZWDc4DKiKwhAY6DX E6UVOnYuKxvWblLv6VulHNYlaDeTMX4zg2Ujpd80fQtktiEdqZ1C/elVJOuh3ISk+PalK5d2/tN W/NC X-Received: by 2002:a05:693c:638d:20b0:375:c862:31c with SMTP id 5a478bee46e88-379684b8190mr11766188eec.40.1794866443040; Mon, 16 Nov 2026 14:00:43 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38115cfdd6esm1221905eec.5.2026.11.16.14.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 14:00:42 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 1/5] kernel-selftest: Report per-test results in ptest Date: Mon, 16 Nov 2026 14:00:35 -0800 Message-ID: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 22:00:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/132565 run-ptest printed "PASS: kernel-selftest" or "[FAIL]: kernel-selftest". The latter does not match the FAIL: pattern of the ptest log parser, so whenever any selftest failed testimage reported no results at all: ptests which had no test results: ['kernel-selftest'] Convert the per-test TAP lines from run_kselftest.sh into PASS:, FAIL: and SKIP: lines, so results are recorded and failing selftests are listed by name. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- .../kernel-selftest/kernel-selftest/run-ptest | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest index 4e170fc2d0..e8a136dce8 100755 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest @@ -7,9 +7,22 @@ # move to their own process group, escape the per-test timeout and keep the # runner blocked (and silent) until they finish, so ptest-runner kills the # whole suite. Skip it. -/usr/kernel-selftest/run_kselftest.sh -s -S ftrace:ftracetest-ktap -S filesystems:file_stressor -if [ $? == 0 ]; then - echo "PASS: kernel-selftest" -else - echo "[FAIL]: kernel-selftest" -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 ' +{ print; fflush() } +/^(not )?ok [0-9]+ selftests: / { + res = "PASS" + if ($0 ~ /^not ok/) + res = "FAIL" + else if ($0 ~ /# SKIP/) + res = "SKIP" + name = $0 + sub(/^(not )?ok [0-9]+ selftests: /, "", name) + sub(/ *#.*$/, "", name) + sub(/: /, ":", name) + print res ": " name + fflush() +}' From patchwork Mon Nov 16 22:00:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 104548 Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4799.1794866445129174533 for ; Mon, 16 Nov 2026 14:00:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=jN7cJu8g; spf=pass (domain: gmail.com, ip: 74.125.82.173, mailfrom: raj.khem@gmail.com) Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-38133db970bso310129eec.0 for ; Mon, 16 Nov 2026 14:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794866444; x=1795471244; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=A4WigBY1mSvw4gX6H1U9nT2An8VzMzyiA5wl+l+X4HU=; b=jN7cJu8gY0kKiySaUwJjGfE75fm3zqzkZ6hvSt8iU8+b27UqBW96rJmHF+MnqkrXw9 RY0wkd7Q9N27HJXXufW7HvGX9Iv5jFowalXpT9X7obtQuklYb6gpjBxdrD5my89OzH7z SwoCV0aGvQerzsSt4cUGsVTToRWODxlsasImnS+nuHkbljyMDalxTKZyY+v1Gb7J5ol+ mE0SEfbETy1i23y8yLrbHy1Xky2gULjwWuNiHEbFGiHlX9O3iobJmoTllIP9gh7+slNO cKk9p/0EY6DeGKDBJDu601MxMYUY+8n5XsGu3emgh51KaA5rYnEQLudPhN5gAhPBZHbe BKIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794866444; x=1795471244; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=A4WigBY1mSvw4gX6H1U9nT2An8VzMzyiA5wl+l+X4HU=; b=2mWQHk7f4y4uWAousG1MsewcKccRm65PZJDfZNzbfpvBf8qyCXNmU4FnnB6VC61hp9 BOWTXzABD/s6qB69DPy9Lh4ljJNoh+zIPu3br05zXBx/pZOJnXyj1FZC0xMNUc4aYF0J 0uDN3TPPgzhk4aJOT4p9i19ULfIVH6lWoVxdbnVyp64uee/XPSA0/5CCODMmkIPq+s8r zJQY3kTnSYSLYhIFuNSgdxBIqEhVc/7M1r72ZL9DuvLLDL9wcejYtf211EnADJ5yL5Ut fscZ+PEEcAT730TYbZ07JR45BGB2sDxwK1xQaLu94CKpLZ/c1M4At2qom86WhXTpUH7t U1vQ== X-Gm-Message-State: APuU4Z8VU2FCjF7WtlKqADjRNMUWPQDEzzN3vLxAYgNR9Pf7PvnKGvTR K6S3HfQjJXSK+1i2z0akouWMeHIQUD+/UvkGUdE1gW99g9/haqpU/VsOmJEXoRJo X-Gm-Gg: AZFdTZeZNkHbxhdgDa4YtRlBbEG8vZVo+ieaSumGciqAkvuAWAjZ5IvdhraNBNYIIsu +7iKky8Ui499aomF9MlO1Bz52gZKxSFslpdLyDEnbdH5CzOnrPjh9f/9qcJvAKxJmPod7TT5kUW mVisOEd45oLhlmFMZNnRCoh/qPV8WnK92xy2veyYJK7w8FRp1VcRZ2mzN7T8vKqmDjJZrUq40GK Cq5KVOeDLJNo7E1zSDCISZWWercO2U8qE5/pSJD+NIwi43mifu0/EE4mKG9AaImU6/uYqvkJNfW ZzGtlljKhHfWkQB7aG0DZRaO5BfsRCjjgQuB2eF2Sk/ZFelqwkPyaV74JGWy0Xwc7iizbNIvtac orN9tqkwf7tUkeIgeMGH1LNX9bG8LPHwZDwn5P0ICzSq4we1gQtfj8IvWfpMItkMo9peXiSDacB 0OyJXN5nbTQxXYaQD1kW1aYTlVjTyyz51XXcfJ43y8CE4A36BGr0NZzicthJf7q7wr6BY9AQIzF PrN3hkWyh3spG2lr+nrOZilw6VnZbRd8l+zV14UhjGiP5CXkTiWeM/B5B7SStH7AKeBq/r8WrUa Yj/xMrr4izRwjs5jvwLAhGFUw00gmoR72as8lpiUSalCbu7xkGzaumBf6qtdK1TeqBKtvdWgZ+5 m3aNlcynk9OpLcVjYa0+OVWTuhykGUpOiYpCiSdNJEt6sLeiElXH2rW6OCX8o+ewrmbxqfujPR7 J6B/ME8+0UG/hJCW7LlBUyU/EzmRtbohvO65dJw49yTCVy17Mc+pA0HxX4iZcidWrUDntj7fkER 9XvdOZ9us29Nbh2K4e/XocdXF/Bj4brec2EadqijO5UD6WfI62G/JqIi1qQNeq9ipNVL6zU1vdi ZiI2 X-Received: by 2002:a05:693c:83cf:10b0:36a:79e7:2fd with SMTP id 5a478bee46e88-379684b838cmr12940594eec.40.1794866444106; Mon, 16 Nov 2026 14:00:44 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38115cfdd6esm1221905eec.5.2026.11.16.14.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 14:00:43 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 2/5] kernel-selftest: Fix building the net selftests Date: Mon, 16 Nov 2026 14:00:36 -0800 Message-ID: <20261116220039.1807391-2-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> References: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 22:00:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/132566 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 Signed-off-by: Khem Raj --- .../kernel-selftest/kernel-selftest.bb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 018ac74b85..4254eccfd6 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb @@ -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" From patchwork Mon Nov 16 22:00:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 104549 Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4801.1794866446108098003 for ; Mon, 16 Nov 2026 14:00:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=EixB9xnl; spf=pass (domain: gmail.com, ip: 74.125.82.44, mailfrom: raj.khem@gmail.com) Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-1ae58d17cd9so3149557c88.1 for ; Mon, 16 Nov 2026 14:00:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794866445; x=1795471245; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2KcAEJ/d//yNkNn25R3m5JPPTPab3qI1ELoNHffGJTw=; b=EixB9xnlut/UMUAXX901/1UF07/HYAWrbdT64UMLDwTy1dRJUgoWNL11wpsfFrxXXT mvqQvrf1CPc5CnlewdI8lKpvoC61dSe5kyawXFANRj9RXAglvdygibayGDgA6RGyOOuM ZJx2VfrV/pA12Y4WxrJiGVrCKzXYkpoqrfDCQBqwM4g6Wq6rw/Ciaad/5RUw1ycn4vhr vKWBCBkmQp8uYKK1BdLOlFWEWB+fBSv7m2w3zuAh36rxz7bsuCy8cQAmEO5CA6KYbuKP 2wr6dR7dMpNMbVt3djZiQKWXbL9v3SqwM5mif0K+6zMXzlqRc//w4TMkWZe/f3tTo15F y69w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794866445; x=1795471245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=2KcAEJ/d//yNkNn25R3m5JPPTPab3qI1ELoNHffGJTw=; b=Y5x4MNqr3DzZXkhX80uFZe5TgRfGhSSRNQpCmjLZJPuCAo9F8i7TjqrZo2u/Ft+IX2 S+1FYwiVU7kzCfiHkoE1zOLFRSfrVPiJoCdelJ3oO5WIybUmMYvnS5izLcj18KCrPZTn 0ucAmBGcuLep51nggBWU7Hz8ODJx0oJtzhoTLq4+rL1SaWu1J9nSqhYneOR1JnNegLDC B301PVP/WR2hWW0YeswkiB+QcE1b0nV0Qz7GtDmS30zjuRlJ7uXYTclibtcmW1b2AUv9 hNC9jFB0B3S8/92KTj61JuK90EA2DRIaK0iEWIOiJuuocR9TBRMTcFKJUMh3Pvj6PSBx xZjw== X-Gm-Message-State: APuU4Z/tdFyEqQgAiWMmEZyJgMth01j82Hxs97UrcUTwkdi4oB4/8r6w loKvaxgxnkYH6Z5tNs6SRD1vRyNvg5K+B7u1MNvROWiFBKLclkRMDAAwk+aQGhUV X-Gm-Gg: AYBFou0a0we1ddKTZ9mfpexUNJmsqbHFOBStaLhr+4nZoADLE8RieGJEDCPUJ0y/Wjo OWtxlPvzezMQqF1JIJOy+leeVoJIoE4Uxc1LEVC+rG2We9tCFjtteP5sAIjsYli/toEFwDgUuFk r8yK1vkaB9gI0IBEXVCv64/VpE5ImKfYUCpe3xq1ZZ8v+uy9WOFjMehdzoAJAZO3nWWUrzXZC1N Er389a9HBNa9zHgxNymOqsvAY5NOwZz3/nfXOiZr4hFCRLHROZzEnz90h4NtKSLPTkdSNoUAayA WnQquFQQhwAF1ajMvlwje1x9GShHV7OeTzVBR7aLCb343+L2SLLymgDqMArvYTREzQGw8Swv6+2 B8RGdxRBQpMpnNKV9iEaCZaLkHd8WZgW7ameK4gsveAx2+D42ZlxA6q5x7+uwkHg5d7yCyjcK/r ijkdFU202JlKNQfTmxsPET/PKTqozW0qn3eezMK0nsqraS9RViUm5whlUAAaNjGtumg9FjHp1/8 g+Bv0gxAa9Maj7D/fgcWrq+Hr27QNje7Y2CpTHN3R15PGUO3hViao/vBjygFkdCz8IKw0Q2xUUU vrelhuWh3BtotxgyKdto7aCwd82ELLnQ0VvBJ3b6UT2lJ5kCs2ojJA+679PUsqXDY9q68Omq681 kt+6keX+qpx+YGJeCdM3EU5eFcCtHUo1JFbD8kBaEjigrOXylqVjlfGdeUPlt5ku5aUTTHDixnT Ml2iL/b6rucC/ZZbS+p0h8+WFJJzsXEotbKKpXKynpONM/XJZ+0de+vQzG0Ddb86dYx7PhAh/Bn h0BEMs32C0DfgMCNNzb+XNu1CemI1ShTLAJSUsj259bvS4gVZAR9JGJlYUTKXHoKEo/X3fEDCeP U+V4jg== X-Received: by 2002:a05:7022:3b87:b0:190:da74:2c89 with SMTP id a92af1059eb24-1b5030b7a1dmr12630681c88.21.1794866445094; Mon, 16 Nov 2026 14:00:45 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38115cfdd6esm1221905eec.5.2026.11.16.14.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 14:00:44 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 3/5] kernel-selftest: Add the modules and tools the tests need Date: Mon, 16 Nov 2026 14:00:37 -0800 Message-ID: <20261116220039.1807391-3-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> References: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 22:00:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/132567 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 Signed-off-by: Khem Raj --- meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 4254eccfd6..b1266fe553 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb @@ -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" From patchwork Mon Nov 16 22:00:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 104550 Received: from mail-dy1-f177.google.com (mail-dy1-f177.google.com [74.125.82.177]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4741.1794866449074762770 for ; Mon, 16 Nov 2026 14:00:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=tcU91vOZ; spf=pass (domain: gmail.com, ip: 74.125.82.177, mailfrom: raj.khem@gmail.com) Received: by mail-dy1-f177.google.com with SMTP id 5a478bee46e88-33bf40b0c8bso1619753eec.0 for ; Mon, 16 Nov 2026 14:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794866448; x=1795471248; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=l4i+Y9chIIR5N3zp/b0JshR1NWpFba9SPhxGPLPIMN8=; b=tcU91vOZl4AftKnNUvM5wm5CA+UVrZd76i8C0qP+DiH7tGOPSQJj4KCxNJHOVJzyfb Z1MD3rkpRziPYdtrBDYP7XjAh6gouoi/NngtDv5c4V9RZZhkXau7j2QYZ+W+M5VhC7hQ S8Am7Ox0n/nftHYxSQb/UQNJqFHuLmlHhDIFm2oHxNmiM132mmpFh9KVMZji2efFlpoe CZU/B7uggmcFefNyjPgz1H9RlvAy4bWI/WKOunTpXEkBRpDQoRE25goU64nRny2dIgn1 7OlMu/Oax74iOlWoxI0gllKM7i2C3TceE88c9X1bKuMxxEgn6Yz/4K4oZG3gYMcGZTRe C38g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794866448; x=1795471248; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=l4i+Y9chIIR5N3zp/b0JshR1NWpFba9SPhxGPLPIMN8=; b=H1X1NPNZAXC2ZW2AckuLp29J/ugCoPhhkJP3Y3Q1qkB9Zsbq4jpioPdqoEk23Jp1z1 ynzfakAsRZeXo7f9/ehZlcI1xXMU9vot2WMwbkkjRRKt+psRgJroA0bbSFn4iwWiJp2A w2DbnES91LQzQk3iPcJoffRwqoONpMEz/jPtkm0uhynZ7j5uoeXN6XsFQImm/OTZqWj2 g8tqWVZDFtmvnVQVybYUwgXTq+fvB9mz5Q+TUSOOj2dW72zbezgMxcr029vqx8unWOUH Oc5fLds5d+V0aSyYAe+ZEl8IgDhM/cA5vS8E4cXFrXHhylmomeqACfiANekvteJCEArN J3Ag== X-Gm-Message-State: APuU4Z/le+QLGEpwBN3qqe4NEAwhQcpb/oxZ6s2eJQ7CaElBddP+s7xS aqaix4noby9xOjeJOmP/JiiPdlhxx13qp4x4FNPpef2g0qANO4bVV3wMj5VTqx7l X-Gm-Gg: AYBFou10aJCwcnoQs6P3R9YZ4fakuk1effg77U4xQ6N/ysYjvZWMyM9TzU6po+IHm5E 0fJy2EzVKgGdnfc5t35PbiDZFpziJak8T27E6rSil9cDNnKWvKl58H1kzQQ+OSRiNn8v83V/i/6 j8oIKWM8Jl00UT0V9S6aZTZA+XlOxfUvWI5q6Do/FgKNzcAdftsXhFQwCyc804boVCZZmbgovcj E3hv5dsrioX4qoj/RD+iipPfXL5bvlVMyFlvNZXG7fg9as2LFYUINHX4SRooRe9b4G/lUwndfRU vwGCHfJOqotqyQKMLd5GEyaVeaxGFaDKMtCw8Rd/OJbJzmdnsi3u+2hHszdOhdIN9Z2gtCLmvfX ++GKSxqq6EJo8Q82VJgOQyGTaUFmipGKeRp7lZWWkoI+sPag85MTK+NIoRxslnrpLALIxNs70jH Vuh58dKABI89wFP4OCmKg6zhgnIZNTD2bJO2mf4H0Xn2decnQEc44M4wTE5O8w+J9UBs5cgDrUE PL0KSboKSnbuU0M1cw9thia9kiblo+sehGGclVUTWTxM68IzzwQVOme8MCBs3bj8dDZ/QcxnHzq JIY3Pj9ThTtuWMvx1jY5VjEyOQeYBZCjMTpEgOjI305kHXICW/IsWVejD5e5Wd+S4Kavf+Fskgz 1iJLl1dZHPKSDLN+BBP0K9AkKUD+TAm8uNhZQXiJHkNgBJJAcJSXGhStcPquu9MLiA6tasbAKjW 8BK8wL3fiYbssVDOT4YP3BNLyU8Rmt9IHnxEra5r/5Dsw0alaH4eBHNrThJQ2J06ux93dqChfMW pxfp/zqSbQrldbiY3B/IUhw9Y0SxzOeViQMG/DbgGWBnzHjbKZbHsvzJ1HmxdT4Aj8htywlxMBZ h5edJA== X-Received: by 2002:a05:7300:6b28:b0:376:bcc4:774b with SMTP id 5a478bee46e88-3796638ab4emr12187448eec.23.1794866446958; Mon, 16 Nov 2026 14:00:46 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38115cfdd6esm1221905eec.5.2026.11.16.14.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 14:00:45 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 4/5] kernel-selftest: Fix tests that fail on qemu Date: Mon, 16 Nov 2026 14:00:38 -0800 Message-ID: <20261116220039.1807391-4-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> References: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 22:00:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/132568 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 Signed-off-by: Khem Raj --- .../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 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index b1266fe553..96b837fb20 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb @@ -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)} \ " diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-cgroup-skip-the-cpu.max-tests-without-CONF.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-cgroup-skip-the-cpu.max-tests-without-CONF.patch new file mode 100644 index 0000000000..d879b8b846 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-cgroup-skip-the-cpu.max-tests-without-CONF.patch @@ -0,0 +1,69 @@ +From 889f34043a639015b2f844801a6e83bd3eaafe32 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 15:02:43 -0700 +Subject: [PATCH] selftests/cgroup: skip the cpu.max tests without + CONFIG_CFS_BANDWIDTH + +The cpu controller only provides cpu.max when the kernel is built with +CONFIG_CFS_BANDWIDTH. Without it, test_cpucg_max and +test_cpucg_max_nested fail to write the file and report a failure: + + not ok 8 test_cpucg_max + not ok 9 test_cpucg_max_nested + +Skip both tests when cpu.max does not exist. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/cgroup/test_cpu.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/tools/testing/selftests/cgroup/test_cpu.c b/tools/testing/selftests/cgroup/test_cpu.c +index 8f96bfd..5fbdd24 100644 +--- a/tools/testing/selftests/cgroup/test_cpu.c ++++ b/tools/testing/selftests/cgroup/test_cpu.c +@@ -654,6 +654,7 @@ static int test_cpucg_max(const char *root) + long usage_usec, n_periods, remainder_usec, expected_usage_usec; + char *cpucg; + char quota_buf[32]; ++ char buf[64]; + + snprintf(quota_buf, sizeof(quota_buf), "%ld", quota_usec); + +@@ -664,6 +665,12 @@ static int test_cpucg_max(const char *root) + if (cg_create(cpucg)) + goto cleanup; + ++ /* cpu.max needs CONFIG_CFS_BANDWIDTH */ ++ if (cg_read(cpucg, "cpu.max", buf, sizeof(buf))) { ++ ret = KSFT_SKIP; ++ goto cleanup; ++ } ++ + if (cg_write(cpucg, "cpu.max", quota_buf)) + goto cleanup; + +@@ -718,6 +725,7 @@ static int test_cpucg_max_nested(const char *root) + long usage_usec, n_periods, remainder_usec, expected_usage_usec; + char *parent, *child; + char quota_buf[32]; ++ char buf[64]; + + snprintf(quota_buf, sizeof(quota_buf), "%ld", quota_usec); + +@@ -735,6 +743,12 @@ static int test_cpucg_max_nested(const char *root) + if (cg_create(child)) + goto cleanup; + ++ /* cpu.max needs CONFIG_CFS_BANDWIDTH */ ++ if (cg_read(parent, "cpu.max", buf, sizeof(buf))) { ++ ret = KSFT_SKIP; ++ goto cleanup; ++ } ++ + if (cg_write(parent, "cpu.max", quota_buf)) + goto cleanup; + +-- +2.0 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-core-fix-unshare_test-with-large-fs.nr_ope.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-core-fix-unshare_test-with-large-fs.nr_ope.patch new file mode 100644 index 0000000000..f501ca11b8 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-core-fix-unshare_test-with-large-fs.nr_ope.patch @@ -0,0 +1,82 @@ +From df0b7e0ea59c43708cff8c7e34da5e2f8d430e5e Mon Sep 17 00:00:00 2001 +From: Konstantin Khorenko +Date: Fri, 14 Aug 2026 18:57:09 +0200 +Subject: [PATCH] selftests/core: fix unshare_test with large fs.nr_open + +The test assumes fs.nr_open is close to the default 1048576, but some +systems set it much higher (e.g. 1073741816). This is systemd's doing: +since systemd v240 (2018), PID 1 bumps fs.nr_open and fs.file-max to their +largest possible values on boot, as file descriptors are already accounted +for by memcg [1]. + +In that case, dup2() to nr_open + 64 requires the kernel to allocate a +file descriptor table with ~1 billion entries, which fails with ENOMEM. + +On a kernel that already carries 04a2c4b4511d1, dup2() no longer fails +with ENOMEM. The allocation is now rejected up front and the caller +gets EMFILE instead, without the WARNING, but the test still fails. + +Cap the nr_open value used for the test's own arithmetic to a known +reasonable base value (1048576) and restore the true original value once +the test has completed. + +Link: https://lore.kernel.org/20260814165709.513263-1-khorenko@virtuozzo.com +Link: https://github.com/systemd/systemd/commit/a8b627aaed409a15260c25988970c795bf963812 [1] +Upstream-Status: Backport [https://git.kernel.org/torvalds/c/df0b7e0ea59c] +Signed-off-by: Konstantin Khorenko +Signed-off-by: Eva Kurchatova +Signed-off-by: Andrew Morton +Cc: Shuah Khan +Cc: Wei Yang +Cc: +Signed-off-by: Khem Raj +--- + tools/testing/selftests/core/unshare_test.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/tools/testing/selftests/core/unshare_test.c b/tools/testing/selftests/core/unshare_test.c +index ffce75a6c228..d40e963dd520 100644 +--- a/tools/testing/selftests/core/unshare_test.c ++++ b/tools/testing/selftests/core/unshare_test.c +@@ -40,6 +40,14 @@ TEST(unshare_EMFILE) + + ASSERT_EQ(sscanf(buf, "%d", &nr_open), 1); + ++ /* ++ * Cap nr_open for the duration of the test to avoid ENOMEM from a ++ * huge fd table allocation; buf/n keep the real original value so ++ * fs.nr_open can be restored to it once the test is done. ++ */ ++ if (nr_open > 1024 * 1024) ++ nr_open = 1024 * 1024; ++ + ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlimit)); + + /* bump fs.nr_open */ +@@ -73,10 +81,13 @@ TEST(unshare_EMFILE) + + if (pid == 0) { + int err; ++ char buf3[32]; ++ ssize_t n3; + +- /* restore fs.nr_open */ ++ /* restore fs.nr_open to the (possibly capped) test baseline */ ++ n3 = sprintf(buf3, "%d\n", nr_open); + lseek(fd, 0, SEEK_SET); +- write(fd, buf, n); ++ write(fd, buf3, n3); + /* ... and now unshare(CLONE_FILES) must fail with EMFILE */ + err = unshare(CLONE_FILES); + EXPECT_EQ(err, -1) +@@ -89,6 +100,10 @@ TEST(unshare_EMFILE) + EXPECT_EQ(waitpid(pid, &status, 0), pid); + EXPECT_EQ(true, WIFEXITED(status)); + EXPECT_EQ(0, WEXITSTATUS(status)); ++ ++ /* restore the real fs.nr_open value */ ++ lseek(fd, 0, SEEK_SET); ++ write(fd, buf, n); + } + + TEST_HARNESS_MAIN diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-filesystems-binderfs-skip-binderfs_stress-.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-filesystems-binderfs-skip-binderfs_stress-.patch new file mode 100644 index 0000000000..5cdfa080da --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-filesystems-binderfs-skip-binderfs_stress-.patch @@ -0,0 +1,65 @@ +From 35b394922e4f715f31a2a7361adf38f32c00ddaf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 15:03:06 -0700 +Subject: [PATCH] selftests/filesystems/binderfs: skip binderfs_stress + without binderfs + +binderfs_test_privileged and binderfs_test_unprivileged skip when the +kernel has no binderfs, but binderfs_stress mounts it in a child process +and fails: + + binderfs_test.c:417:binderfs_stress:No such device - Failed to mount binderfs, ... + binderfs_test.c:491:binderfs_stress:wait_for_pid() failed + not ok 1 global.binderfs_stress + +Check /proc/filesystems first and skip the test if binderfs is not +available. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../filesystems/binderfs/binderfs_test.c | 24 +++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c +index cd82c89f558f..913102d3c620 100644 +--- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c ++++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c +@@ -36,6 +36,27 @@ + fd = -EBADF; \ + } + ++static bool binderfs_supported(void) ++{ ++ char line[256]; ++ bool found = false; ++ FILE *f; ++ ++ f = fopen("/proc/filesystems", "re"); ++ if (!f) ++ return false; ++ ++ while (fgets(line, sizeof(line), f)) { ++ if (!strcmp(line, "nodev\tbinder\n")) { ++ found = true; ++ break; ++ } ++ } ++ fclose(f); ++ ++ return found; ++} ++ + static void change_mountns(struct __test_metadata *_metadata) + { + int ret; +@@ -388,6 +409,9 @@ TEST(binderfs_stress) + char binderfs_mntpt[] = P_tmpdir "/binderfs_XXXXXX", + device_path[sizeof(P_tmpdir "/binderfs_XXXXXX/") + BINDERFS_MAX_NAME]; + ++ if (!binderfs_supported()) ++ SKIP(return, "The Android binderfs filesystem is not available"); ++ + ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, syncfds); + ASSERT_EQ(ret, 0) { + TH_LOG("%s - Failed to create socket pair", strerror(errno)); diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-expect-gpio-mockup-to-reject-an-empty.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-expect-gpio-mockup-to-reject-an-empty.patch new file mode 100644 index 0000000000..d7127eb5d4 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-expect-gpio-mockup-to-reject-an-empty.patch @@ -0,0 +1,52 @@ +From d033bebce48e7900680e325789e1b55186a7cc04 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 14:57:35 -0700 +Subject: [PATCH] selftests/gpio: expect gpio-mockup to reject an empty + range + +Since commit 446e8c31d0fc ("gpio: mockup: reject invalid +gpio_mockup_ranges widths") the module refuses to load with a zero-width +range, but the "no lines defined" test still expects it to load and +create no gpiochips: + + 2.1 no lines defined + test failed: insert gpio-mockup failed with error 1 + +Check that the module load fails instead. + +Fixes: 446e8c31d0fc ("gpio: mockup: reject invalid gpio_mockup_ranges widths") +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/gpio/gpio-mockup.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/gpio/gpio-mockup.sh b/tools/testing/selftests/gpio/gpio-mockup.sh +index fc2dd4c24d06..51856c9ad7e1 100755 +--- a/tools/testing/selftests/gpio/gpio-mockup.sh ++++ b/tools/testing/selftests/gpio/gpio-mockup.sh +@@ -271,6 +271,15 @@ test_no_line() + [ ! -e "$GPIO_DEBUGFS/$1/$2" ] || fail "unexpected line $1:$2" + } + ++# Check that loading the module with the gpio_mockup_ranges parameter $1 fails. ++insmod_fail_test() ++{ ++ if modprobe -q $module "gpio_mockup_ranges=$1"; then ++ remove_module ++ fail "insert $module with ranges <$1> should fail" ++ fi ++} ++ + # Load the module and check that the expected number of gpiochips, with the + # expected number of lines, are created and are functional. + # +@@ -378,7 +387,7 @@ if [ "$full_test" ]; then + fi + echo "2. Module load error tests" + echo "2.1 no lines defined" +-insmod_test "0,0" ++insmod_fail_test "0,0" + if [ "$full_test" ]; then + echo "2.2 ignore range overlap" + insmod_test "0,32,0,1" 32 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-skip-the-gpio-cdev-uaf-v1-tests-witho.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-skip-the-gpio-cdev-uaf-v1-tests-witho.patch new file mode 100644 index 0000000000..3dc56419b6 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-gpio-skip-the-gpio-cdev-uaf-v1-tests-witho.patch @@ -0,0 +1,127 @@ +From 192a749bd2e9ca16fd709a48636239955c169291 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 15:10:03 -0700 +Subject: [PATCH] selftests/gpio: skip the gpio-cdev-uaf v1 tests without + CONFIG_GPIO_CDEV_V1 + +The linehandle and lineevent tests use GPIO_GET_LINEHANDLE_IOCTL and +GPIO_GET_LINEEVENT_IOCTL, which the kernel only provides with +CONFIG_GPIO_CDEV_V1. Without it they fail with EINVAL and the whole test +fails: + + failed to get handle FD + failed to test handle ioctl + GPIO gpio-cdev-uaf test FAIL + +Exit with KSFT_SKIP in that case and let the script carry on with the +uAPI v2 tests. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/gpio/gpio-cdev-uaf.c | 20 ++++++++++++++---- + tools/testing/selftests/gpio/gpio-cdev-uaf.sh | 21 +++++++++++++++---- + 2 files changed, 33 insertions(+), 8 deletions(-) + +diff --git a/tools/testing/selftests/gpio/gpio-cdev-uaf.c b/tools/testing/selftests/gpio/gpio-cdev-uaf.c +index 765d3cc4f0ef..ef81e5c2b8be 100644 +--- a/tools/testing/selftests/gpio/gpio-cdev-uaf.c ++++ b/tools/testing/selftests/gpio/gpio-cdev-uaf.c +@@ -17,6 +17,8 @@ + #include + #include + ++#include "kselftest.h" ++ + #define CONFIGFS_DIR "/sys/kernel/config/gpio-sim" + #define PROCFS_DIR "/proc" + +@@ -201,7 +203,7 @@ static int test_ioctl(int fd) + + int main(int argc, char **argv) + { +- int cfd, fd, ret; ++ int cfd, fd, ret = EXIT_FAILURE; + int (*test_func)(int); + + if (argc != 3) { +@@ -249,7 +251,12 @@ int main(int argc, char **argv) + + req.lines = 1; + if (ioctl(cfd, GPIO_GET_LINEHANDLE_IOCTL, &req) == -1) { +- fprintf(stderr, "failed to get handle FD\n"); ++ if (errno == EINVAL) { ++ ret = KSFT_SKIP; ++ fprintf(stderr, "GPIO uAPI v1 is not available\n"); ++ } else { ++ fprintf(stderr, "failed to get handle FD\n"); ++ } + goto err_close_chip; + } + +@@ -259,7 +266,12 @@ int main(int argc, char **argv) + struct gpioevent_request req = {0}; + + if (ioctl(cfd, GPIO_GET_LINEEVENT_IOCTL, &req) == -1) { +- fprintf(stderr, "failed to get event FD\n"); ++ if (errno == EINVAL) { ++ ret = KSFT_SKIP; ++ fprintf(stderr, "GPIO uAPI v1 is not available\n"); ++ } else { ++ fprintf(stderr, "failed to get event FD\n"); ++ } + goto err_close_chip; + } + +@@ -288,5 +300,5 @@ int main(int argc, char **argv) + err_close_chip: + close(cfd); + close_chip("chip", "bank"); +- return EXIT_FAILURE; ++ return ret; + } +diff --git a/tools/testing/selftests/gpio/gpio-cdev-uaf.sh b/tools/testing/selftests/gpio/gpio-cdev-uaf.sh +index 6e47533019cf..dd7c702af873 100755 +--- a/tools/testing/selftests/gpio/gpio-cdev-uaf.sh ++++ b/tools/testing/selftests/gpio/gpio-cdev-uaf.sh +@@ -17,6 +17,19 @@ skip() { + exit 4 + } + ++# The linehandle and lineevent tests need the GPIO uAPI v1 ++# (CONFIG_GPIO_CDEV_V1); gpio-cdev-uaf exits with 4 if it is not available. ++test_v1() { ++ $BASE_DIR/gpio-cdev-uaf $1 $2 ++ case $? in ++ 0|4) ++ ;; ++ *) ++ fail "failed to test $1 $2" ++ ;; ++ esac ++} ++ + # Load the gpio-sim module. This will pull in configfs if needed too. + modprobe gpio-sim || skip "unable to load the gpio-sim module" + # Make sure configfs is mounted at /sys/kernel/config. Wait a bit if needed. +@@ -40,16 +53,16 @@ $BASE_DIR/gpio-cdev-uaf chip ioctl || fail "failed to test chip ioctl" + echo "2. linehandle" + + echo "2.1. ioctl" +-$BASE_DIR/gpio-cdev-uaf handle ioctl || fail "failed to test handle ioctl" ++test_v1 handle ioctl + + echo "3. lineevent" + + echo "3.1. read" +-$BASE_DIR/gpio-cdev-uaf event read || fail "failed to test event read" ++test_v1 event read + echo "3.2. poll" +-$BASE_DIR/gpio-cdev-uaf event poll || fail "failed to test event poll" ++test_v1 event poll + echo "3.3. ioctl" +-$BASE_DIR/gpio-cdev-uaf event ioctl || fail "failed to test event ioctl" ++test_v1 event ioctl + + echo "4. linereq" + diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-kvm-skip-nx_huge_pages_test.sh-without-KVM.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-kvm-skip-nx_huge_pages_test.sh-without-KVM.patch new file mode 100644 index 0000000000..b67d03f06c --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-kvm-skip-nx_huge_pages_test.sh-without-KVM.patch @@ -0,0 +1,36 @@ +From f5789245c843627b4982f3ded204186b4914dedb Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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) diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-check-lsm_get_self_attr-errno-before-a.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-check-lsm_get_self_attr-errno-before-a.patch new file mode 100644 index 0000000000..2bd5b1bfbc --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-check-lsm_get_self_attr-errno-before-a.patch @@ -0,0 +1,45 @@ +From 90d24deaa365d597ffba9ae2db5fa27209ce5402 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 15:01:15 -0700 +Subject: [PATCH] selftests/lsm: check lsm_get_self_attr() errno before + attr_lsm_count() + +size_too_small_lsm_get_self_attr checks errno after calling +attr_lsm_count(), which reads /sys/kernel/security/lsm with fopen(). +Without securityfs mounted the fopen() fails, errno becomes ENOENT, and +the test fails even though the syscall returned the expected error: + + lsm_get_self_attr_test.c:68:size_too_small_lsm_get_self_attr:Expected EOPNOTSUPP (95) == errno (2) + +Save errno right after the syscall. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tools/testing/selftests/lsm/lsm_get_self_attr_test.c b/tools/testing/selftests/lsm/lsm_get_self_attr_test.c +index 60caf8528f81..14c01b1b626c 100644 +--- a/tools/testing/selftests/lsm/lsm_get_self_attr_test.c ++++ b/tools/testing/selftests/lsm/lsm_get_self_attr_test.c +@@ -58,14 +58,17 @@ TEST(size_too_small_lsm_get_self_attr) + const long page_size = sysconf(_SC_PAGESIZE); + struct lsm_ctx *ctx = calloc(page_size, 1); + __u32 size = 1; ++ int err; + + ASSERT_NE(NULL, ctx); + errno = 0; + ASSERT_EQ(-1, lsm_get_self_attr(LSM_ATTR_CURRENT, ctx, &size, 0)); ++ /* attr_lsm_count() can change errno */ ++ err = errno; + if (attr_lsm_count()) { +- ASSERT_EQ(E2BIG, errno); ++ ASSERT_EQ(E2BIG, err); + } else { +- ASSERT_EQ(EOPNOTSUPP, errno); ++ ASSERT_EQ(EOPNOTSUPP, err); + } + ASSERT_NE(1, size); + diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-skip-correct_lsm_list_modules-without-.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-skip-correct_lsm_list_modules-without-.patch new file mode 100644 index 0000000000..a6eeb5dbf5 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-lsm-skip-correct_lsm_list_modules-without-.patch @@ -0,0 +1,33 @@ +From aec608f3643722f98098618f72fcc3c75a14c407 Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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); diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-icmp-skip-without-tcpdump.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-icmp-skip-without-tcpdump.patch new file mode 100644 index 0000000000..ea03ad4f65 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-icmp-skip-without-tcpdump.patch @@ -0,0 +1,30 @@ +From bd02c9f9ff8b78eada28d6d6c8a23b0d044d10ba Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-don-t-hang-when-the-iperf3-.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-don-t-hang-when-the-iperf3-.patch new file mode 100644 index 0000000000..a02319ff90 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-don-t-hang-when-the-iperf3-.patch @@ -0,0 +1,33 @@ +From c0649196a87bf5d80336ba9ff703f06c8e50d954 Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-skip-the-UDP-tunnel-tests-w.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-skip-the-UDP-tunnel-tests-w.patch new file mode 100644 index 0000000000..c30135498b --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-net-udpgro_fwd-skip-the-UDP-tunnel-tests-w.patch @@ -0,0 +1,52 @@ +From 7b89e7979ca943a760a87943fa9e26a459ad5457 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 16:52:35 -0700 +Subject: [PATCH] selftests: net: udpgro_fwd: skip the UDP tunnel tests + without vxlan + +The last three tests of each address family run over a vxlan tunnel. +When the kernel can't create vxlan devices they can't pass, and before +the previous fix they hung the whole test. + +Probe for vxlan support once and report those tests as skipped when it +is missing. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/net/udpgro_fwd.sh | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/tools/testing/selftests/net/udpgro_fwd.sh b/tools/testing/selftests/net/udpgro_fwd.sh +index 854b65c752e9..839170257230 100755 +--- a/tools/testing/selftests/net/udpgro_fwd.sh ++++ b/tools/testing/selftests/net/udpgro_fwd.sh +@@ -227,6 +227,13 @@ run_bench() { + fi + } + ++# the UDP tunnel tests need vxlan support in the kernel ++have_vxlan=yes ++ip netns add "$BASE" ++ip -n "$BASE" link add dev vxlan_probe type vxlan id 1 dstport 4789 \ ++ 2>/dev/null || have_vxlan=no ++ip netns del "$BASE" ++ + for family in 4 6; do + BM_NET=$BM_NET_V4 + OL_NET=$OL_NET_V4 +@@ -276,6 +283,14 @@ for family in 4 6; do + run_bench "UDP GRO fwd perf" $BM_NET$DST + cleanup + ++ if [ "$have_vxlan" = no ]; then ++ for msg in "GRO frag list over UDP tunnel" \ ++ "GRO fwd over UDP tunnel" "GSO after GRO"; do ++ printf "%-40s skip - vxlan not supported\n" "$msg" ++ done ++ continue ++ fi ++ + create_vxlan_pair + ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on + ip netns exec $NS_DST ethtool -K veth$DST rx-gro-list on diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-proc-empty-vm-treat-pkey_alloc-ENOSPC.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-proc-empty-vm-treat-pkey_alloc-ENOSPC.patch new file mode 100644 index 0000000000..e1f1484ef1 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-proc-empty-vm-treat-pkey_alloc-ENOSPC.patch @@ -0,0 +1,35 @@ +From d41aa0d89994e56d629a4f22526c3310e0b1a6ae Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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); diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-read-tolerate-tasks-exiting-during-th.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-read-tolerate-tasks-exiting-during-th.patch new file mode 100644 index 0000000000..0571b8ae3d --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-proc-read-tolerate-tasks-exiting-during-th.patch @@ -0,0 +1,70 @@ +From bfc5fb89d1ec500baf6fecfb2affb9e729166509 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 14:52:54 -0700 +Subject: [PATCH] selftests/proc: read: tolerate tasks exiting during the + walk + +The test walks all of /proc, including the directories of other tasks. +If one of them exits in the middle of the walk, reading its directories +fails: proc_pident_readdir() and friends return ENOENT for a dead task, +and proc_tgid_net_readdir() returns EINVAL once the task's network +namespace can't be found. xreaddir() asserts on any error: + + read: proc.h:49: xreaddir: Assertion `de || errno == 0' failed. + +Any short-lived process on the system, like systemd's userdbd workers, +makes the test fail randomly. Treat those errors as the end of the +directory. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/proc/read.c | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/tools/testing/selftests/proc/read.c b/tools/testing/selftests/proc/read.c +index 35ee78dff144..e8b1f6feb1ba 100644 +--- a/tools/testing/selftests/proc/read.c ++++ b/tools/testing/selftests/proc/read.c +@@ -74,19 +74,38 @@ static void f_lnk(DIR *d, const char *filename) + assert((0 <= rv && rv <= sizeof(buf)) || rv == -1); + } + ++/* ++ * Like xreaddir(), but a task can exit while its /proc/PID directory is ++ * being walked. Reading its directories then fails with ENOENT, or with ++ * EINVAL for /proc/PID/net, which ends the directory. ++ */ ++static struct dirent *xreaddir_task(DIR *d) ++{ ++ struct dirent *de; ++ ++ errno = 0; ++ de = readdir(d); ++ assert(de || errno == 0 || errno == ENOENT || errno == EINVAL); ++ return de; ++} ++ + static void f(DIR *d, unsigned int level) + { + struct dirent *de; + +- de = xreaddir(d); ++ de = xreaddir_task(d); ++ if (!de) ++ return; + assert(de->d_type == DT_DIR); + assert(streq(de->d_name, ".")); + +- de = xreaddir(d); ++ de = xreaddir_task(d); ++ if (!de) ++ return; + assert(de->d_type == DT_DIR); + assert(streq(de->d_name, "..")); + +- while ((de = xreaddir(d))) { ++ while ((de = xreaddir_task(d))) { + assert(!streq(de->d_name, ".")); + assert(!streq(de->d_name, "..")); + diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-install-cs_prctl_test-from-the-outpu.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-install-cs_prctl_test-from-the-outpu.patch new file mode 100644 index 0000000000..532f99f3bf --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-install-cs_prctl_test-from-the-outpu.patch @@ -0,0 +1,34 @@ +From a24b4ff5908c55fa77e1c63192769d8b0449c82d Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-skip-cs_prctl_test-when-core-schedul.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-skip-cs_prctl_test-when-core-schedul.patch new file mode 100644 index 0000000000..2ac9cc450e --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-sched-skip-cs_prctl_test-when-core-schedul.patch @@ -0,0 +1,55 @@ +From 36be863d675f80ed11b96a87ebecb08c65904d4f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 14:56:28 -0700 +Subject: [PATCH] selftests/sched: skip cs_prctl_test when core + scheduling is unavailable + +PR_SCHED_CORE fails with EINVAL when the kernel is built without +CONFIG_SCHED_CORE, and with ENODEV when SMT is not active, e.g. in a VM +without SMT siblings. The test then fails on its first prctl() call: + + -1 = prctl(62, 1, 0, 2, 0) + (cs_prctl_test.c:287) - + +Probe for core scheduling first and skip the test if it is unavailable. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/sched/cs_prctl_test.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/tools/testing/selftests/sched/cs_prctl_test.c b/tools/testing/selftests/sched/cs_prctl_test.c +index 52d97fae4dbd..e504138cf632 100644 +--- a/tools/testing/selftests/sched/cs_prctl_test.c ++++ b/tools/testing/selftests/sched/cs_prctl_test.c +@@ -32,6 +32,8 @@ + #include + #include + ++#include "kselftest.h" ++ + #if __GLIBC_PREREQ(2, 30) == 0 + #include + static pid_t gettid(void) +@@ -231,6 +233,7 @@ void _validate(int line, int val, char *msg) + + int main(int argc, char *argv[]) + { ++ unsigned long cookie; + int keypress = 0; + int num_threads = 3; + int delay = 0; +@@ -270,6 +273,12 @@ int main(int argc, char *argv[]) + if (keypress) + delay = -1; + ++ if (prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, getpid(), PIDTYPE_PID, ++ (unsigned long)&cookie) && (errno == EINVAL || errno == ENODEV)) { ++ printf("core scheduling is not available: %s\n", strerror(errno)); ++ return KSFT_SKIP; ++ } ++ + srand(time(NULL)); + + /* put into separate process group */ diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-splice-skip-the-kernfs-checks-without-test.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-splice-skip-the-kernfs-checks-without-test.patch new file mode 100644 index 0000000000..52b5a6a7cb --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-splice-skip-the-kernfs-checks-without-test.patch @@ -0,0 +1,45 @@ +From ce9bcf34e00ffbf49712edf1523e5b6c48978204 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 14:57:59 -0700 +Subject: [PATCH] selftests/splice: skip the kernfs checks without + test_module + +short_splice_read.sh uses test_module's sysfs files for its kernfs +checks. When the kernel is built without CONFIG_TEST_LKM there is no +such module, and the test fails even though all the other checks pass: + + modprobe: FATAL: Module test_module not found in directory /lib/modules/... + FAIL: test_module kernel module load should work + +Skip the kernfs checks when the module is not available. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/splice/short_splice_read.sh | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/tools/testing/selftests/splice/short_splice_read.sh b/tools/testing/selftests/splice/short_splice_read.sh +index 4710e09f49fa..b6249046a580 100755 +--- a/tools/testing/selftests/splice/short_splice_read.sh ++++ b/tools/testing/selftests/splice/short_splice_read.sh +@@ -124,10 +124,15 @@ expect_success "proc_handler: proc_dostring() splice" test_splice /proc/sys/kern + expect_success "proc_handler: special read splice" test_splice /proc/sys/kernel/version + + ### /sys/ has no splice interface; these should all fail. +-if ! [ -d /sys/module/test_module/sections ] ; then +- expect_success "test_module kernel module load" modprobe test_module ++if [ -d /sys/module/test_module/sections ] || modinfo test_module >/dev/null 2>&1 ; then ++ if ! [ -d /sys/module/test_module/sections ] ; then ++ expect_success "test_module kernel module load" modprobe test_module ++ fi ++ expect_success "kernfs attr splice" test_splice /sys/module/test_module/coresize ++ expect_success "kernfs binattr splice" test_splice /sys/module/test_module/sections/.init.text ++else ++ echo "" >&2 ++ echo "SKIP: kernfs splice tests, test_module (CONFIG_TEST_LKM) is not available" >&2 + fi +-expect_success "kernfs attr splice" test_splice /sys/module/test_module/coresize +-expect_success "kernfs binattr splice" test_splice /sys/module/test_module/sections/.init.text + + exit $ret diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-syscall_user_dispatch-build-sud_benchmark-.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-syscall_user_dispatch-build-sud_benchmark-.patch new file mode 100644 index 0000000000..100f0aca57 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-syscall_user_dispatch-build-sud_benchmark-.patch @@ -0,0 +1,35 @@ +From 5bd11503bf3a582f3be9eef427b2d3384ff03ba2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- + 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 diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-watchdog-skip-when-there-is-no-watchdog-de.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-watchdog-skip-when-there-is-no-watchdog-de.patch new file mode 100644 index 0000000000..5d2a1bfda3 --- /dev/null +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-watchdog-skip-when-there-is-no-watchdog-de.patch @@ -0,0 +1,46 @@ +From e5c9e9d546c54acba09537b4722da906cc910dfb Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Oct 2026 15:05:15 -0700 +Subject: [PATCH] selftests/watchdog: skip when there is no watchdog + device + +watchdog-test exits with -1 when /dev/watchdog does not exist, so on +systems without a watchdog it is reported as a failure: + + Watchdog device (/dev/watchdog) not found. + not ok 1 selftests: watchdog: watchdog-test # exit=255 + +Skip the test in that case. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/testing/selftests/watchdog/watchdog-test.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c +index 4f09c5db0c7f..6756231df9fb 100644 +--- a/tools/testing/selftests/watchdog/watchdog-test.c ++++ b/tools/testing/selftests/watchdog/watchdog-test.c +@@ -23,6 +23,8 @@ + #include + #include + ++#include "kselftest.h" ++ + #define DEFAULT_PING_RATE 1 + + int fd; +@@ -189,9 +191,10 @@ int main(int argc, char *argv[]) + fd = open(file, O_WRONLY); + + if (fd == -1) { +- if (errno == ENOENT) ++ if (errno == ENOENT) { + printf("Watchdog device (%s) not found.\n", file); +- else if (errno == EACCES) ++ exit(KSFT_SKIP); ++ } else if (errno == EACCES) + printf("Run watchdog as root.\n"); + else + printf("Watchdog device open failed %s\n", From patchwork Mon Nov 16 22:00:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 104546 Received: from mail-dl1-f52.google.com (mail-dl1-f52.google.com [74.125.82.52]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4803.1794866449126632827 for ; Mon, 16 Nov 2026 14:00:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=mIjaNP/r; spf=pass (domain: gmail.com, ip: 74.125.82.52, mailfrom: raj.khem@gmail.com) Received: by mail-dl1-f52.google.com with SMTP id a92af1059eb24-1b3a05f8b5bso4996409c88.1 for ; Mon, 16 Nov 2026 14:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794866448; x=1795471248; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=y1TcmG9qu1LQyH8HVm2Y6HsES7mXdyLuG+KoqrRoALs=; b=mIjaNP/rVnI8VULW1ffjdv+6Am7Kcf2AN5/Xa6vOl1TBtqXDZ0o0XGRNqqrHQ+Ntzz MeqXJQV4ehYYs3mLbt239v2w1iQ6Kt9KJFjzy5QZ5RlwRM8URp/w9aAK/AjwvbAwv06z +wK2x7LgHuWWCagavYD8FAijmEWLaZCcT3HNPY0NiRvw/U1EZjQoQFRERSbjezESApkN d4AbvFdWKZmg/nrvzgTxUqd7qerGmld59FjPP4RN/e20VrDTajqlg60JAkAULL/D16ol BQ/FjM/I0/IVBUnLgYQsVRCIu7oB23efANXwJTb8+7Ua4NXZ++YICEDvFH6hKQOHPCPe mTmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794866448; x=1795471248; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=y1TcmG9qu1LQyH8HVm2Y6HsES7mXdyLuG+KoqrRoALs=; b=SWxfAvcnUYwqDhSgqKa3wjjTmtRWkj4uRbAq8yvY21JqjGRbeLjgkxc3Y22fKFe4T9 T3FENbQkGd0R7bQsLmcMqhnVp+zTyKFFQEOOT9CRWH5XXmbq7WjGQdG+YA1xYDHVKzzq oH3oTWMpd3tL+Lxd2O3xzoMdsBRjJwVFVV2GI0CaUsFgoM8Ii6FtNr71RmSVo+fjml/6 /YZ62CGWK2z0Mw5/VKC/SzKXIi90lBAKspzRw/aPyfQ63vaffHQ0Tt3F8EVXdywylElF Bo6S3aOmaj5m6OASlldJNxQpb/pNWYU5h2IQguPeylrvu1tlUcbHYYigZTrNm1DF+MHd h4Mw== X-Gm-Message-State: APuU4Z9ZTALIsvKDDJm4D2BXn411ELJ2vjyIoyXa0vcuTgW8QTiPsoDD 9DaQs7lCYBdP8mWF5Vryt0VDHAl8wnoaTtwTD2GLR4knmlnnK+GP65zFb5QJsujY X-Gm-Gg: AZFdTZeUx7DZzdXEh77kUv/jMXC5ziRQgNq3m6caR8+rrQ62/+3zfWDV8xP4WFKFvxr 2oj4UhjR12ZkcMO9Y45nk+CuMuMvdfFZUna3BFDcFzGm9pbuGJ86tEbXhkeMdCvy/5uyu+FOHQH ZeHgfOPJWKE8pVFDJCjhvXyM4pUukv6VUuVTM2P35s0OQdgqoBXyjcDAmCT/2T7PyV2lXjPtXM7 YosbL/Xa2Rjx4ZP7F35AgxUor+Yv3mjXTqLGSWCuae/wf7t9UiJcX44PTOIsKShTNqko9MgxJDs UW9BEDqA5ZB8czMi+USm32WiwNGp5XuS1LYzbiS+ql7lLeE5FC4MtG6bcx0aoIceW2i7MlNGikB MfDZ2hDvdXy2lNzSD3eTkJl2gk1jpzqDDkjGI6oQr6kiQiP51dnGWUp3WsvZh/8Q3VpEI4c4xU0 eabb/3FHxH28Ph9LCwy68CFgfKndRO30qwIdA6DmZfeBxKEnzY+7G92bhR7nEvfOaPOnbswXeg9 Cm1PZQF+CVLLZwFnxXav4XN200ikdCl/mpiNd3VzLiI07jfAKaLIwgtWernH1zvA1tfmlrR27Q4 iibvCQP7Qh1iKbOUyB5T1o8dR6eqzlQLj7EqWG4K/UDFHn+Jg7uQ+jzHyh8tCJXGhqYDhk8+rR0 YhIZsN/KrA0P5iwLArv+cWyFmCQ6sP5yCaz3OpSWfqTTTS+TTFe0+81RjVh7eAwOksqADAltcMB 6UfEpewet13J68DLIHqvIAbZ7pIqB0BnYoMuwUn9Irft0q66fvm120K+R3MikGOiDicLr2FGnbA qqTARpyCIrNHwUXkYGIs4dfNBO8AzSxyGmX18epZsrXXhA7tRuHcox1zZTzGvKrLjlofTNSqRbF UDGl X-Received: by 2002:a05:7300:3083:b0:36c:f88b:caae with SMTP id 5a478bee46e88-379675fc82fmr19125686eec.22.1794866448037; Mon, 16 Nov 2026 14:00:48 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38115cfdd6esm1221905eec.5.2026.11.16.14.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 14:00:47 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 5/5] kernel-selftest: Skip tests the running kernel can't support Date: Mon, 16 Nov 2026 14:00:39 -0800 Message-ID: <20261116220039.1807391-5-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> References: <20261116220039.1807391-1-khem.raj@oss.qualcomm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 22:00:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/132569 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 Signed-off-by: Khem Raj --- .../kernel-selftest/kernel-selftest/run-ptest | 93 ++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest index e8a136dce8..85fa63b5e4 100755 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest @@ -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"