When calculating the crash_sender spread time, make sure that the
random number is not negative when converted to a shell int variable.
Bug: 24004011
Change-Id: I3b95dc244a26270ef2b93d5af4b0593a93eedcad
This test case ensures that we can log a metric with the metrics library
and upload it with the upload service.
BUG: 22879646
TEST: unit tests.
Change-Id: Idf4a1240d41745ebf7835089230608082eed19f5
If the metrics server is unreachable, we may need to resend a metrics
report later. Instead of keeping the staged report in memory, save it to
disk to avoid loosing data if the system restarts or crashes.
BUG: 23033262
TEST: unit tests.
Change-Id: Idd14964e40f022952469f47d675d8cda9586d7cd
Instead of passing different filenames around, only rely on the metrics
directory and infer the filepath from it. This makes testing easier.
BUG: 23939404
TEST: unit tests.
Change-Id: I79086acc3a546464114fa8ec4656ec04e1c43e35
Read the crash server URL from the crash_reporter.server
property. If it is not set, return a configuration error.
Bug: 22874192
Change-Id: Iac341b6352fe9c1b54cd2e8561ed4a5bbe8ddddc
- Added grep to the list of required modules.
- Run crash_sender with the 'system' group to allow calls to
metrics_client to read both metrics files owned by system and
crash_reporter files owned by root.
- Fix periodic_scheduler's check delay to actually be 5 minutes.
Bug: 23122375
Change-Id: Iff214c4e591a676a516162a92ea5aedcf0824f46
Add to whitelist.
For some reason, when compiling, parseint_test.cpp would encounter
errors like the following:
host cross C++: host_cross_libbase_test <= system/core/base/parseint_test.cpp
In file included from external/gtest/include/gtest/gtest.h:1929:0,
from system/core/base/parseint_test.cpp:19:
system/core/base/parseint_test.cpp: In member function ‘virtual void parseint_signed_smoke_Test::TestBody()’:
external/gtest/include/gtest/internal/gtest-internal.h:133:55: error: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Werror=conversion-null]
(sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
^
external/gtest/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro ‘GTEST_ASSERT_’
if (const ::testing::AssertionResult gtest_ar = (expression)) \
^
external/gtest/include/gtest/gtest_pred_impl.h:166:3: note: in expansion of macro ‘GTEST_PRED_FORMAT2_’
GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
^
external/gtest/include/gtest/gtest.h:1993:3: note: in expansion of macro ‘ASSERT_PRED_FORMAT2’
ASSERT_PRED_FORMAT2(::testing::internal:: \
^
external/gtest/include/gtest/gtest.h:1994:32: note: in expansion of macro ‘GTEST_IS_NULL_LITERAL_’
EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
^
external/gtest/include/gtest/gtest.h:2011:32: note: in expansion of macro ‘GTEST_ASSERT_EQ’
# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
^
system/core/base/parseint_test.cpp:23:3: note: in expansion of macro ‘ASSERT_EQ’
ASSERT_EQ(false, android::base::ParseInt("x", &i));
^
For whatever reason, the gcc for Windows isn't handling the template
metaprogramming correctly, so to work-around the issue, I
search-and-replaced "ASSERT_EQ(false, " to "ASSERT_FALSE(" and
"ASSERT_EQ(true, " to "ASSERT_TRUE(" and that seems to compile just fine
for Linux and Windows (and the tests pass on both platforms).
Change-Id: I05132909d1f4b18afff23139652a218649689f2d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Adds missing #ifdef guards to shell_service_protocol_test.cpp so the
test compiles on Windows.
Also fixes a bug in Windows socketpair write implementation. Previously
it was only checking for a closed pipe if the write happened to block.
This adds an additional pre-check to exit immediately on a closed pipe.
These two changes allow the test to compile and pass on Windows.
Change-Id: Ib8853ed72f015fc0d623da47c32982cb3ffa4a3d
adb_getenv() should be case-insensitive just like the real getenv() on
Windows.
Added a unittest for adb_getenv(). In the process, made adb_test link
with -municode so that the environment block is Unicode.
Move wmain() from main.cpp to sysdeps_win32.cpp so that adb_test could
also use it.
Because wmain() moved, it wasn't as easy to do the runtime check to
verify that -municode was used, so do that check in _ensure_env_setup()
since adb_getenv() is called early in adb anyway.
Added a utility ToLower() which is good enough for env vars whose keys
are probably always ASCII to begin with.
Change-Id: I082f7fdee9dfe2c7f76b878528d2f7863df6d8d1
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
adb/Android.mk: adb_test should build on Windows (and Darwin), so add to
the whitelist.
Change-Id: I778f6a7dff4caec92c48e0957591abf32f86ab1b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Adds the shell protocol functionality to the client side and enables it
if the transport supports the feature.
Bug:http://b/23031026
Change-Id: I9abe1c8b1d39f8dd09666321b1c761ad708a8854
Adds functionality for handling stdin/stdout/stderr streams and exit
codes using the shell protocol.
This CL just contains implementation for adbd which will not yet be
enabled. Once we have the ability to query transport features from the
adb client, another CL will add the implementation for the client side
and update the feature list to turn this on.
Note: this CL must be submitted together with a minadbd CL to update
the service_to_fd() function signature.
Bug: http://b/23030641
Change-Id: Ibed55e9c1946d8a35190696163ff63e8fb880238
Instead of falling back to suffix _a, we now error out if neither the
kernel commandline nor the misc partition specifies the suffix. It's
cleaner this way.
Change-Id: I3f58928a664433504ebdf8d0ee05a319be5097cf
A regression that resulted in increased memory consumption for some
logging patterns because we rarely did merge or leading checks, and
age-out checking. On the last prune cycle, we reset for a full scan.
Add some comments describing the pruning processes.
Bug: 23327476
Bug: 23681639
Bug: 23685592
Change-Id: I22b0f339c9269b006831fda9cefe295a263ebb92
- Remove all the ChromeOS specific logic.
- Fix paths to correct Android paths.
- Add periodic_scheduler, and add crash_sender to init.
Bug: 23231196
Bug: 23233267
Change-Id: I12de28bfbe5d5b08831eda9b28c6d7a669c22290
The format of the metrics dump is rudimentary just yet. Here is an example:
Metrics from /data/misc/metrics/uma-events
name: hello type: USER_ACTION
name: world type: USER_ACTION
This required the following changes:
* Added -d option to metrics_client
* Refactored file handling in SerializationUtils
- Factored out file opening and log parsing into helper methods
- Added ReadMetricsFromFile which is read-only so does not truncate the file
Change-Id: I6032d74242c79c678ec42a14e78fccc54e7af455
Add a library that wraps libbinder to make it possible to
write tests for native code that communicates via binder.
Bug: 23791723
Change-Id: I3c842413e0f07dc252040c042d664031b0354353