diff options
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r-- | filesystem/filesystem_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 29f9373d7..801a17545 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -585,6 +585,35 @@ func TestErofsPartition(t *testing.T) { android.AssertStringDoesContain(t, "erofs fs type sparse", buildImageConfig, "erofs_sparse_flag=-s") } +func TestF2fsPartition(t *testing.T) { + result := fixture.RunTestWithBp(t, ` + android_filesystem { + name: "f2fs_partition", + type: "f2fs", + } + `) + + partition := result.ModuleForTests("f2fs_partition", "android_common") + buildImageConfig := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("prop")) + android.AssertStringDoesContain(t, "f2fs fs type", buildImageConfig, "fs_type=f2fs") + android.AssertStringDoesContain(t, "f2fs fs type sparse", buildImageConfig, "f2fs_sparse_flag=-S") +} + +func TestFsTypesPropertyError(t *testing.T) { + fixture.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern( + "erofs: erofs is non-empty, but FS type is f2fs\n. Please delete erofs properties if this partition should use f2fs\n")). + RunTestWithBp(t, ` + android_filesystem { + name: "f2fs_partition", + type: "f2fs", + erofs: { + compressor: "lz4hc,9", + compress_hints: "compress_hints.txt", + }, + } + `) +} + // If a system_ext/ module depends on system/ module, the dependency should *not* // be installed in system_ext/ func TestDoNotPackageCrossPartitionDependencies(t *testing.T) { |