Fix testing with/without connectivity module am: 3b81323e4a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987446 Change-Id: I47ec700b2ffb852a74ec5fea0640ea95e3e223fd
This commit is contained in:
55
TEST_MAPPING
55
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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
|
||||
|
||||
<option name="config-descriptor:metadata" key="mainline-param" value="CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex" />
|
||||
<option name="config-descriptor:metadata" key="mainline-param" value="CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk" />
|
||||
<option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.tethering.apex" />
|
||||
<option name="not-shardable" value="true" />
|
||||
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
|
||||
<option name="cleanup-apks" value="true" />
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.os.Build;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.testutils.ConnectivityModuleTest;
|
||||
import com.android.testutils.DevSdkIgnoreRule;
|
||||
|
||||
import libcore.net.InetAddressUtils;
|
||||
@@ -106,7 +107,7 @@ public final class IpConfigurationTest {
|
||||
assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
|
||||
}
|
||||
|
||||
@DevSdkIgnoreRule.IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
@ConnectivityModuleTest @DevSdkIgnoreRule.IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
@Test
|
||||
public void testBuilder() {
|
||||
final IpConfiguration c = new IpConfiguration.Builder()
|
||||
|
||||
@@ -77,6 +77,7 @@ import com.android.compatibility.common.util.ThrowingSupplier
|
||||
import com.android.modules.utils.build.SdkLevel
|
||||
import com.android.net.module.util.ArrayTrackRecord
|
||||
import com.android.testutils.CompatUtil
|
||||
import com.android.testutils.ConnectivityModuleTest
|
||||
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo
|
||||
import com.android.testutils.DevSdkIgnoreRunner
|
||||
import com.android.testutils.RecorderCallback.CallbackEntry.Available
|
||||
@@ -465,6 +466,7 @@ class NetworkAgentTest {
|
||||
.addTransportType(TRANSPORT_TEST)
|
||||
.setAccessUids(uids.toSet()).build()
|
||||
|
||||
@ConnectivityModuleTest // Functionality was added post-S via connectivity module update
|
||||
@Test
|
||||
fun testRejectedUpdates() {
|
||||
val callback = TestableNetworkCallback()
|
||||
|
||||
@@ -35,6 +35,7 @@ import android.os.Parcel;
|
||||
import androidx.test.filters.SmallTest;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.testutils.ConnectivityModuleTest;
|
||||
import com.android.testutils.DevSdkIgnoreRule;
|
||||
|
||||
import org.junit.Rule;
|
||||
@@ -256,7 +257,7 @@ public class StaticIpConfigurationTest {
|
||||
assertEquals(DNS1, s.getDnsServers().get(0));
|
||||
}
|
||||
|
||||
@DevSdkIgnoreRule.IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
@ConnectivityModuleTest @DevSdkIgnoreRule.IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
@Test
|
||||
public void testIllegalBuilders() {
|
||||
assertThrows("Can't set IP Address to IPv6!", IllegalArgumentException.class, () -> {
|
||||
|
||||
Reference in New Issue
Block a user