summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2024-04-30 18:09:09 +0900
committer Jiyong Park <jiyong@google.com> 2024-04-30 18:50:06 +0000
commita51c4ce10e959137f2a3a26442438b5a1200ca64 (patch)
treeef3c481306f9028af5927e62c505c6cf034ee352 /filesystem/filesystem_test.go
parent4152b192e09d27fdb801a89d47c22ff2a19779b7 (diff)
Prevent multiple PackagingSpecs having same installation path
This fixes a bug that different PackagingSpecs having the same installation path were silently allowed. Previously, a PackagingSpec that comes the first for the given installation path won, effectively eclipsing other PackagingSpecs destined for the same installation path. Bug: 335506668 Test: go test ./... Change-Id: Ia36f656e8364f95c4be78fff6e9dc16966307526
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index 121504867..acd481352 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -442,3 +442,26 @@ func TestInconsistentPartitionTypesInDefaults(t *testing.T) {
}
`)
}
+
+func TestPreventDuplicatedEntries(t *testing.T) {
+ fixture.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(
+ "packaging conflict at")).
+ RunTestWithBp(t, `
+ android_filesystem {
+ name: "fs",
+ deps: [
+ "foo",
+ "foo_dup",
+ ],
+ }
+
+ cc_binary {
+ name: "foo",
+ }
+
+ cc_binary {
+ name: "foo_dup",
+ stem: "foo",
+ }
+ `)
+}