summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2020-09-21 11:02:57 +0900
committer Jooyung Han <jooyung@google.com> 2020-09-21 11:02:57 +0900
commit8e5685ddca0cdeffffe5a53b08ca8102144361cf (patch)
treecd787da79ae53778535d6b560257687fa0831fd4 /apex/apex_test.go
parent41243c1d5f43ba28e94598c4bf1fb11f3efe3fda (diff)
apex: prebuilt_firmware installs in /etc/firmware
Installation path of prebuilt_firmware varies accoding to target partitions. When it is for system, it installs a file in /system/etc/firmware while it installs in /vendor/firmware for vendor. We'd better be consistent about installation path when it is for APEXes regardless of target partition. Otherwise, ueventd would need to scan both /apex/*/etc/firmware and /apex/*/firmware. Having /etc prefix for prebuilt modules helps module owners to predict the layout of the contents. Bug: 162701747 Bug: 167942098 Test: soong tests Test: loading vibrator firmware from vibrator apex (sunfish) Change-Id: I7a7105026426f8a7a156bc947304930f761c81f3
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go58
1 files changed, 34 insertions, 24 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 610f66750..5c49667e5 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -2282,30 +2282,40 @@ func TestVendorApex_use_vndk_as_stable(t *testing.T) {
ensureListContains(t, requireNativeLibs, ":vndk")
}
-func TestVendorApex_withPrebuiltFirmware(t *testing.T) {
- ctx, _ := testApex(t, `
- apex {
- name: "myapex",
- key: "myapex.key",
- prebuilts: ["myfirmware"],
- vendor: true,
- }
- apex_key {
- name: "myapex.key",
- public_key: "testkey.avbpubkey",
- private_key: "testkey.pem",
- }
- prebuilt_firmware {
- name: "myfirmware",
- src: "myfirmware.bin",
- filename_from_src: true,
- vendor: true,
- }
- `)
-
- ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
- "firmware/myfirmware.bin",
- })
+func TestApex_withPrebuiltFirmware(t *testing.T) {
+ testCases := []struct {
+ name string
+ additionalProp string
+ }{
+ {"system apex with prebuilt_firmware", ""},
+ {"vendor apex with prebuilt_firmware", "vendor: true,"},
+ }
+ for _, tc := range testCases {
+ t.Run(tc.name, func(t *testing.T) {
+ ctx, _ := testApex(t, `
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ prebuilts: ["myfirmware"],
+ `+tc.additionalProp+`
+ }
+ apex_key {
+ name: "myapex.key",
+ public_key: "testkey.avbpubkey",
+ private_key: "testkey.pem",
+ }
+ prebuilt_firmware {
+ name: "myfirmware",
+ src: "myfirmware.bin",
+ filename_from_src: true,
+ `+tc.additionalProp+`
+ }
+ `)
+ ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
+ "etc/firmware/myfirmware.bin",
+ })
+ })
+ }
}
func TestAndroidMk_UseVendorRequired(t *testing.T) {