Ignore NetworkTest when running CtsNetTestCases in instant app mode
Ignore NetworkTest#testBindSocketOfConnectedDatagramSocketThrows
when running CtsNetTestCases in instant app mode due to sockect
cannot bind in instant app mode.
Bug: 123366918
Test: atest CtsNetTestCases --instant
Test: atest FrameworksNetTests
Change-Id: I1e93d4491e3d9e5a095ff4b6169b2f70e7b3b690
Merged-In: Ia28eea113e19b9c44998677e5b8093be178a06a3
Merged-In: I1e93d4491e3d9e5a095ff4b6169b2f70e7b3b690
(cherry picked from commit 73c0d48b14488c93b2f42a1e149e4be8499d3469)
diff --git a/tests/net/common/Android.bp b/tests/net/common/Android.bp
index 07525a6..db1ccb4 100644
--- a/tests/net/common/Android.bp
+++ b/tests/net/common/Android.bp
@@ -24,6 +24,7 @@
"frameworks-net-testutils",
"junit",
"mockito-target-minus-junit4",
+ "platform-test-annotations",
],
libs: [
"android.test.base.stubs",
diff --git a/tests/net/common/java/android/net/NetworkTest.java b/tests/net/common/java/android/net/NetworkTest.java
index bef66b2..38bc744 100644
--- a/tests/net/common/java/android/net/NetworkTest.java
+++ b/tests/net/common/java/android/net/NetworkTest.java
@@ -25,6 +25,7 @@
import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.net.Network;
+import android.platform.test.annotations.AppModeFull;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
@@ -74,6 +75,7 @@
}
@Test
+ @AppModeFull(reason = "Socket cannot bind in instant app mode")
public void testBindSocketOfConnectedDatagramSocketThrows() throws Exception {
final DatagramSocket mDgramSocket = new DatagramSocket(0, (InetAddress) Inet6Address.ANY);
mDgramSocket.connect((InetAddress) Inet6Address.LOOPBACK, 53);