From e7d085e87de167f73e848db403f96d7234de6a11 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 23 Jun 2021 02:08:39 +0000 Subject: [PATCH] Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode 1. testIsPrivateDnsBroken: It requires the permission:android.permission.WRITE_SECURE_SETTINGS. But the WRITE_SECURE_SETTINGS permission can't be granted to instant apps. 2. testSetOemNetworkPreferenceForTestOnlyPref: Instant apps can't create test networks. 3. testSetOemNetworkPreferenceForTestPref: Instant apps can't create test networks. Bug: 191678254 Bug: 191680108 Test: atest android.net.cts.ConnectivityManagerTest --instant atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest --instant Original-Change: https://android-review.googlesource.com/1743373 Merged-In: Ice43bcf7a1dc34f4a54fefba7f408767f0a4341e Change-Id: Ice43bcf7a1dc34f4a54fefba7f408767f0a4341e --- .../cts/net/src/android/net/cts/ConnectivityManagerTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java index eb9c3054cb..c2613c8d96 100644 --- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java +++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java @@ -698,6 +698,7 @@ public class ConnectivityManagerTest { .build(); } + @AppModeFull(reason = "WRITE_SECURE_SETTINGS permission can't be granted to instant apps") @Test @IgnoreUpTo(Build.VERSION_CODES.Q) public void testIsPrivateDnsBroken() throws InterruptedException { final String invalidPrivateDnsServer = "invalidhostname.example.com"; @@ -2202,7 +2203,7 @@ public class ConnectivityManagerTest { * For specified apps, validate networks are prioritized in order: unmetered, TEST transport, * default network. */ - @AppModeFull(reason = "Cannot get WifiManager in instant app mode") + @AppModeFull(reason = "Instant apps cannot create test networks") @Test public void testSetOemNetworkPreferenceForTestPref() throws Exception { // Cannot use @IgnoreUpTo(Build.VERSION_CODES.R) because this test also requires API 31 @@ -2262,6 +2263,7 @@ public class ConnectivityManagerTest { * Verify that per-app OEM network preference functions as expected for network pref TEST_ONLY. * For specified apps, validate that only TEST transport type networks are used. */ + @AppModeFull(reason = "Instant apps cannot create test networks") @Test public void testSetOemNetworkPreferenceForTestOnlyPref() throws Exception { // Cannot use @IgnoreUpTo(Build.VERSION_CODES.R) because this test also requires API 31