Skip to contentSkip to conversation

selftests/futex: Conditionally run futex_numa_mpol test

PATCH In review Wake Liu 3 participants 3 messages Sep 8, 2025 – Sep 12, 2025

Subsystems (2)
lore
Share & tools
lore

Wake Liu

author
#0 lore raw

PATCH 1/1 selftests/futex: Conditionally run futex_numa_mpol test

The futex_numa_mpol test requires libnuma, which is not available on all platforms. When the test is not built, the run.sh script fails because it unconditionally tries to execute the test binary.

Check for the futex_numa_mpol executable before running it. If the binary is not present, print a skip message and continue.

This allows the test suite to run successfully on platforms that do not have libnuma and therefore do not build the futex_numa_mpol test.

---
 tools/testing/selftests/futex/functional/run.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/futex/functional/run.sh +5 -1
index 81739849f299..f3e43eb806bf 100755
@@ -88,4 +88,8 @@ echo
 ./futex_priv_hash -g $COLOR
 
 echo
-./futex_numa_mpol $COLOR
+if [ -x ./futex_numa_mpol ]; then
+    ./futex_numa_mpol $COLOR
+else
+    echo "SKIP: futex_numa_mpol (not built)"
+fi
Signature · 1 line
2.51.0.355.g5224444f11-goog
reviewer Reviewed-by on v1 1/1
#1 lore raw

Em 08/09/2025 08:37, Wake Liu escreveu:

Quoted 4 lines

The futex_numa_mpol test requires libnuma, which is not available on all platforms. When the test is not built, the run.sh script fails because it unconditionally tries to execute the test binary.

Quoted 8 lines

Check for the futex_numa_mpol executable before running it. If the binary is not present, print a skip message and continue.

This allows the test suite to run successfully on platforms that do not have libnuma and therefore do not build the futex_numa_mpol test.

#2 lore raw
In reply to Wake Liu
Quoted 10 lines · Wake Liu

The futex_numa_mpol test requires libnuma, which is not available on all platforms. When the test is not built, the run.sh script fails because it unconditionally tries to execute the test binary.

Check for the futex_numa_mpol executable before running it. If the binary is not present, print a skip message and continue.

This allows the test suite to run successfully on platforms that do not have libnuma and therefore do not build the futex_numa_mpol test.

If you skip the test, how to you compile this?
Does

	https://lore.kernel.org/all/[email protected]/

help?

Quoted 10 lines
---
 tools/testing/selftests/futex/functional/run.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/futex/functional/run.sh +0 -0
index 81739849f299..f3e43eb806bf 100755

tools/testing/selftests/futex/functional/run.sh echo · line 95

Quoted 9 lines
tools/testing/selftests/futex/functional/run.sh +5 -1
@@ -88,4 +88,8 @@ echo
 ./futex_priv_hash -g $COLOR
 
 echo
-./futex_numa_mpol $COLOR
+if [ -x ./futex_numa_mpol ]; then
+    ./futex_numa_mpol $COLOR
+else
+    echo "SKIP: futex_numa_mpol (not built)"
+fi

Sebastian