1From 0e812469e09e2a9a26f47ffbf23a62b41d5db53f Mon Sep 17 00:00:00 2001 2From: Edward Liaw <edliaw@google.com> 3Date: Wed, 22 Jun 2022 00:37:08 +0000 4Subject: [PATCH] futex: disable futex_wait and futex_waitv 5 6Both tests depend on System V shared memory functions which is 7disallowed on Android. futex_waitv is implemented in 5.16 so it is 8currently not available on Android as well. 9 10Bug: 234151152 11Test: atest vts_linux_kselftest_x86_64:futex_functional_run.sh_x86_64#futex_functional_run.sh_x86_64 12Test: atest vts_linux_kselftest_x86_32:futex_functional_run.sh_x86_32#futex_functional_run.sh_x86_32 13Change-Id: Ia6a170bb1b69fdd5da5014d4727a0485ecbf82bb 14Signed-off-by: Edward Liaw <edliaw@google.com> 15--- 16 .../selftests/futex/functional/futex_wait.c | 2 -- 17 .../selftests/futex/functional/futex_waitv.c | 5 ----- 18 .../testing/selftests/futex/functional/run.sh | 20 +++++++++++-------- 19 3 files changed, 12 insertions(+), 15 deletions(-) 20 21diff --git a/tools/testing/selftests/futex/functional/futex_wait.c b/tools/testing/selftests/futex/functional/futex_wait.c 22index 9bf695431e7aa..685140d9b93d2 100644 23--- a/tools/testing/selftests/futex/functional/futex_wait.c 24+++ b/tools/testing/selftests/futex/functional/futex_wait.c 25@@ -96,8 +96,6 @@ int main(int argc, char *argv[]) 26 /* Testing an anon page shared memory */ 27 shm_id = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666); 28 if (shm_id < 0) { 29- if (errno == ENOSYS) 30- exit(KSFT_SKIP); 31 perror("shmget"); 32 exit(1); 33 } 34diff --git a/tools/testing/selftests/futex/functional/futex_waitv.c b/tools/testing/selftests/futex/functional/futex_waitv.c 35index aafc6a4f25b5d..a94337f677e18 100644 36--- a/tools/testing/selftests/futex/functional/futex_waitv.c 37+++ b/tools/testing/selftests/futex/functional/futex_waitv.c 38@@ -47,11 +47,6 @@ void *waiterfn(void *arg) 39 40 res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC); 41 if (res < 0) { 42- if (errno == ENOSYS) { 43- ksft_test_result_skip("futex_waitv syscall not available in this kernel\n"); 44- ksft_print_cnts(); 45- exit(KSFT_SKIP); 46- } 47 ksft_test_result_fail("futex_waitv returned: %d %s\n", 48 errno, strerror(errno)); 49 } else if (res != NR_FUTEXES - 1) { 50diff --git a/tools/testing/selftests/futex/functional/run.sh b/tools/testing/selftests/futex/functional/run.sh 51index 9b2dbb88c5f1e..8b9142ae4ba30 100755 52--- a/tools/testing/selftests/futex/functional/run.sh 53+++ b/tools/testing/selftests/futex/functional/run.sh 54@@ -20,12 +20,12 @@ 55 56 run_test() 57 { 58- $@ 59+ $@ 60 ret=$? 61- if [ $ret -ne 0 ] && [ $ret -ne 4 ]; then # KSFT_SKIP=4 62+ if [ $ret -ne 0 ] && [ $ret -ne 4 ]; then # KSFT_SKIP=4 63 echo "Failed with $ret" 64- rc=1 65- fi 66+ rc=1 67+ fi 68 } 69 70 # Test for a color capable console 71@@ -85,13 +85,17 @@ echo 72 run_test ./futex_wait_uninitialized_heap $COLOR 73 run_test ./futex_wait_private_mapped_file $COLOR 74 75-echo 76-run_test ./futex_wait $COLOR 77+# b/234151152 78+# Disable because system v shared memory not available 79+#echo 80+#run_test ./futex_wait $COLOR 81 82 echo 83 run_test ./futex_requeue $COLOR 84 85-echo 86-run_test ./futex_waitv $COLOR 87+# b/234151152 88+# Disable because system v shared memory not available 89+#echo 90+#run_test ./futex_waitv $COLOR 91 92 exit $rc 93-- 942.37.0.rc0.104.g0611611a94-goog 95 96