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
diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp
index 2a3658e..a44cddf 100644
--- a/libs/binder/tests/Android.bp
+++ b/libs/binder/tests/Android.bp
@@ -122,7 +122,6 @@
],
test_suites: ["general-tests"],
require_root: true,
- host_supported: true,
}
cc_test {
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 936ee5e..985a301 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -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 @@
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++);
- }
+ return "/dev/binderRpcTest_" + std::to_string(id++);
};
struct ProcessConnection {
@@ -249,18 +241,14 @@
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 @@
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 @@
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 @@
}
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