Create CtsNetTestCasesMaxTargetSdk31.
This APK will only run tests that require target SDK 31 or below. Bug: 233553525 Test: test-only change Change-Id: Ia86187de50107748d8053194d3f7a55b7947412e
This commit is contained in:
23
TEST_MAPPING
23
TEST_MAPPING
@@ -34,6 +34,18 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// CTS tests that target older SDKs.
|
||||||
|
{
|
||||||
|
"name": "CtsNetTestCasesMaxTargetSdk31",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"exclude-annotation": "com.android.testutils.SkipPresubmit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"exclude-annotation": "androidx.test.filters.RequiresDevice"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "bpf_existence_test"
|
"name": "bpf_existence_test"
|
||||||
},
|
},
|
||||||
@@ -90,6 +102,17 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "CtsNetTestCasesMaxTargetSdk31[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"exclude-annotation": "com.android.testutils.SkipPresubmit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"exclude-annotation": "androidx.test.filters.RequiresDevice"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "bpf_existence_test[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]"
|
"name": "bpf_existence_test[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ java_defaults {
|
|||||||
// sdk_version: "current",
|
// sdk_version: "current",
|
||||||
platform_apis: true,
|
platform_apis: true,
|
||||||
required: ["ConnectivityChecker"],
|
required: ["ConnectivityChecker"],
|
||||||
|
test_config_template: "AndroidTestTemplate.xml",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Networking CTS tests for development and release. These tests always target the platform SDK
|
// Networking CTS tests for development and release. These tests always target the platform SDK
|
||||||
@@ -79,7 +80,16 @@ android_test {
|
|||||||
"cts",
|
"cts",
|
||||||
"general-tests",
|
"general-tests",
|
||||||
],
|
],
|
||||||
test_config_template: "AndroidTestTemplate.xml",
|
}
|
||||||
|
|
||||||
|
java_defaults {
|
||||||
|
name: "CtsNetTestCasesApiStableDefaults",
|
||||||
|
// TODO: CTS should not depend on the entirety of the networkstack code.
|
||||||
|
static_libs: [
|
||||||
|
"NetworkStackApiStableLib",
|
||||||
|
],
|
||||||
|
jni_uses_sdk_apis: true,
|
||||||
|
min_sdk_version: "29",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Networking CTS tests that target the latest released SDK. These tests can be installed on release
|
// Networking CTS tests that target the latest released SDK. These tests can be installed on release
|
||||||
@@ -87,13 +97,10 @@ android_test {
|
|||||||
// on release devices.
|
// on release devices.
|
||||||
android_test {
|
android_test {
|
||||||
name: "CtsNetTestCasesLatestSdk",
|
name: "CtsNetTestCasesLatestSdk",
|
||||||
defaults: ["CtsNetTestCasesDefaults"],
|
defaults: [
|
||||||
// TODO: CTS should not depend on the entirety of the networkstack code.
|
"CtsNetTestCasesDefaults",
|
||||||
static_libs: [
|
"CtsNetTestCasesApiStableDefaults",
|
||||||
"NetworkStackApiStableLib",
|
|
||||||
],
|
],
|
||||||
jni_uses_sdk_apis: true,
|
|
||||||
min_sdk_version: "29",
|
|
||||||
target_sdk_version: "33",
|
target_sdk_version: "33",
|
||||||
test_suites: [
|
test_suites: [
|
||||||
"general-tests",
|
"general-tests",
|
||||||
@@ -102,5 +109,21 @@ android_test {
|
|||||||
"mts-tethering",
|
"mts-tethering",
|
||||||
"mts-wifi",
|
"mts-wifi",
|
||||||
],
|
],
|
||||||
test_config_template: "AndroidTestTemplate.xml",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
android_test {
|
||||||
|
name: "CtsNetTestCasesMaxTargetSdk31", // Must match CtsNetTestCasesMaxTargetSdk31 annotation.
|
||||||
|
defaults: [
|
||||||
|
"CtsNetTestCasesDefaults",
|
||||||
|
"CtsNetTestCasesApiStableDefaults",
|
||||||
|
],
|
||||||
|
target_sdk_version: "31",
|
||||||
|
package_name: "android.net.cts.maxtargetsdk31", // CTS package names must be unique.
|
||||||
|
instrumentation_target_package: "android.net.cts.maxtargetsdk31",
|
||||||
|
test_suites: [
|
||||||
|
"cts",
|
||||||
|
"general-tests",
|
||||||
|
"mts-networking",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,21 @@
|
|||||||
<target_preparer class="com.android.testutils.DisableConfigSyncTargetPreparer">
|
<target_preparer class="com.android.testutils.DisableConfigSyncTargetPreparer">
|
||||||
</target_preparer>
|
</target_preparer>
|
||||||
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
|
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
|
||||||
<option name="package" value="android.net.cts" />
|
<option name="package" value="{PACKAGE}" />
|
||||||
<option name="runtime-hint" value="9m4s" />
|
<option name="runtime-hint" value="9m4s" />
|
||||||
<option name="hidden-api-checks" value="false" />
|
<option name="hidden-api-checks" value="false" />
|
||||||
<option name="isolated-storage" value="false" />
|
<option name="isolated-storage" value="false" />
|
||||||
|
<!-- Test filter that allows test APKs to select which tests they want to run by annotating
|
||||||
|
those tests with an annotation matching the name of the APK.
|
||||||
|
|
||||||
|
This allows us to maintain one AndroidTestTemplate.xml for all CtsNetTestCases*.apk,
|
||||||
|
and have CtsNetTestCases and CtsNetTestCasesLatestSdk run all tests, but have
|
||||||
|
CtsNetTestCasesMaxTargetSdk31 run only tests that require target SDK 31.
|
||||||
|
|
||||||
|
This relies on the fact that if the class specified in include-annotation exists, then
|
||||||
|
the runner will only run the tests annotated with that annotation, but if it does not,
|
||||||
|
the runner will run all the tests. -->
|
||||||
|
<option name="include-annotation" value="com.android.testutils.filters.{MODULE}" />
|
||||||
</test>
|
</test>
|
||||||
<!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
|
<!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
|
||||||
one of the Mainline modules below is present on the device used for testing. -->
|
one of the Mainline modules below is present on the device used for testing. -->
|
||||||
|
|||||||
Reference in New Issue
Block a user