Merge "liblog: test: enoent requires userdebug or eng to run" am: c408e77095 am: 6c919e72f7 am: f22c0f8026
am: 8ee6072400
Change-Id: Ic2beaaf3e2f07a52c3308bcba1191a6648cde25c
diff --git a/liblog/tests/liblog_test.cpp b/liblog/tests/liblog_test.cpp
index ec32da0..71f74ab 100644
--- a/liblog/tests/liblog_test.cpp
+++ b/liblog/tests/liblog_test.cpp
@@ -36,6 +36,7 @@
#endif
#include <gtest/gtest.h>
#include <log/log_event_list.h>
+#include <log/log_properties.h>
#include <log/log_transport.h>
#include <log/logprint.h>
#include <private/android_filesystem_config.h>
@@ -1786,6 +1787,12 @@
stderr,
"WARNING: test conditions request being run as root and not AID=%d\n",
getuid());
+ if (!__android_log_is_debuggable()) {
+ fprintf(
+ stderr,
+ "WARNING: can not run test on a \"user\" build, bypassing test\n");
+ return;
+ }
}
system((getuid() == AID_ROOT) ? "stop logd" : "su 0 stop logd");