diff options
| author | 2021-11-08 16:29:53 -0800 | |
|---|---|---|
| committer | 2021-11-08 16:47:36 -0800 | |
| commit | fe4b83f147d14d65aea41298eef124ffd2a01e70 (patch) | |
| tree | c6c09b7f271eecf067ec49d49cfa1af2eea94446 | |
| parent | 8347ab590004648816eb1101bf2b02993575319a (diff) | |
binder: skip BinderRpc.Java test on non-debuggable builds.
Test: TH
Fixes: 205512685
Change-Id: I1bedfbdf103faf139d54f9a4e6f28b70bcf3c9c9
| -rw-r--r-- | libs/binder/tests/binderRpcTest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp index 2011801f27..0d5112d29a 100644 --- a/libs/binder/tests/binderRpcTest.cpp +++ b/libs/binder/tests/binderRpcTest.cpp @@ -22,6 +22,7 @@ #include <aidl/IBinderRpcTest.h> #include <android-base/file.h> #include <android-base/logging.h> +#include <android-base/properties.h> #include <android/binder_auto_utils.h> #include <android/binder_libbinder.h> #include <binder/Binder.h> @@ -1422,7 +1423,17 @@ TEST(BinderRpc, Java) { auto socket = rpcServer->releaseServer(); auto keepAlive = sp<BBinder>::make(); - ASSERT_EQ(OK, binder->setRpcClientDebug(std::move(socket), keepAlive)); + auto setRpcClientDebugStatus = binder->setRpcClientDebug(std::move(socket), keepAlive); + + if (!android::base::GetBoolProperty("ro.debuggable", false)) { + ASSERT_EQ(INVALID_OPERATION, setRpcClientDebugStatus) + << "setRpcClientDebug should return INVALID_OPERATION on non-debuggable builds, " + "but get " + << statusToString(setRpcClientDebugStatus); + GTEST_SKIP(); + } + + ASSERT_EQ(OK, setRpcClientDebugStatus); auto rpcSession = RpcSession::make(); ASSERT_EQ(OK, rpcSession->setupInetClient("127.0.0.1", port)); |