From 9c358cd8314ba20e06969d58fb3fd6c3aa9bc012 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Mon, 4 Oct 2021 19:50:32 +0900 Subject: [PATCH] Use ConnectivityCheckTargetPreparer in CTS The preparer does basic checks for device configuration before any test is run, so that wrong device configuration can be identified at the module level, rather than fail individual test cases. If test devices are not properly configured with a wifi configuration and data-enabled SIM cards, the run will fail before starting the test module. As the preparer uses much of CtsNetUtils code for connecting to wifi, refactor that code out of CtsNetUtils. Test: atest CtsNetCasesLatestSdk Change-Id: I1214b6d6916e836bcd68d15c50486092c7fb9a6e --- tests/cts/net/Android.bp | 1 + tests/cts/net/AndroidTestTemplate.xml | 2 + .../android/net/cts/util/CtsNetUtils.java | 175 +----------------- 3 files changed, 8 insertions(+), 170 deletions(-) diff --git a/tests/cts/net/Android.bp b/tests/cts/net/Android.bp index 85942b0a5a..1872327f22 100644 --- a/tests/cts/net/Android.bp +++ b/tests/cts/net/Android.bp @@ -60,6 +60,7 @@ java_defaults { // uncomment when b/13249961 is fixed // sdk_version: "current", platform_apis: true, + required: ["ConnectivityChecker"], } // Networking CTS tests for development and release. These tests always target the platform SDK diff --git a/tests/cts/net/AndroidTestTemplate.xml b/tests/cts/net/AndroidTestTemplate.xml index 78a01e29c1..d761c2710c 100644 --- a/tests/cts/net/AndroidTestTemplate.xml +++ b/tests/cts/net/AndroidTestTemplate.xml @@ -26,6 +26,8 @@