From f1a61ad83de462dcd149ca53f0d417486ca1aec0 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Tue, 23 May 2023 15:11:36 +0900 Subject: [PATCH] Skip all of NetworkAgentTest in instant mode. Recently, new test methods were added to NetworkAgentTest which fail in instant mode because they are not marked @AppModeFull. Because instant apps can't use NetworkAgent (it's a system API, and it needs the NETWORK_FACTORY permission which is signature only), just mark the whole test @AppModeFull so this cannot happen again. Bug: 283897713 Test: test is skipped in instant mode Change-Id: Ib6ff07d9fdc329d3421a077532b8a434323053f8 --- tests/cts/net/src/android/net/cts/NetworkAgentTest.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt b/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt index af8938a1a7..cf5fc50f04 100644 --- a/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt +++ b/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt @@ -172,6 +172,7 @@ private fun Message(what: Int, arg1: Int, arg2: Int, obj: Any?) = Message.obtain // for modules other than Connectivity does not provide much value. Only run them in connectivity // module MTS, so the tests only need to cover the case of an updated NetworkAgent. @ConnectivityModuleTest +@AppModeFull(reason = "Instant apps can't use NetworkAgent because it needs NETWORK_FACTORY'.") class NetworkAgentTest { private val LOCAL_IPV4_ADDRESS = InetAddresses.parseNumericAddress("192.0.2.1") private val REMOTE_IPV4_ADDRESS = InetAddresses.parseNumericAddress("192.0.2.2") @@ -982,13 +983,11 @@ class NetworkAgentTest { .also { assertNotNull(agent.network?.bindSocket(it)) } } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackRegisterAndUnregister() { validateQosCallbackRegisterAndUnregister(IPPROTO_TCP) } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackRegisterAndUnregisterWithDatagramSocket() { validateQosCallbackRegisterAndUnregister(IPPROTO_UDP) @@ -1025,13 +1024,11 @@ class NetworkAgentTest { } } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackOnQosSession() { validateQosCallbackOnQosSession(IPPROTO_TCP) } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackOnQosSessionWithDatagramSocket() { validateQosCallbackOnQosSession(IPPROTO_UDP) @@ -1090,7 +1087,6 @@ class NetworkAgentTest { } } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackOnError() { val (agent, qosTestSocket) = setupForQosSocket() @@ -1129,7 +1125,6 @@ class NetworkAgentTest { } } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackIdsAreMappedCorrectly() { val (agent, qosTestSocket) = setupForQosSocket() @@ -1170,7 +1165,6 @@ class NetworkAgentTest { } } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testQosCallbackWhenNetworkReleased() { val (agent, qosTestSocket) = setupForQosSocket() @@ -1212,7 +1206,6 @@ class NetworkAgentTest { ) } - @AppModeFull(reason = "Instant apps don't have permission to bind sockets.") @Test fun testUnregisterAfterReplacement() { // Keeps an eye on all test networks.