kunit: Introduce UAPI testing framework#1313
Open
vfsci-bot[bot] wants to merge 11 commits intovfs.base.cifrom
Open
kunit: Introduce UAPI testing framework#1313vfsci-bot[bot] wants to merge 11 commits intovfs.base.cifrom
vfsci-bot[bot] wants to merge 11 commits intovfs.base.cifrom
Conversation
Some upcoming documentation will link directly to the userprogs section. Add a label to the section so it can be referenced. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Nicolas Schier <n.schier@avm.de> Acked-by: Masahiro Yamada <masahiroy@kernel.org>
Allow callers to specify the directory against which to resolve the program filename. Enables running executables from private mounts. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Allow callers to specify the directory against which to resolve the helper's filename. Enables the running of helpers from private mounts. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Allow usage of kern_unmount from the automatic __free cleanup logic. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Building userspace applications through the kbuild "userprogs" framework requires a libc. Kernel toolchains often do not contain a libc. In this case it is useful to use the nolibc library from the kernel tree. Nolibc does not support all architectures and requires compiler flags. Add a kconfig option, so users can know where it is available and provide a variable for common options. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Nicolas Schier <n.schier@avm.de>
The upcoming kunit UAPI framework will run userspace executables as part of kunit. These may use the LSX or LASX instructions. Make sure the kunit kernel can handle these instructions. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com>
Enable running UAPI tests as part of kunit. The selftests are embedded into the kernel image and their output is forwarded to kunit for unified reporting. The implementation reuses parts of usermode drivers and usermode helpers. However these frameworks are not used directly as they make it impossible to retrieve a thread's exit code. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
The output of the test executable should be grouped together with the regular KUnit output and also be available in debugfs. Install a custom miscdevice as stdout and stderr which forwards the written data to the KUnit log. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Extend the example to show how to run a userspace executable. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com>
UAPI selftests may expect a "normal" userspace environment. For example the normal kernel API pseudo-filesystems should be mounted. This could be done from kernel code but it is non-idiomatic. Add a preinit userspace executable which performs these setup steps before running the final test executable. This preinit executable is only ever run from the kernel. Give it access to autoconf.h and kconfig.h to adapt itself to the tested kernel. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com>
Show that the selftests are executed from a fairly "normal" userspace context. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Series: https://patchwork.kernel.org/project/linux-fsdevel/list/?series=1089181
Submitter: Thomas Weißschuh
Version: 6
Patches: 11/11
Message-ID:
<20260504-kunit-kselftests-v6-0-712d3d526d97@linutronix.de>Base: vfs.base.ci
Lore: https://lore.kernel.org/linux-fsdevel/20260504-kunit-kselftests-v6-0-712d3d526d97@linutronix.de
Automated by ml2pr