blob: 03bcad7ca85ade3083c476c14dddc98c864d676b [file] [log] [blame]
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/fuzz.gni")
import("//build/test.gni")
import("//src/storage/fs_test/suite.gni")
import("//src/storage/testing/driver_test_realm.gni")
group("test") {
testonly = true
deps = [
":f2fs-fs-tests",
":f2fs-slow-fs-tests",
]
}
test_deps = [
"//sdk/fidl/fuchsia.fs:fuchsia.fs_cpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp",
"//sdk/lib/fdio",
"//sdk/lib/syslog/cpp",
"//src/lib/chunked-compression",
"//src/lib/fxl/test:gtest_main",
"//src/storage/f2fs",
"//src/storage/lib/block_client/cpp:fake_device",
"//src/storage/lib/fs_management",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/storage/operation",
"//zircon/system/ulib/sync",
"//zircon/third_party/ulib/cksum",
"//zircon/third_party/ulib/safemath",
]
test("f2fs_unit") {
sources = [
"unit/bcache.cc",
"unit/bitmap.cc",
"unit/checkpoint.cc",
"unit/dir.cc",
"unit/dir_entry_cache.cc",
"unit/extent_cache.cc",
"unit/f2fs.cc",
"unit/file.cc",
"unit/file_cache.cc",
"unit/fsck.cc",
"unit/inline.cc",
"unit/mkfs.cc",
"unit/mmap.cc",
"unit/mount.cc",
"unit/node.cc",
"unit/orphan.cc",
"unit/roll_forward_recovery.cc",
"unit/segment.cc",
"unit/teardown.cc",
"unit/timestamp.cc",
"unit/unit_lib.cc",
"unit/vnode.cc",
"unit/vnode_cache.cc",
]
public = [ "unit/unit_lib.h" ]
deps = test_deps
}
fuchsia_unittest_component("f2fs-unittest") {
manifest = "f2fs_unittest.cml"
deps = [ ":f2fs_unit" ]
}
test("f2fs_gc_unit") {
sources = [
"unit/gc.cc",
"unit/unit_lib.cc",
]
public = [ "unit/unit_lib.h" ]
deps = test_deps
}
fuchsia_unittest_component("f2fs-gc-unittest") {
manifest = "f2fs_gc_unittest.cml"
deps = [ ":f2fs_gc_unit" ]
}
test("f2fs_large_volume_unit") {
sources = [
"unit/large_volume.cc",
"unit/unit_lib.cc",
]
public = [ "unit/unit_lib.h" ]
deps = test_deps
}
fuchsia_unittest_component("f2fs-large-volume-unittest") {
manifest = "f2fs_large_volume_unittest.cml"
deps = [ ":f2fs_large_volume_unit" ]
}
test("f2fs_slow_unit") {
sources = [
"unit/multithreading.cc",
"unit/unit_lib.cc",
]
public = [ "unit/unit_lib.h" ]
deps = test_deps
}
fuchsia_unittest_component("f2fs-slow-unittest") {
manifest = "f2fs_slow_unittest.cml"
deps = [ ":f2fs_slow_unit" ]
}
test("f2fs_component_runner_test") {
output_name = "f2fs_component_runner_test"
sources = [ "unit/component_runner_test.cc" ]
deps = test_deps + [
"//sdk/lib/component/incoming/cpp",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_cpp",
"//zircon/system/ulib/id_allocator",
"//zircon/system/ulib/zx",
]
}
fuchsia_unittest_component("f2fs-component-runner-test") {
deps = [ ":f2fs_component_runner_test" ]
}
fs_test_config("f2fs") {
timestamp_granularity = 1
supports_hard_links = true
supports_resize = false
max_file_size = 4329690886144
max_block_size = 4096
supports_fsck_after_every_transaction = false
supports_inspect = true
supports_shutdown_on_no_connections = true
supports_mmap = true
supports_mmap_shared_write = true
options = [
{
description = "F2fsWithoutFvm"
use_fvm = false
has_min_volume_size = true
# f2fs requires a minimum of 100mb volume
device_block_count = 204800
device_block_size = 512
},
]
}
fs_test_suite("f2fs") {
deps = [
":f2fs_fs_test_config",
"//src/storage/f2fs/bin:f2fs-component",
]
extra_components = [
":f2fs-unittest",
":f2fs-gc-unittest",
":f2fs-large-volume-unittest",
":f2fs-slow-unittest",
":f2fs-component-runner-test",
]
# TODO(b/297201368): These tests timeout on RISC-V builders currently.
if (current_cpu == "riscv64") {
extra_components -= [
":f2fs-unittest",
":f2fs-large-volume-unittest",
":f2fs-gc-unittest",
]
}
}
slow_fs_test_suite("f2fs") {
deps = [
":f2fs_fs_test_config",
"//src/storage/f2fs/bin:f2fs-component",
]
# TODO(b/297201368): These tests are disabled in the regular test suite above due to timeouts.
if (current_cpu == "riscv64") {
extra_components = [
":f2fs-unittest",
":f2fs-large-volume-unittest",
":f2fs-gc-unittest",
]
}
}