Merge changes I5b3ca4f0,I610bed59

* changes:
  liblog: mark tests as require_root: true
  liblog: require root for multi_connect_dgram_socket test
This commit is contained in:
Tom Cherry 2020-04-30 23:38:31 +00:00 committed by Gerrit Code Review
commit c941236374
2 changed files with 5 additions and 0 deletions

View file

@ -72,6 +72,7 @@ cc_defaults {
],
static_libs: ["liblog"],
isolated: true,
require_root: true,
}
// Build tests for the device (with .so). Run with:

View file

@ -29,6 +29,10 @@ using android::base::unique_fd;
// socket. This tests for that behavior.
TEST(liblog, multi_connect_dgram_socket) {
#ifdef __ANDROID__
if (getuid() != 0) {
GTEST_SKIP() << "Skipping test, must be run as root.";
return;
}
auto temp_dir = TemporaryDir();
auto socket_path = StringPrintf("%s/test_socket", temp_dir.path);