diff --git a/TEST_MAPPING b/TEST_MAPPING index 302c0b363d..1b2c0ed58c 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -32,6 +32,9 @@ }, { "name": "libnetworkstats_test" + }, + { + "name": "FrameworksNetIntegrationTests" } ], "postsubmit": [ @@ -55,6 +58,9 @@ }, { "name": "libnetworkstats_test" + }, + { + "name": "FrameworksNetDeflakeTest" } ], "mainline-presubmit": [ @@ -88,6 +94,35 @@ "name": "CtsNetTestCasesLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]", "keywords": ["sim"] }, + // TODO: move to mainline-presubmit when known green. + // Test with APK modules only, in cases where APEX is not supported, or the other modules were simply not updated + { + "name": "CtsNetTestCasesLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk]", + "options": [ + { + "exclude-annotation": "com.android.testutils.SkipPresubmit" + }, + { + "exclude-annotation": "androidx.test.filters.RequiresDevice" + }, + { + "exclude-annotation": "com.android.testutils.ConnectivityModuleTest" + } + ] + }, + // TODO: move to mainline-presubmit when known green. + // Test with connectivity/tethering module only, to catch integration issues with older versions of other modules + { + "name": "CtsNetTestCasesLatestSdk[com.google.android.tethering.apex]", + "options": [ + { + "exclude-annotation": "com.android.testutils.SkipPresubmit" + }, + { + "exclude-annotation": "androidx.test.filters.RequiresDevice" + } + ] + }, { "name": "TetheringCoverageTests[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]" }, @@ -96,6 +131,23 @@ "name": "bpf_existence_test[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]" } ], + "auto-postsubmit": [ + // Test tag for automotive targets. These are only running in postsubmit so as to harden the + // automotive targets to avoid introducing additional test flake and build time. The plan for + // presubmit testing for auto is to augment the existing tests to cover auto use cases as well. + // Additionally, this tag is used in targeted test suites to limit resource usage on the test + // infra during the hardening phase. + // TODO: this tag to be removed once the above is no longer an issue. + { + "name": "FrameworksNetTests" + }, + { + "name": "FrameworksNetIntegrationTests" + }, + { + "name": "FrameworksNetDeflakeTest" + } + ], "imports": [ { "path": "frameworks/base/core/java/android/net" @@ -109,9 +161,6 @@ { "path": "packages/modules/CaptivePortalLogin" }, - { - "path": "packages/modules/Connectivity" - }, { "path": "packages/modules/Connectivity/Tethering" } diff --git a/tests/TEST_MAPPING b/tests/TEST_MAPPING deleted file mode 100644 index 502f885ceb..0000000000 --- a/tests/TEST_MAPPING +++ /dev/null @@ -1,34 +0,0 @@ -{ - "presubmit": [ - { - "name": "FrameworksNetIntegrationTests" - } - ], - "postsubmit": [ - { - "name": "FrameworksNetDeflakeTest" - } - ], - "auto-postsubmit": [ - // Test tag for automotive targets. These are only running in postsubmit so as to harden the - // automotive targets to avoid introducing additional test flake and build time. The plan for - // presubmit testing for auto is to augment the existing tests to cover auto use cases as well. - // Additionally, this tag is used in targeted test suites to limit resource usage on the test - // infra during the hardening phase. - // TODO: this tag to be removed once the above is no longer an issue. - { - "name": "FrameworksNetTests" - }, - { - "name": "FrameworksNetIntegrationTests" - }, - { - "name": "FrameworksNetDeflakeTest" - } - ], - "imports": [ - { - "path": "packages/modules/Connectivity" - } - ] -} \ No newline at end of file diff --git a/tests/common/java/android/net/ConnectivitySettingsManagerTest.kt b/tests/common/java/android/net/ConnectivitySettingsManagerTest.kt index 8d8958dd93..d14d127efc 100644 --- a/tests/common/java/android/net/ConnectivitySettingsManagerTest.kt +++ b/tests/common/java/android/net/ConnectivitySettingsManagerTest.kt @@ -67,6 +67,7 @@ import android.util.Range import androidx.test.InstrumentationRegistry import androidx.test.filters.SmallTest import com.android.net.module.util.ConnectivitySettingsUtils.getPrivateDnsModeAsString +import com.android.testutils.ConnectivityModuleTest import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo import com.android.testutils.DevSdkIgnoreRunner import junit.framework.Assert.assertEquals @@ -295,6 +296,7 @@ class ConnectivitySettingsManagerTest { testIntValues = intArrayOf(0)) } + @ConnectivityModuleTest // get/setIngressRateLimitInBytesPerSecond was added via module update @Test fun testInternetNetworkRateLimitInBytesPerSecond() { val defaultRate = getIngressRateLimitInBytesPerSecond(context) diff --git a/tests/cts/net/AndroidTestTemplate.xml b/tests/cts/net/AndroidTestTemplate.xml index d761c2710c..d60579985c 100644 --- a/tests/cts/net/AndroidTestTemplate.xml +++ b/tests/cts/net/AndroidTestTemplate.xml @@ -21,6 +21,8 @@