[PW_SID:970692] kunit: Introduce UAPI testing framework#511
[PW_SID:970692] kunit: Introduce UAPI testing framework#511linux-riscv-bot wants to merge 16 commits into
Conversation
The duplication makes maintenance harder. Changes need to be done in two places and the lines will grow overly long. Use an intermediary variable instead. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Make sure the byte order and ABI of the userprogs matches the one of the kernel, similar to how the bit size is handled. Otherwise the userprogs may not be executable. This happens for example on powerpc little endian, or riscv32. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
For the kunit UAPI functionality this feature is needed. This reverts commit d1b99cd ("init: remove unused CONFIG_CC_CAN_LINK_STATIC") Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Userprogs are built with the regular kernel compiler $CC. A kernel compiler does not necessarily contain a libc which is required for a normal userspace application. However the kernel tree does contain a minimal libc implementation "nolibc" which can be used to build userspace applications. Introduce support to build userprogs against nolibc instead of the default libc of the compiler, which may not exist. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Nolibc does not support all architectures. Add a kconfig option, so users can know where it is available. The new option is maintained inside tools/include/nolibc/ as only that directory is responsible for nolibc's availability. Reviewed-by: Nicolas Schier <n.schier@avm.de> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Some upcoming new documentation should 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> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Various subsystems embed non-code build artifacts into the kernel, for example the initramfs, /proc/config.gz, vDSO image, etc. Currently each user has their own implementation for that. Add a common "blob" framework to provide this functionality. It provides standard kbuild and C APIs to embed and later access non-code build artifacts into the kernel image or modules. Reviewed-by: Nicolas Schier <n.schier@avm.de> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Currently there is no test validating the result reporting from nested tests. Add one, it will also be used to validate upcoming changes to the nested test parsing. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
If a subtest itself reports success, but the outer testcase fails, the whole testcase should be reported as a failure. However the status is recalculated based on the test counts, overwriting the outer test result. Synthesize a failed test in this case to make sure the failure is not swallowed. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Skipped tests reported by kselftest.h use a different format than KTAP, there is no explicit test name. Normally the test name is part of the free-form string after the SKIP keyword: ok 3 # SKIP test: some reason Extend the parser to handle those correctly. Use the free-form string as test name instead. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
An upcoming change will add 'userprogs' to the kunit subdirectory. For kbuild to properly clean up these build artifacts the subdirectory needs to be always processed. Pushing the special logic for hook.o into the kunit Makefile also makes the logic easier to understand. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.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> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Extend the example to show how to run a userspace executable. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.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> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Show that the selftests are executed from a fairly "normal" userspace context. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 1: "[v3,01/16] kbuild: userprogs: avoid duplicating of flags inherited from kernel" |
|
Patch 2: "[v3,02/16] kbuild: userprogs: also inherit byte order and ABI from kernel" |
|
Patch 2: "[v3,02/16] kbuild: userprogs: also inherit byte order and ABI from kernel" |
|
Patch 14: "[v3,14/16] kunit: uapi: Add example for UAPI tests" |
|
Patch 14: "[v3,14/16] kunit: uapi: Add example for UAPI tests" |
|
Patch 14: "[v3,14/16] kunit: uapi: Add example for UAPI tests" |
|
Patch 14: "[v3,14/16] kunit: uapi: Add example for UAPI tests" |
|
Patch 14: "[v3,14/16] kunit: uapi: Add example for UAPI tests" |
|
Patch 14: "[v3,14/16] kunit: uapi: Add example for UAPI tests" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 15: "[v3,15/16] kunit: uapi: Introduce preinit executable" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
|
Patch 16: "[v3,16/16] kunit: uapi: Validate usability of /proc" |
PR for series 970692 applied to workflow__riscv__fixes
Name: kunit: Introduce UAPI testing framework
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=970692
Version: 3