diff options
author | 2024-09-11 17:00:24 +0900 | |
---|---|---|
committer | 2024-09-24 19:39:25 +0900 | |
commit | 5523481ed2c2e5d207e0a53bb5b04385f3700291 (patch) | |
tree | 3f4510f933e3c672875a26c24a4d0bcc4b0fbf75 /android/module_test.go | |
parent | 3507a28d75eb125bb0bb8554f6f7406d5e762664 (diff) |
Check if vintf_fragment modules' target partition
Current implementation allows vintf_fragment to be installed in the
different partition of a module referenced it via
vintf_fragment_modules, but this is unexpected behavior and should be
caught from the build system to avoid any unintended mistakes. This
change checks target parition of vintf_fragment module and any modules
referencing it, and fails if there is any mismatch found.
Bug: 322089980
Test: aosp_cf_x86_64_phone build succeeded
Change-Id: Ie8152d2f2616726e44a99fb1261be292f2b9ad54
Diffstat (limited to 'android/module_test.go')
-rw-r--r-- | android/module_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/android/module_test.go b/android/module_test.go index d64e3a591..d76d9b329 100644 --- a/android/module_test.go +++ b/android/module_test.go @@ -1080,3 +1080,29 @@ func TestOutputFileForModule(t *testing.T) { }) } } + +func TestVintfFragmentModulesChecksPartition(t *testing.T) { + bp := ` + vintf_fragment { + name: "vintfModA", + src: "test_vintf_file", + vendor: true, + } + deps { + name: "modA", + vintf_fragment_modules: [ + "vintfModA", + ] + } + ` + + testPreparer := GroupFixturePreparers( + PrepareForTestWithAndroidBuildComponents, + prepareForModuleTests, + ) + + testPreparer. + ExtendWithErrorHandler(FixtureExpectsOneErrorPattern( + "Module .+ and Vintf_fragment .+ are installed to different partitions.")). + RunTestWithBp(t, bp) +} |