Skip to contentSkip to conversation

selftests/mm: honor VM_SELFTEST_ITEMS from the environment

PATCH In review Nico Pache (Red Hat) 2 participants 3 messages Nov 22

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/mm: honor VM_SELFTEST_ITEMS from the environment

The unconditional default assignment overwrites VM_SELFTEST_ITEMS from the environment. This regresses environments that use the variable to select test groups: without -t, all default test categories run instead of the requested groups. The -t option continues to override it.

Fixes 4844f5b84a8e ("selftests/mm: reject invalid test selections before running tests")
---
 tools/testing/selftests/mm/run_vmtests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +1 -1
index a1b45a3dedae..aa63f840cf60 100755
@@ -102,7 +102,7 @@ RUN_ALL=false
 RUN_DESTRUCTIVE=false
 TAP_PREFIX="# "
 
-VM_SELFTEST_ITEMS="default"
+: "${VM_SELFTEST_ITEMS:=default}"
 
 while getopts "aht:nd" OPT; do
 	case ${OPT} in

---
base-commit: 2dc60bd9975fc8666a13d58410499e06e6799ba9
change-id: 20261122-vm_selftests_items_fix-f118ab78426e

Best regards,

Signature · 1 line
Nico Pache (Red Hat) <[email protected]>
maintainer
#1 lore raw
Quoted 4 lines · On Sun, 22 Nov 2026 11:50:36 -0700 "Nico Pache (Red Hat)"…

The unconditional default assignment overwrites VM_SELFTEST_ITEMS from the environment. This regresses environments that use the variable to select test groups: without -t, all default test categories run instead of the requested groups. The -t option continues to override it.

Oh. Is "setenv VM_SELFTEST_ITEMS" really a thing?

afaict the official way of doing this is to use -t. Continuing to support "setenv VM_SELFTEST_ITEMS" is perpetuating bad behavior. How about teaching "environments" to use the official selection method?

author
#2 lore raw
Quoted 8 lines · Andrew Morton
Quoted 4 lines · On Sun, 22 Nov 2026 11:50:36 -0700 "Nico Pache (Red Hat)"…

The unconditional default assignment overwrites VM_SELFTEST_ITEMS from the environment. This regresses environments that use the variable to select test groups: without -t, all default test categories run instead of the requested groups. The -t option continues to override it.

Oh. Is "setenv VM_SELFTEST_ITEMS" really a thing?

Thats how we've been utilizing it since we added this. It was the easiest solution for our testing infrastructure.

Quoted 4 lines

afaict the official way of doing this is to use -t. Continuing to support "setenv VM_SELFTEST_ITEMS" is perpetuating bad behavior. How about teaching "environments" to use the official selection method?

Ok, fair enough. I will look into switching over.

Thanks,
-- Nico