diff options
author | 2020-06-12 18:03:31 +0000 | |
---|---|---|
committer | 2020-06-12 18:03:31 +0000 | |
commit | 7a8e0cd23a7e6e1450cf169c60e0234a31d91f03 (patch) | |
tree | ba898daf0007f76aa0ce526baa6397b4d433a358 /apex/apex_test.go | |
parent | f094f1c313f49c8b6d5f9169a0ee04026cc80f0d (diff) | |
parent | 8d6c51ebcc5d2703b5c3b4d7c6164c2790b3ed84 (diff) |
Merge "apex_sets is added to apexkeys.txt"
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 609e6516b..7159a4593 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() |