summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hai Zhang <zhanghai@google.com> 2024-11-21 03:02:03 +0000
committer Hai Zhang <zhanghai@google.com> 2024-11-21 05:58:39 +0000
commite5162bf79ae9002a5467a35e5d5a0f3d5ede8700 (patch)
tree64a13aeff1d9cf9bcb70073f4897202940f0a550
parent45ece552fb712378aea59192292e64b6b421b0ac (diff)
Change SignaturePermissionAllowlistConfigTest assertion to Log.w
Because it's only STRONGLY RECOMMENDED right now. Fixes: 376144598 Relnote: N/A Flag: TEST_ONLY Test: presubmit Change-Id: I5261e17d01171b6438d5ce615fdb7af5b3244a75
-rw-r--r--tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt38
1 files changed, 25 insertions, 13 deletions
diff --git a/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt b/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt
index 268bbd317..e6673718f 100644
--- a/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt
+++ b/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt
@@ -20,6 +20,7 @@ import android.content.pm.ApplicationInfo
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.content.pm.PermissionInfo
+import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.android.compatibility.common.util.CddTest
@@ -52,13 +53,16 @@ class SignaturePermissionAllowlistConfigTest {
}
}
}
- assertTrue(
- "Some platform-signed non-system packages don't have their requested platform" +
- " signature permissions allowlisted. Suggested signature permission allowlist" +
- " additions:\n\n" +
- buildSiganturePermissionAllowlist(unallowlistedPackageAndPermissions),
- unallowlistedPackageAndPermissions.isEmpty()
- )
+ // TODO(b/365777291): CDD 9.1/C-0-16 is still STRONGLY RECOMMENDED instead of MUST.
+ if (unallowlistedPackageAndPermissions.isNotEmpty()) {
+ Log.w(
+ LOG_TAG,
+ "Some platform-signed non-system packages don't have their requested platform" +
+ " signature permissions allowlisted. Suggested signature permission allowlist" +
+ " additions:\n\n" +
+ buildSiganturePermissionAllowlist(unallowlistedPackageAndPermissions),
+ )
+ }
}
private fun getSignaturePermissionAllowlist(): Map<String, Set<String>> {
@@ -107,12 +111,16 @@ class SignaturePermissionAllowlistConfigTest {
}
}
}
- assertTrue(
- "Some platform-signed non-system packages don't have their requested platform" +
- " signature permissions granted. Suggested signature permission allowlist" +
- " additions:\n\n${buildSiganturePermissionAllowlist(deniedPackageAndPermissions)}",
- deniedPackageAndPermissions.isEmpty()
- )
+ // TODO(b/365777291): CDD 9.1/C-0-16 is still STRONGLY RECOMMENDED instead of MUST.
+ if (deniedPackageAndPermissions.isNotEmpty()) {
+ Log.w(
+ LOG_TAG,
+ "Some platform-signed non-system packages don't have their requested platform" +
+ " signature permissions granted. Suggested signature permission allowlist" +
+ " additions:\n\n" +
+ buildSiganturePermissionAllowlist(deniedPackageAndPermissions),
+ )
+ }
}
private fun getPlatformSignaturePermissionNames(): List<String> =
@@ -142,4 +150,8 @@ class SignaturePermissionAllowlistConfigTest {
append(" </signature-permissions>\n")
}
}
+
+ companion object {
+ private val LOG_TAG = SignaturePermissionAllowlistConfigTest::class.java.simpleName
+ }
}