diff --git a/TEST_MAPPING b/TEST_MAPPING index 3384f7bd42..1a937befa9 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -5,7 +5,12 @@ }, { // In addition to ConnectivityCoverageTests, runs non-connectivity-module tests - "name": "FrameworksNetTests" + "name": "FrameworksNetTests", + "options": [ + { + "exclude-annotation": "com.android.testutils.SkipPresubmit" + } + ] }, // Run in addition to mainline-presubmit as mainline-presubmit is not // supported in every branch. @@ -123,6 +128,9 @@ }, { "name": "FrameworksNetDeflakeTest" + }, + { + "name": "FrameworksNetTests" } ], "mainline-presubmit": [ diff --git a/tests/cts/hostside/Android.bp b/tests/cts/hostside/Android.bp index 891c2ddb0a..e55ba6345c 100644 --- a/tests/cts/hostside/Android.bp +++ b/tests/cts/hostside/Android.bp @@ -32,6 +32,7 @@ java_test_host { // Only compile source java files in this apk. srcs: ["src/**/*.java"], libs: [ + "net-tests-utils-host-device-common", "cts-tradefed", "tradefed", ], diff --git a/tests/cts/hostside/TEST_MAPPING b/tests/cts/hostside/TEST_MAPPING index 2cfd7af1ae..dc86fb198c 100644 --- a/tests/cts/hostside/TEST_MAPPING +++ b/tests/cts/hostside/TEST_MAPPING @@ -11,6 +11,20 @@ }, { "exclude-annotation": "android.platform.test.annotations.RequiresDevice" + }, + { + "exclude-annotation": "com.android.testutils.SkipPresubmit" + } + ] + } + ], + "postsubmit": [ + { + // Postsubmit on virtual devices to monitor flakiness of @SkipPresubmit methods + "name": "CtsHostsideNetworkTests", + "options": [ + { + "exclude-annotation": "androidx.test.filters.RequiresDevice" } ] } diff --git a/tests/cts/hostside/src/com/android/cts/net/HostsideVpnTests.java b/tests/cts/hostside/src/com/android/cts/net/HostsideVpnTests.java index 691ac90584..4f21af78a9 100644 --- a/tests/cts/hostside/src/com/android/cts/net/HostsideVpnTests.java +++ b/tests/cts/hostside/src/com/android/cts/net/HostsideVpnTests.java @@ -18,6 +18,8 @@ package com.android.cts.net; import android.platform.test.annotations.RequiresDevice; +import com.android.testutils.SkipPresubmit; + import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -35,11 +37,13 @@ public class HostsideVpnTests extends HostsideNetworkTestCase { uninstallPackage(TEST_APP2_PKG, true); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testChangeUnderlyingNetworks() throws Exception { runDeviceTests(TEST_PKG, TEST_PKG + ".VpnTest", "testChangeUnderlyingNetworks"); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testDefault() throws Exception { runDeviceTests(TEST_PKG, TEST_PKG + ".VpnTest", "testDefault"); @@ -162,6 +166,7 @@ public class HostsideVpnTests extends HostsideNetworkTestCase { runDeviceTests(TEST_PKG, TEST_PKG + ".VpnTest", "testBlockIncomingPackets"); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testSetVpnDefaultForUids() throws Exception { runDeviceTests(TEST_PKG, TEST_PKG + ".VpnTest", "testSetVpnDefaultForUids"); diff --git a/tests/unit/java/com/android/server/ConnectivityServiceTest.java b/tests/unit/java/com/android/server/ConnectivityServiceTest.java index bbde9b4a0b..5dd40487cc 100755 --- a/tests/unit/java/com/android/server/ConnectivityServiceTest.java +++ b/tests/unit/java/com/android/server/ConnectivityServiceTest.java @@ -422,6 +422,7 @@ import com.android.testutils.FunctionalUtils.ThrowingConsumer; import com.android.testutils.FunctionalUtils.ThrowingRunnable; import com.android.testutils.HandlerUtils; import com.android.testutils.RecorderCallback.CallbackEntry; +import com.android.testutils.SkipPresubmit; import com.android.testutils.TestableNetworkCallback; import com.android.testutils.TestableNetworkOfferCallback; @@ -7414,6 +7415,7 @@ public class ConnectivityServiceTest { assertPinnedToWifiWithCellDefault(); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testNetworkCallbackMaximum() throws Exception { final int MAX_REQUESTS = 100; diff --git a/tests/unit/java/com/android/server/connectivity/VpnTest.java b/tests/unit/java/com/android/server/connectivity/VpnTest.java index 1a169a6fd6..2726267f65 100644 --- a/tests/unit/java/com/android/server/connectivity/VpnTest.java +++ b/tests/unit/java/com/android/server/connectivity/VpnTest.java @@ -182,6 +182,7 @@ import com.android.server.IpSecService; import com.android.server.VpnTestBase; import com.android.server.vcn.util.PersistableBundleUtils; import com.android.testutils.DevSdkIgnoreRule; +import com.android.testutils.SkipPresubmit; import org.junit.Before; import org.junit.Rule; @@ -1713,6 +1714,7 @@ public class VpnTest extends VpnTestBase { errorCode); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testStartPlatformVpnFailedWithRecoverableError() throws Exception { final IkeProtocolException exception = mock(IkeProtocolException.class); @@ -1722,6 +1724,7 @@ public class VpnTest extends VpnTestBase { VpnManager.CATEGORY_EVENT_IKE_ERROR, VpnManager.ERROR_CLASS_RECOVERABLE, errorCode); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testStartPlatformVpnFailedWithUnknownHostException() throws Exception { final IkeNonProtocolException exception = mock(IkeNonProtocolException.class); @@ -1733,6 +1736,7 @@ public class VpnTest extends VpnTestBase { errorCode); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testStartPlatformVpnFailedWithIkeTimeoutException() throws Exception { final IkeNonProtocolException exception = mock(IkeNonProtocolException.class); @@ -1754,6 +1758,7 @@ public class VpnTest extends VpnTestBase { VpnManager.ERROR_CODE_NETWORK_LOST); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testStartPlatformVpnFailedWithIOException() throws Exception { final IkeNonProtocolException exception = mock(IkeNonProtocolException.class); @@ -2386,6 +2391,7 @@ public class VpnTest extends VpnTestBase { true /* areLongLivedTcpConnectionsExpensive */); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testPreferredIpProtocolFromCarrierConfig_v4UDP() throws Exception { doTestReadCarrierConfig(createTestCellNc(), @@ -2398,6 +2404,7 @@ public class VpnTest extends VpnTestBase { false /* areLongLivedTcpConnectionsExpensive */); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testPreferredIpProtocolFromCarrierConfig_v6ESP() throws Exception { doTestReadCarrierConfig(createTestCellNc(), @@ -2410,6 +2417,7 @@ public class VpnTest extends VpnTestBase { false /* areLongLivedTcpConnectionsExpensive */); } + @SkipPresubmit(reason = "Out of SLO flakiness") @Test public void testPreferredIpProtocolFromCarrierConfig_v6UDP() throws Exception { doTestReadCarrierConfig(createTestCellNc(),