Add connectivity diagnostics on test failure
When CtsNetTestCases tests fail, or when a tryTest statement fails,
collect connectivity diagnostics and output them as a test artifact.
tryTest must be followed by cleanup blocks, which often change the
configuration, so having diagnostics when the tryTest fails in addition
to after the test failure is useful.
The collected diagnostics will be available as individual test
artifacts. They should make it easier to investigate test failures, and
could be collected across test runs in an automated way.
Output files are currently limited at 20 per run, to avoid collecting
too much data in case everything is failing in the run.
Test: atest
Change-Id: Iaa48e519028dc61c03d387beeade7d41fca2ef48
diff --git a/staticlibs/testutils/Android.bp b/staticlibs/testutils/Android.bp
index 8c71a91..13e1dc0 100644
--- a/staticlibs/testutils/Android.bp
+++ b/staticlibs/testutils/Android.bp
@@ -33,6 +33,7 @@
],
static_libs: [
"androidx.test.ext.junit",
+ "collector-device-lib",
"kotlin-reflect",
"libnanohttpd",
"net-tests-utils-host-device-common",