From 4a01ecf7e06b8093dee363de13176706b44d457e Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Wed, 14 Feb 2024 13:58:12 +0900 Subject: [PATCH] Add CtsNetTestCases to MTS CtsNetTestCasesLatestSdk was originally used for MTS to prevent installation issues with CUR_DEVELOPMENT target SDK modules (as is the case for CtsNetTestCases) not installing on released devices. However setting the min_sdk to a given value should be enough for that purpose. While there may have been other blockers requiring separation of CtsNetTestCases and CtsNetTestCasesLatestSdk at the time (in the Q/R timeframe), more recent modules like CtsAdServicesDeviceTestCases seem to be using CUR_DEVELOPMENT target SDK in MTS just fine. Not specifying a target SDK means that the branch default will be used, depending on the release configuration. So for example trunk_staging would typically be CUR_DEVELOPMENT=10000, and "next" may use the SDK version of that release. This makes sense as a test suite targeting CUR_DEVELOPMENT is necessary to verify a development build, while a production "next" configuration should generally use the latest released SDK. But in any case, for CtsNetTestCases purposes, this would cause the exercised connectivity APIs to use their latest non-compatibility behavior, which is what tests expect. Considering this, add CtsNetTestCases to MTS, so that CtsNetTestCasesLatestSdk can be removed. This will allow having one test suite for both CTS and MTS, which in turns allows marking CtsNetTestCases as MCTS, so that the version of the test to run is autodetected based on installed modules. Note this change also removes the unnecessary "platform_api" statement and comment as this is already handled in framework-connectivity-test-defaults. Bug: 317913702 Test: m, aapt dump badging, verify (min)sdkVersion=30, targetSdk=10000 Change-Id: I2267e5c9219f059872928cc681547c3bd5fbc394 --- tests/cts/net/Android.bp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/cts/net/Android.bp b/tests/cts/net/Android.bp index 98d56306ca..074c5878b4 100644 --- a/tests/cts/net/Android.bp +++ b/tests/cts/net/Android.bp @@ -61,9 +61,7 @@ java_defaults { "TetheringIntegrationTestsBaseLib", ], - // uncomment when b/13249961 is fixed - // sdk_version: "current", - platform_apis: true, + min_sdk_version: "30", per_testcase_directory: true, host_required: ["net-tests-utils-host-common"], test_config_template: "AndroidTestTemplate.xml", @@ -75,8 +73,8 @@ java_defaults { // Networking CTS tests for development and release. These tests always target the platform SDK // version, and are subject to all the restrictions appropriate to that version. Before SDK -// finalization, these tests have a min_sdk_version of 10000, and cannot be installed on release -// devices. +// finalization, these tests have a min_sdk_version of 10000, but they can still be installed on +// release devices as their min_sdk_version is set to a production version. android_test { name: "CtsNetTestCases", defaults: [ @@ -89,6 +87,14 @@ android_test { ], test_suites: [ "cts", + "mts-dnsresolver", + "mts-networking", + "mts-tethering", + "mts-wifi", + "mcts-dnsresolver", + "mcts-networking", + "mcts-tethering", + "mcts-wifi", "general-tests", ], }