diff options
author | 2020-06-12 17:26:31 +0900 | |
---|---|---|
committer | 2020-06-13 01:24:51 +0900 | |
commit | 8d6c51ebcc5d2703b5c3b4d7c6164c2790b3ed84 (patch) | |
tree | cb95172ab567b545a2902d6e3ab5b6214f739e74 /apex/apex_test.go | |
parent | 7d95aac0663dbc48988215c6a0179ce2319d23e0 (diff) |
apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.
Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt
Bug: 158729168
Test: m
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 7bd037481..39ce13581 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -241,6 +241,7 @@ func testApexContext(_ *testing.T, bp string, handlers ...testCustomizer) (*andr java.RegisterSystemModulesBuildComponents(ctx) java.RegisterAppBuildComponents(ctx) ctx.RegisterModuleType("java_sdk_library", java.SdkLibraryFactory) + ctx.RegisterSingletonType("apex_keys_text", apexKeysTextFactory) ctx.PreDepsMutators(RegisterPreDepsMutators) ctx.PostDepsMutators(RegisterPostDepsMutators) @@ -5196,6 +5197,46 @@ func TestNoStaticLinkingToStubsLib(t *testing.T) { `) } +func TestApexKeysTxt(t *testing.T) { + ctx, _ := testApex(t, ` + apex { + name: "myapex", + key: "myapex.key", + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + prebuilt_apex { + name: "myapex", + prefer: true, + arch: { + arm64: { + src: "myapex-arm64.apex", + }, + arm: { + src: "myapex-arm.apex", + }, + }, + } + + apex_set { + name: "myapex_set", + set: "myapex.apks", + filename: "myapex_set.apex", + overrides: ["myapex"], + } + `) + + apexKeysText := ctx.SingletonForTests("apex_keys_text") + content := apexKeysText.MaybeDescription("apexkeys.txt").BuildParams.Args["content"] + ensureContains(t, content, `name="myapex_set.apex" public_key="PRESIGNED" private_key="PRESIGNED" container_certificate="PRESIGNED" container_private_key="PRESIGNED" partition="system"`) + ensureNotContains(t, content, "myapex.apex") +} + func TestMain(m *testing.M) { run := func() int { setUp() |