diff options
author | Jiyong Park <jiyong@google.com> | 2019-03-15 02:13:21 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2019-03-15 02:15:39 +0900 |
commit | d1e293d11e789e19cb32b57394d85cb2a93bfc7a (patch) | |
tree | 9e4c1c63b2b0b04272fc3128a1fd6ced23a92968 /apex/apex_test.go | |
parent | 33548f07a8cef49a5201a844bd4982c2af8ee610 (diff) | |
download | android_build_soong-d1e293d11e789e19cb32b57394d85cb2a93bfc7a.tar.gz android_build_soong-d1e293d11e789e19cb32b57394d85cb2a93bfc7a.tar.bz2 android_build_soong-d1e293d11e789e19cb32b57394d85cb2a93bfc7a.zip |
product_specific support for apex_key
apex_key, when with product_specific: true, is installed to
/product/etc/security/apex.
Bug: 128519063
Test: m (apex_test.go amended)
Change-Id: I39e8ac1c486c734dfe0555cd1874468d75e71f34
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 66f07259..5b767ef7 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -827,7 +827,7 @@ func TestKeys(t *testing.T) { `) // check the APEX keys - keys := ctx.ModuleForTests("myapex.key", "").Module().(*apexKey) + keys := ctx.ModuleForTests("myapex.key", "android_common").Module().(*apexKey) if keys.public_key_file.String() != "vendor/foo/devkeys/testkey.avbpubkey" { t.Errorf("public key %q is not %q", keys.public_key_file.String(), @@ -1144,3 +1144,43 @@ func TestApexWithShBinary(t *testing.T) { ensureContains(t, copyCmds, "image.apex/bin/script/myscript.sh") } + +func TestApexInProductPartition(t *testing.T) { + ctx := testApex(t, ` + apex { + name: "myapex", + key: "myapex.key", + native_shared_libs: ["mylib"], + product_specific: true, + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + product_specific: true, + } + + cc_library { + name: "mylib", + srcs: ["mylib.cpp"], + system_shared_libs: [], + stl: "none", + } + `) + + apex := ctx.ModuleForTests("myapex", "android_common_myapex").Module().(*apexBundle) + expected := "target/product/test_device/product/apex" + actual := apex.installDir.RelPathString() + if actual != expected { + t.Errorf("wrong install path. expected %q. actual %q", expected, actual) + } + + apex_key := ctx.ModuleForTests("myapex.key", "android_common").Module().(*apexKey) + expected = "target/product/test_device/product/etc/security/apex" + actual = apex_key.installDir.RelPathString() + if actual != expected { + t.Errorf("wrong install path. expected %q. actual %q", expected, actual) + } + +} |