From 11ecc75bc2c0a1402577832cc042788ce95ffae4 Mon Sep 17 00:00:00 2001 From: Wake Liu Date: Wed, 5 Nov 2025 11:34:46 +0800 Subject: [PATCH] ANDROID: Add net kselftests to VTS Add the following net kselftests to VTS for all architectures: - socket - psock_tpacket - reuseport_dualstack - reuseaddr_conflict The tests are added to the `vts_kselftest_tests` filegroup in BUILD.bazel and the corresponding VTS config files. Bug: 416599813 Change-Id: I75b63586720d6644d5dcae5605c4ad1344cb2980 Signed-off-by: Wake Liu --- BUILD.bazel | 77 +++++++++++++++++++ .../selftests/android/vts_config_arm.xml | 4 + .../selftests/android/vts_config_arm64.xml | 4 + .../selftests/android/vts_config_x86.xml | 4 + .../selftests/android/vts_config_x86_64.xml | 4 + 5 files changed, 93 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index ae6a34ee54fd..19165bc3a1c0 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1705,6 +1705,59 @@ cc_binary_with_abi( deps = [":kselftest_headers_lib"], ) +cc_binary_with_abi( + name = "kselftest_net_tests_socket", + srcs = ["tools/testing/selftests/net/socket.c"], + copts = _KSELFTEST_COPTS, + path_prefix = _KSELFTEST_DIR, + target_compatible_with = ["@platforms//os:android"], + visibility = ["//visibility:private"], + deps = [":kselftest_headers_lib"], +) + +cc_binary_with_abi( + name = "kselftest_net_tests_psock_tpacket", + srcs = ["tools/testing/selftests/net/psock_tpacket.c"], + copts = _KSELFTEST_COPTS, + path_prefix = _KSELFTEST_DIR, + target_compatible_with = ["@platforms//os:android"], + visibility = ["//visibility:private"], + deps = [ + ":kselftest_headers_lib", + ":kselftest_psock_lib", + ], +) + +cc_library( + name = "kselftest_psock_lib", + hdrs = ["tools/testing/selftests/net/psock_lib.h"], + includes = [ + "tools/testing/selftests", + "tools/testing/selftests/net", + ], + visibility = ["//visibility:private"], +) + +cc_binary_with_abi( + name = "kselftest_net_tests_reuseport_dualstack", + srcs = ["tools/testing/selftests/net/reuseport_dualstack.c"], + copts = _KSELFTEST_COPTS, + path_prefix = _KSELFTEST_DIR, + target_compatible_with = ["@platforms//os:android"], + visibility = ["//visibility:private"], + deps = [":kselftest_headers_lib"], +) + +cc_binary_with_abi( + name = "kselftest_net_tests_reuseaddr_conflict", + srcs = ["tools/testing/selftests/net/reuseaddr_conflict.c"], + copts = _KSELFTEST_COPTS, + path_prefix = _KSELFTEST_DIR, + target_compatible_with = ["@platforms//os:android"], + visibility = ["//visibility:private"], + deps = [":kselftest_headers_lib"], +) + cc_binary_with_abi( name = "kselftest_ptrace_peeksiginfo", srcs = ["tools/testing/selftests/ptrace/peeksiginfo.c"], @@ -2810,6 +2863,12 @@ pkg_filegroup( ":kselftest_futex_futex_wait_wouldblock_x86_64", ":kselftest_futex_futex_wait_x86_64", ":kselftest_kcmp_kcmp_test_x86_64", + # ":kselftest_net_tests_bpf_x86_64", # Disabled due to test failures + # ":kselftest_net_tests_psock_fanout_x86_64", # Disabled due to test failures + ":kselftest_net_tests_psock_tpacket_x86_64", + ":kselftest_net_tests_reuseaddr_conflict_x86_64", + ":kselftest_net_tests_reuseport_dualstack_x86_64", + ":kselftest_net_tests_socket_x86_64", ], visibility = ["//visibility:private"], ) @@ -2898,6 +2957,12 @@ pkg_filegroup( ":kselftest_futex_futex_wait_wouldblock_x86", ":kselftest_futex_futex_wait_x86", ":kselftest_kcmp_kcmp_test_x86", + # ":kselftest_net_tests_bpf_x86", Disabled due to test failures + # ":kselftest_net_tests_psock_fanout_x86", Disabled due to test failures + ":kselftest_net_tests_psock_tpacket_x86", + ":kselftest_net_tests_reuseaddr_conflict_x86", + ":kselftest_net_tests_reuseport_dualstack_x86", + ":kselftest_net_tests_socket_x86", ], visibility = ["//visibility:private"], ) @@ -2979,6 +3044,12 @@ pkg_filegroup( ":kselftest_futex_futex_wait_uninitialized_heap_arm", ":kselftest_futex_futex_wait_wouldblock_arm", ":kselftest_kcmp_kcmp_test_arm", + # ":kselftest_net_tests_bpf_arm", Disabled due to test failures + # ":kselftest_net_tests_psock_fanout_arm", Disabled due to test failures + ":kselftest_net_tests_psock_tpacket_arm", + ":kselftest_net_tests_reuseaddr_conflict_arm", + ":kselftest_net_tests_reuseport_dualstack_arm", + ":kselftest_net_tests_socket_arm", ], visibility = ["//visibility:private"], ) @@ -3062,6 +3133,12 @@ pkg_filegroup( ":kselftest_futex_futex_wait_uninitialized_heap_arm64", ":kselftest_futex_futex_wait_wouldblock_arm64", ":kselftest_kcmp_kcmp_test_arm64", + # ":kselftest_net_tests_bpf_arm64", Disabled due to test failures + # ":kselftest_net_tests_psock_fanout_arm64", Disabled due to test failures + ":kselftest_net_tests_psock_tpacket_arm64", + ":kselftest_net_tests_reuseaddr_conflict_arm64", + ":kselftest_net_tests_reuseport_dualstack_arm64", + ":kselftest_net_tests_socket_arm64", ], visibility = ["//visibility:private"], ) diff --git a/tools/testing/selftests/android/vts_config_arm.xml b/tools/testing/selftests/android/vts_config_arm.xml index a8ca38b939f5..b033c67fd89e 100644 --- a/tools/testing/selftests/android/vts_config_arm.xml +++ b/tools/testing/selftests/android/vts_config_arm.xml @@ -38,5 +38,9 @@ SPDX-License-Identifier: GPL-2.0 OR Apache-2.0