Merge "Test mts against last stable api level" am: a59a146b36 am: 9015e276aa

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1686012

Change-Id: I34e9a66e7d603fe71c5ee1591787344e245b70ac
This commit is contained in:
Mark Chien
2021-05-14 10:03:22 +00:00
committed by Automerger Merge Worker
6 changed files with 72 additions and 16 deletions

View File

@@ -23,6 +23,7 @@ java_defaults {
"src/**/*.java", "src/**/*.java",
"src/**/*.kt", "src/**/*.kt",
], ],
min_sdk_version: "30",
static_libs: [ static_libs: [
"NetworkStackApiStableLib", "NetworkStackApiStableLib",
"androidx.test.rules", "androidx.test.rules",
@@ -44,12 +45,24 @@ java_defaults {
} }
android_library { android_library {
name: "TetheringIntegrationTestsLib", name: "TetheringIntegrationTestsLatestSdkLib",
target_sdk_version: "30",
platform_apis: true, platform_apis: true,
defaults: ["TetheringIntegrationTestsDefaults"], defaults: ["TetheringIntegrationTestsDefaults"],
visibility: [ visibility: [
"//cts/tests/tests/tethering",
"//packages/modules/Connectivity/tests/cts/tethering", "//packages/modules/Connectivity/tests/cts/tethering",
"//packages/modules/Connectivity/Tethering/tests/mts",
]
}
android_library {
name: "TetheringIntegrationTestsLib",
target_sdk_version: "current",
platform_apis: true,
defaults: ["TetheringIntegrationTestsDefaults"],
visibility: [
"//packages/modules/Connectivity/tests/cts/tethering",
"//packages/modules/Connectivity/Tethering/tests/mts",
] ]
} }
@@ -70,6 +83,8 @@ android_test {
android_test { android_test {
name: "TetheringCoverageTests", name: "TetheringCoverageTests",
platform_apis: true, platform_apis: true,
min_sdk_version: "30",
target_sdk_version: "30",
test_suites: ["device-tests", "mts"], test_suites: ["device-tests", "mts"],
test_config: "AndroidTest_Coverage.xml", test_config: "AndroidTest_Coverage.xml",
defaults: ["libnetworkstackutilsjni_deps"], defaults: ["libnetworkstackutilsjni_deps"],
@@ -78,8 +93,8 @@ android_test {
"NetdStaticLibTestsLib", "NetdStaticLibTestsLib",
"NetworkStaticLibTestsLib", "NetworkStaticLibTestsLib",
"NetworkStackTestsLib", "NetworkStackTestsLib",
"TetheringTestsLib", "TetheringTestsLatestSdkLib",
"TetheringIntegrationTestsLib", "TetheringIntegrationTestsLatestSdkLib",
], ],
jni_libs: [ jni_libs: [
// For mockito extended // For mockito extended

View File

@@ -19,7 +19,10 @@ package {
android_test { android_test {
// This tests for functionality that is not required for devices that // This tests for functionality that is not required for devices that
// don't use Tethering mainline module. // don't use Tethering mainline module.
name: "MtsTetheringTest", name: "MtsTetheringTestLatestSdk",
min_sdk_version: "30",
target_sdk_version: "30",
libs: [ libs: [
"android.test.base", "android.test.base",

View File

@@ -24,7 +24,7 @@
<option name="config-descriptor:metadata" key="parameter" value="secondary_user" /> <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" /> <option name="cleanup-apks" value="true" />
<option name="test-file-name" value="MtsTetheringTest.apk" /> <option name="test-file-name" value="MtsTetheringTestLatestSdk.apk" />
</target_preparer> </target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest" > <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="android.tethering.mts" /> <option name="package" value="android.tethering.mts" />

View File

@@ -36,13 +36,13 @@ java_library {
"framework-tethering.impl", "framework-tethering.impl",
], ],
visibility: [ visibility: [
"//cts/tests/tests/tethering",
"//packages/modules/Connectivity/tests/cts/tethering", "//packages/modules/Connectivity/tests/cts/tethering",
], ],
} }
java_defaults { java_defaults {
name: "TetheringTestsDefaults", name: "TetheringTestsDefaults",
min_sdk_version: "30",
srcs: [ srcs: [
"src/**/*.java", "src/**/*.java",
"src/**/*.kt", "src/**/*.kt",
@@ -81,10 +81,10 @@ java_defaults {
// unit test code. It is not currently used by the tests themselves because all the build // unit test code. It is not currently used by the tests themselves because all the build
// configuration needed by the tests is in the TetheringTestsDefaults rule. // configuration needed by the tests is in the TetheringTestsDefaults rule.
android_library { android_library {
name: "TetheringTestsLib", name: "TetheringTestsLatestSdkLib",
defaults: ["TetheringTestsDefaults"], defaults: ["TetheringTestsDefaults"],
target_sdk_version: "30",
visibility: [ visibility: [
"//frameworks/base/packages/Tethering/tests/integration",
"//packages/modules/Connectivity/Tethering/tests/integration", "//packages/modules/Connectivity/Tethering/tests/integration",
] ]
} }

View File

@@ -16,8 +16,8 @@ package {
default_applicable_licenses: ["Android-Apache-2.0"], default_applicable_licenses: ["Android-Apache-2.0"],
} }
android_test { java_defaults {
name: "CtsTetheringTest", name: "CtsTetheringTestDefaults",
defaults: ["cts_defaults"], defaults: ["cts_defaults"],
libs: [ libs: [
@@ -30,7 +30,6 @@ android_test {
static_libs: [ static_libs: [
"TetheringCommonTests", "TetheringCommonTests",
"TetheringIntegrationTestsLib",
"compatibility-device-util-axt", "compatibility-device-util-axt",
"cts-net-utils", "cts-net-utils",
"net-tests-utils", "net-tests-utils",
@@ -47,14 +46,53 @@ android_test {
// Change to system current when TetheringManager move to bootclass path. // Change to system current when TetheringManager move to bootclass path.
platform_apis: true, platform_apis: true,
}
// Tethering CTS tests that target the latest released SDK. These tests can be installed on release
// devices which has equal or lowner sdk version than target sdk and are useful for qualifying
// mainline modules on release devices.
android_test {
name: "CtsTetheringTestLatestSdk",
defaults: ["CtsTetheringTestDefaults"],
min_sdk_version: "30",
target_sdk_version: "30",
static_libs: [
"TetheringIntegrationTestsLatestSdkLib",
],
test_suites: [
"general-tests",
"mts-tethering",
],
test_config_template: "AndroidTestTemplate.xml",
// Include both the 32 and 64 bit versions
compile_multilib: "both",
}
// Tethering 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: "CtsTetheringTest",
defaults: ["CtsTetheringTestDefaults"],
static_libs: [
"TetheringIntegrationTestsLib",
],
// Tag this module as a cts test artifact // Tag this module as a cts test artifact
test_suites: [ test_suites: [
"cts", "cts",
"general-tests", "general-tests",
"mts-tethering",
], ],
test_config_template: "AndroidTestTemplate.xml",
// Include both the 32 and 64 bit versions // Include both the 32 and 64 bit versions
compile_multilib: "both", compile_multilib: "both",
} }

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 The Android Open Source Project <!-- Copyright (C) 2021 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<configuration description="Config for CTS Tethering test cases"> <configuration description="Config for {MODULE}">
<option name="test-suite-tag" value="cts" /> <option name="test-suite-tag" value="cts" />
<option name="config-descriptor:metadata" key="component" value="networking" /> <option name="config-descriptor:metadata" key="component" value="networking" />
<option name="config-descriptor:metadata" key="token" value="SIM_CARD" /> <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
@@ -23,7 +23,7 @@
<option name="not-shardable" value="true" /> <option name="not-shardable" value="true" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" /> <option name="cleanup-apks" value="true" />
<option name="test-file-name" value="CtsTetheringTest.apk" /> <option name="test-file-name" value="{MODULE}.apk" />
</target_preparer> </target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest" > <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="android.tethering.cts" /> <option name="package" value="android.tethering.cts" />