Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a298015 authored by Andrei Homescu's avatar Andrei Homescu
Browse files

libbinder: mix and match binderRpcTest client and services

For every combination of single/multi-threaded and
kernel/no-kernel binderRpcTest, run every possible client
combination against every combination of service.

To make this possible, we split the service code into 4
separate executables (one per combination) and have
the client code run each specific service using execl().

Bug: 224644083
Test: atest binderRpcTest
Change-Id: Ie95a70c241be7dcfefc51f56b8d9ed95a864b860
parent ec0d68e9
Loading
Loading
Loading
Loading
+100 −14
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ aidl_interface {
    unstable: true,
    srcs: [
        "BinderRpcTestClientInfo.aidl",
        "BinderRpcTestServerConfig.aidl",
        "BinderRpcTestServerInfo.aidl",
        "IBinderRpcCallback.aidl",
        "IBinderRpcSession.aidl",
@@ -185,42 +186,67 @@ cc_library_static {
}

cc_defaults {
    name: "binderRpcTest_defaults",
    name: "binderRpcTest_common_defaults",
    host_supported: true,
    target: {
        darwin: {
            enabled: false,
        },
        android: {
            test_suites: ["vts"],
        },
    },
    defaults: [
        "binder_test_defaults",
    ],

    srcs: [
        "binderRpcTest.cpp",
    ],

    static_libs: [
        "libbinder_tls_static",
        "libbinder_tls_test_utils",
        "binderRpcTestIface-cpp",
        "binderRpcTestIface-ndk",
    ],
}

    test_suites: ["general-tests"],
    require_root: true,
cc_defaults {
    name: "binderRpcTest_service_defaults",
    defaults: [
        "binderRpcTest_common_defaults",
    ],
    gtest: false,
    auto_gen_config: false,
    srcs: [
        "binderRpcTestCommon.cpp",
        "binderRpcTestService.cpp",
    ],
}

cc_test {
    name: "binderRpcTest",
cc_defaults {
    name: "binderRpcTest_defaults",
    target: {
        android: {
            test_suites: ["vts"],
        },
    },
    defaults: [
        "binderRpcTest_defaults",
        "libbinder_tls_shared_deps",
        "binderRpcTest_common_defaults",
    ],

    srcs: [
        "binderRpcTest.cpp",
        "binderRpcTestCommon.cpp",
    ],

    test_suites: ["general-tests"],
    require_root: true,

    data_bins: [
        "binder_rpc_test_service",
        "binder_rpc_test_service_no_kernel",
        "binder_rpc_test_service_single_threaded",
        "binder_rpc_test_service_single_threaded_no_kernel",
    ],
}

cc_defaults {
    name: "binderRpcTest_shared_defaults",
    cflags: [
        "-DBINDER_WITH_KERNEL_IPC",
    ],
@@ -257,6 +283,66 @@ cc_defaults {
    ],
}

cc_test {
    // The module name cannot start with "binderRpcTest" because
    // then atest tries to execute it as part of binderRpcTest
    name: "binder_rpc_test_service",
    defaults: [
        "binderRpcTest_service_defaults",
        "binderRpcTest_shared_defaults",
        "libbinder_tls_shared_deps",
    ],
}

cc_test {
    name: "binder_rpc_test_service_no_kernel",
    defaults: [
        "binderRpcTest_service_defaults",
        "binderRpcTest_static_defaults",
    ],
    static_libs: [
        "libbinder_rpc_no_kernel",
    ],
}

cc_test {
    name: "binder_rpc_test_service_single_threaded",
    defaults: [
        "binderRpcTest_service_defaults",
        "binderRpcTest_static_defaults",
    ],
    cflags: [
        "-DBINDER_RPC_SINGLE_THREADED",
        "-DBINDER_WITH_KERNEL_IPC",
    ],
    static_libs: [
        "libbinder_rpc_single_threaded",
    ],
}

cc_test {
    name: "binder_rpc_test_service_single_threaded_no_kernel",
    defaults: [
        "binderRpcTest_service_defaults",
        "binderRpcTest_static_defaults",
    ],
    cflags: [
        "-DBINDER_RPC_SINGLE_THREADED",
    ],
    static_libs: [
        "libbinder_rpc_single_threaded_no_kernel",
    ],
}

cc_test {
    name: "binderRpcTest",
    defaults: [
        "binderRpcTest_defaults",
        "binderRpcTest_shared_defaults",
        "libbinder_tls_shared_deps",
    ],
}

cc_test {
    name: "binderRpcTestNoKernel",
    defaults: [
+25 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

parcelable BinderRpcTestServerConfig {
    int numThreads;
    int[] serverSupportedFileDescriptorTransportModes;
    int socketType;
    int rpcSecurity;
    int serverVersion;
    int vsockPort;
    @utf8InCpp String addr;
}
Loading