summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2024-11-25 16:51:25 +0900
committer Jooyung Han <jooyung@google.com> 2024-11-25 16:53:24 +0900
commita8fb73be3258237caaa226df2aef6f4fea20d004 (patch)
treea9b01d676d62a7db140511f983a1a25196a5b14c /apex/apex_test.go
parent1a6f176ce066fc39574db6b7bcb69da82e579199 (diff)
apex: Do not compress EROFS APEX
EROFS filesystem already compresses its contents. Hence no need to compress the APEX. Bug: 380786910 Test: m --no-skip-soong-tests Change-Id: I25d44cbf98efc6b84db172fa2120e080344d9ddc
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 5b5fe5ff1..5a5173474 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -9049,6 +9049,33 @@ func TestCompressedApex(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.capex\n")
}
+func TestCompressedApexIsDisabledWhenUsingErofs(t *testing.T) {
+ t.Parallel()
+ ctx := testApex(t, `
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ compressible: true,
+ updatable: false,
+ payload_fs_type: "erofs",
+ }
+ apex_key {
+ name: "myapex.key",
+ public_key: "testkey.avbpubkey",
+ private_key: "testkey.pem",
+ }
+ `,
+ android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
+ variables.CompressedApex = proptools.BoolPtr(true)
+ }),
+ )
+
+ compressRule := ctx.ModuleForTests("myapex", "android_common_myapex").MaybeRule("compressRule")
+ if compressRule.Rule != nil {
+ t.Error("erofs apex should not be compressed")
+ }
+}
+
func TestApexSet_ShouldRespectCompressedApexFlag(t *testing.T) {
t.Parallel()
for _, compressionEnabled := range []bool{true, false} {