blob: ab741030ecf6fb05213c25288b8c370b0874a73a [file] [log] [blame]
# Copyright 2019 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/fuzzing/fuzzer.gni")
import("//build/test.gni")
import("//src/storage/fs_test/suite.gni")
import("//src/storage/testing/driver_test_realm.gni")
test("minfs_unit") {
sources = [
"unit/bcache_test.cc",
"unit/buffer_view_test.cc",
"unit/command_handler_test.cc",
"unit/disk_struct_test.cc",
"unit/format_test.cc",
"unit/fsck_test.cc",
"unit/inspector_test.cc",
"unit/journal_integration_fixture.cc",
"unit/journal_test.cc",
"unit/lazy_buffer_test.cc",
"unit/lazy_reader_test.cc",
"unit/loader_test.cc",
"unit/minfs_inspector_test.cc",
"unit/mkfs_test.cc",
"unit/mount_test.cc",
"unit/parser_test.cc",
"unit/resizeable_array_buffer_test.cc",
"unit/rw_test.cc",
"unit/superblock_test.cc",
"unit/transaction_limits_test.cc",
"unit/transaction_test.cc",
"unit/truncate_test.cc",
"unit/unlink_test.cc",
"unit/vnode_mapper_test.cc",
]
deps = [
"//sdk/fidl/fuchsia.minfs:fuchsia.minfs_llcpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/storage/block_client/cpp",
"//src/lib/storage/block_client/cpp:fake_device",
"//src/lib/storage/fs_management",
"//src/storage/fvm",
"//src/storage/lib/disk_inspector",
"//src/storage/minfs",
"//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/bitmap",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zxc",
"//zircon/third_party/ulib/cksum",
"//zircon/third_party/ulib/safemath",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
test("minfs-integration") {
sources = [
"integration/backup_superblock.cc",
"integration/mount_test.cc",
"integration/power_test.cc",
]
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/fidl/fuchsia.minfs:fuchsia.minfs_llcpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/storage/fs_management",
"//src/storage/fs_test",
"//src/storage/fvm",
"//src/storage/minfs",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/zx",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
test("minfs_dirty_cache_integration") {
sources = [ "integration/dirty_cache_test.cc" ]
deps = [
"//sdk/fidl/fuchsia.fs",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/fidl/fuchsia.minfs:fuchsia.minfs_llcpp",
"//src/lib/fxl/test:gtest_main",
"//src/storage/fs_test",
"//src/storage/minfs",
"//src/storage/testing:storage_driver_test_support",
"//third_party/googletest:gtest",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zxc",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
test("minfs-power") {
sources = [ "integration/power_test.cc" ]
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//src/lib/fxl/test:gtest_main",
"//src/storage/fs_test",
"//src/storage/memfs",
"//src/storage/minfs",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/zx",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
# To run this use the component name below: "minfs-integration-fs-tests"
test("fs_tests") {
sources = [ "integration/fs_tests.cc" ]
deps = [
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_llcpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/fidl/fuchsia.minfs:fuchsia.minfs_c",
"//sdk/lib/fdio",
"//src/lib/fxl/test:gtest_main",
"//src/storage/fs_test",
"//src/storage/fvm",
"//src/storage/minfs",
"//third_party/googletest:gmock",
"//zircon/system/ulib/fdio-caller",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
test("minfs_component_runner_test") {
output_name = "minfs_component_runner_test"
sources = [ "integration/minfs_component_runner_test.cc" ]
deps = [
"//sdk/fidl/fuchsia.fs:fuchsia.fs_llcpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/lib/fdio",
"//src/lib/fxl/test:gtest_main",
"//src/lib/storage/block_client/cpp:fake_device",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_llcpp",
"//src/storage/minfs",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/id_allocator",
"//zircon/system/ulib/service:service-llcpp",
"//zircon/system/ulib/zx",
]
}
storage_driver_test_realm_v2_component("minfs-integration-fs-tests") {
deps = [ ":fs_tests" ]
}
fuzzer("minfs-fuzzer") {
sources = [ "unit/fuzz.cc" ]
deps = [
"//sdk/fidl/fuchsia.minfs:fuchsia.minfs_llcpp",
"//src/lib/storage/block_client/cpp:fake_device",
"//src/storage/minfs",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/bitmap",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zxc",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuzzers_package("minfs-fuzzers") {
cpp_fuzzers = [ ":minfs-fuzzer" ]
}
storage_driver_test_realm_v2_component("minfs-integration-test") {
deps = [ ":minfs-integration" ]
}
storage_driver_test_realm_v2_component("minfs-dirty-cache-integration-test") {
deps = [ ":minfs_dirty_cache_integration" ]
}
storage_driver_test_realm_v2_component("minfs-power-test") {
deps = [ ":minfs-power" ]
}
fuchsia_unittest_component("minfs-unit-test") {
deps = [ ":minfs_unit" ]
manifest = "meta/minfs_unit_test.cml"
}
fuchsia_unittest_component("minfs-component-runner-test") {
deps = [ ":minfs_component_runner_test" ]
}
fs_test_config("minfs") {
timestamp_granularity = 1
supports_hard_links = true
supports_resize = true
max_file_size = 4294950912
has_directory_size_limit = true
supports_fsck_after_every_transaction = true
supports_watch_event_deleted = false
supports_inspect = true
supports_shutdown_on_no_connections = true
options = [
{
description = "MinfsWithFvm"
use_fvm = true
},
{
description = "MinfsWithoutFvm"
use_fvm = false
},
]
}
fs_test_suite("minfs") {
deps = [
":minfs_fs_test_config",
":minfs_validate_fs_test_config",
"//src/storage/bin/minfs",
]
extra_components = [
":minfs-component-runner-test",
":minfs-dirty-cache-integration-test",
":minfs-integration-fs-tests",
":minfs-unit-test",
]
# TODO(fxbug.dev/84622): Flaky test disabled on coverage.
# Please fix the flake and remove the condition below.
if (!is_coverage) {
deps += [ ":minfs-integration-test" ]
}
# TODO(fxbug.dev/84623): Flaky test disabled on coverage.
# Please fix the flake and remove the condition below.
if (!is_coverage) {
deps += [ ":minfs-power-test" ]
}
}
slow_fs_test_suite("minfs") {
deps = [
":minfs_fs_test_config",
":minfs_validate_fs_test_config",
"//src/storage/bin/minfs",
]
}