selftests: add support for VMA userspace tests
PATCH 1/1 selftests: add support for VMA userspace tests
Add support for testing VMA userspace tests under the radix tree test bundle. The VMA tests are located in tools/testing/vma and are userspace-only tests that don't require kernel module loading like the existing xarray and maple tree tests.
This extends the SELFTESTS_TEST_BUNDLE_RADIX_TREE configuration to include VMA testing alongside the existing xarray and maple tree tests.
Demo:
make DEVOPS_HOSTS_PREFIX="mm" defconfig-seltests-radix-tree make
make linux
make selftests
make sefltests-baseline HOSTS=mm-vma
cat workflows/selftests/results/last-run/6.16.0-rc7/vma.userspace.log 16 tests run, 16 passed, 0 failed
---
I just asked Claude AI to add support. I hope this shows that adding support is really easy for new selftests even odd tests which are not part of the formal selftests or kunit like this one.
This and all my pending patches can be found here:
https://github.com/linux-kdevops/kdevops/tree/mcgrof/vma-v2
In case folks are curious, the prompt I used to Claude AI was just (get the npm version, don't use the web interface, that's ancient stuff):
We already support testing the Linux kernel maple tree and radix tree on the selftests workflow. These are custom tests and each of these are tested on kdevops in-kernel and then in userspace. The kernel testing is done is there is loadable kernel module for each. We have support for bundling these two tests under the defconfigs/seltests-radix-tree and use SELFTESTS_TEST_BUNDLE_RADIX_TREE to help us bundle radix-tree related tests. We want to extend this with a new userspace only test. Its the vma tests on the kernel but for userspace. So it won't have a corresponding Linux kernel module load, contrary to test_xarray and test_maple_tree. The only thing that needs to be done to test it is to change directory on the linux kernel directory sources into tools/testing/vma and as a user run make -j$(nproc) and then just run sudo ./vma. So add support for this and augment SELFTESTS_TEST_BUNDLE_RADIX_TREE to select this.
playbooks/roles/selftests/defaults/main.yml | 2 + playbooks/roles/selftests/tasks/main.yml | 52 ++++++++++++++++----- workflows/selftests/Kconfig | 12 +++++ 3 files changed, 55 insertions(+), 11 deletions(-)
playbooks/roles/selftests/defaults/main.yml +2 -0
@@ -22,6 +22,7 @@ selftests_section_kmod: False selftests_section_maple: False selftests_section_sysctl: False selftests_section_xarray: False +selftests_section_vma: False selftests_ksrc: "tools/testing/selftests/" selftests_data: "{{ target_linux_dir_path }}/{{ selftests_ksrc }}"
@@ -35,3 +36,4 @@ selftest_kernelspace: False selftest_xarray: False selftest_maple: False +selftest_vma: False
playbooks/roles/selftests/tasks/main.yml +41 -11
107 lines not on this page · raw message
workflows/selftests/Kconfig +12 -0
@@ -33,6 +33,7 @@ config SELFTESTS_TEST_BUNDLE_RADIX_TREE output yaml select SELFTESTS_SECTION_MAPLE select SELFTESTS_SECTION_XARRAY + select SELFTESTS_SECTION_VMA help This will ensure you test the radix tree in the kernel.
@@ -78,6 +79,12 @@ config SELFTESTS_SECTION_XARRAY help This will create a host to test the xarray. +config SELFTESTS_SECTION_VMA + bool "VMA" + output yaml + help + This will create a host to test the VMA userspace tests. + endif # SELFTESTS_MANUAL_COVERAGE if !SELFTESTS_MANUAL_COVERAGE
@@ -107,6 +114,11 @@ config SELFTESTS_SECTION_XARRAY output yaml default y +config SELFTESTS_SECTION_VMA + bool + output yaml + default y + endif # !SELFTESTS_MANUAL_COVERAGE endmenu
Signature · 1 line
2.45.2