From 1a6291fde6a3d1eae0e9406ba99488af575a0f57 Mon Sep 17 00:00:00 2001 From: mrziwang Date: Thu, 7 Nov 2024 14:29:25 -0800 Subject: Add f2fs support to Soong filesystem modules Test: CI and unit tests Bug: 372522486 Change-Id: I4dd5efb6e81018903def05908dbdd71b11500fe7 --- filesystem/filesystem_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'filesystem/filesystem_test.go') 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) { -- cgit v1.2.3-59-g8ed1b