From f46b1af96993ed4a92cf32aba289b7f2decb9811 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 5 Apr 2024 18:13:33 +0900 Subject: android_filesystem_defaults and visibility rule android_systemimage_defaults is deleted and android_filesystem_defaults is created so that we can have defaults not only for android_system_image, but also all android_filesystem modules and its derivatives. Also, change adds a check which ensures that the partition_type of the filesystem and its defaults are the same. Bug: 330665150 Test: m Change-Id: If635c794534ed89d264eaf7dfc406a8245b8e9f0 --- filesystem/filesystem_test.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'filesystem/filesystem_test.go') diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 5c780f874..9b26cf6eb 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -367,7 +367,7 @@ func TestFileSystemWithCoverageVariants(t *testing.T) { func TestSystemImageDefaults(t *testing.T) { result := fixture.RunTestWithBp(t, ` - android_system_image_defaults { + android_filesystem_defaults { name: "defaults", multilib: { common: { @@ -433,3 +433,25 @@ func TestSystemImageDefaults(t *testing.T) { android.AssertStringListContains(t, "missing entry", fs.entries, e) } } + +func TestInconsistentPartitionTypesInDefaults(t *testing.T) { + fixture.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern( + "doesn't match with the partition type")). + RunTestWithBp(t, ` + android_filesystem_defaults { + name: "system_ext_def", + partition_type: "system_ext", + } + + android_filesystem_defaults { + name: "system_def", + partition_type: "system", + defaults: ["system_ext_def"], + } + + android_system_image { + name: "system", + defaults: ["system_def"], + } + `) +} -- cgit v1.2.3-59-g8ed1b