From a32d4555ebd9e1d94b16a9b23db34c6a5d0f5124 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Thu, 6 Feb 2020 22:37:07 +0900 Subject: [PATCH] Add a variant of CtsNetTestCases that targets the released SDK. This APK can be installed and run on release devices even when built from branches with a non-final SDK such as AOSP. Test: builds Change-Id: I1e1b24b09eeb7a0688fde9d8ed6bbee9c9d2582e --- tests/cts/net/Android.bp | 29 +++++++++++++++---- ...ndroidTest.xml => AndroidTestTemplate.xml} | 4 +-- 2 files changed, 26 insertions(+), 7 deletions(-) rename tests/cts/net/{AndroidTest.xml => AndroidTestTemplate.xml} (92%) diff --git a/tests/cts/net/Android.bp b/tests/cts/net/Android.bp index b00455d9ef..624d149776 100644 --- a/tests/cts/net/Android.bp +++ b/tests/cts/net/Android.bp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -android_test { - name: "CtsNetTestCases", +java_defaults { + name: "CtsNetTestCasesDefaults", defaults: ["cts_defaults"], // Include both the 32 and 64 bit versions @@ -32,7 +32,6 @@ android_test { "libnativehelper_compat_libc++", ], - // include CtsTestServer as a temporary hack to free net.cts from cts.stub. srcs: [ "src/**/*.java", "src/**/*.kt", @@ -54,13 +53,33 @@ android_test { // uncomment when b/13249961 is fixed // sdk_version: "current", platform_apis: true, +} - // Tag this module as a cts test artifact +// 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. +android_test { + name: "CtsNetTestCases", + defaults: ["CtsNetTestCasesDefaults"], test_suites: [ "cts", "vts", "general-tests", + ], + test_config_template: "AndroidTestTemplate.xml", +} + +// Networking CTS tests that have a min_sdk_version of the latest released SDK. These tests can +// be installed on release devices at any point in the release cycle and are useful for qualifying +// mainline modules on release devices. +android_test { + name: "CtsNetTestCasesLatestSdk", + defaults: ["CtsNetTestCasesDefaults"], + min_sdk_version: "29", + target_sdk_version: "29", + test_suites: [ "mts", ], - + test_config_template: "AndroidTestTemplate.xml", } diff --git a/tests/cts/net/AndroidTest.xml b/tests/cts/net/AndroidTestTemplate.xml similarity index 92% rename from tests/cts/net/AndroidTest.xml rename to tests/cts/net/AndroidTestTemplate.xml index 3ff019e386..1f75da1860 100644 --- a/tests/cts/net/AndroidTest.xml +++ b/tests/cts/net/AndroidTestTemplate.xml @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - +