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

Commit 92a9c785 authored by Nikita Ioffe's avatar Nikita Ioffe
Browse files

Revert "libbinder: binderRpcTest on host"

Revert submission 1658450

Reason for revert: b/184211379
Reverted Changes:
Ie04465ceb:libbinder: binderRpcTest on host
I29bbbd274:libbinder: vsock support for RPC

Change-Id: Ia29037441c920d32ce21c44104e0af95401c4e38
parent 5c94c2b0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ cc_test {
    ],
    test_suites: ["general-tests"],
    require_root: true,
    host_supported: true,
}

cc_test {
+2 −24
Original line number Diff line number Diff line
@@ -30,10 +30,7 @@
#include <iostream>
#include <thread>

#ifdef __BIONIC__
#include <linux/vm_sockets.h>
#endif //__BIONIC__

#include <sys/prctl.h>
#include <unistd.h>

@@ -189,13 +186,8 @@ private:

static std::string allocateSocketAddress() {
    static size_t id = 0;
    static bool gUseTmp = access("/tmp/", F_OK) != -1;

    if (gUseTmp) {
        return "/tmp/binderRpcTest_" + std::to_string(id++);
    } else {
    return "/dev/binderRpcTest_" + std::to_string(id++);
    }
};

struct ProcessConnection {
@@ -249,18 +241,14 @@ struct BinderRpcTestProcessConnection {

enum class SocketType {
    UNIX,
#ifdef __BIONIC__
    VSOCK,
#endif // __BIONIC__
};
static inline std::string PrintSocketType(const testing::TestParamInfo<SocketType>& info) {
    switch (info.param) {
        case SocketType::UNIX:
            return "unix_domain_socket";
#ifdef __BIONIC__
        case SocketType::VSOCK:
            return "vm_socket";
#endif // __BIONIC__
        default:
            LOG_ALWAYS_FATAL("Unknown socket type");
            return "";
@@ -295,11 +283,9 @@ public:
                        case SocketType::UNIX:
                            CHECK(connection->setupUnixDomainServer(addr.c_str())) << addr;
                            break;
#ifdef __BIONIC__
                        case SocketType::VSOCK:
                            CHECK(connection->setupVsockServer(port));
                            break;
#endif // __BIONIC__
                        default:
                            LOG_ALWAYS_FATAL("Unknown socket type");
                    }
@@ -325,11 +311,9 @@ public:
                    case SocketType::UNIX:
                        if (ret.connection->addUnixDomainClient(addr.c_str())) goto success;
                        break;
#ifdef __BIONIC__
                    case SocketType::VSOCK:
                        if (ret.connection->addVsockClient(VMADDR_CID_LOCAL, port)) goto success;
                        break;
#endif // __BIONIC__
                    default:
                        LOG_ALWAYS_FATAL("Unknown socket type");
                }
@@ -807,13 +791,7 @@ TEST_P(BinderRpc, Fds) {
}

INSTANTIATE_TEST_CASE_P(PerSocket, BinderRpc,
                        ::testing::Values(SocketType::UNIX
#ifdef __BIONIC__
                                          ,
                                          SocketType::VSOCK
#endif // __BIONIC__
                                          ),
                        PrintSocketType);
                        ::testing::Values(SocketType::UNIX, SocketType::VSOCK), PrintSocketType);

} // namespace android