blob: 27d0cc01ad02e5eb7d2953a5b9c91a0b640d9412 [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/test.gni")
fuchsia_package("package") {
package_name = "blobfs"
deps = [
":component",
"//src/storage/blobfs:decompressor-sandbox",
]
}
visibility = [ "//src/storage/*" ]
declare_args() {
# The number of pager threads to spawn for blobfs.
blobfs_num_pager_threads = 2
}
executable("blobfs") {
visibility += [ "//src/storage/lib/fs_management/cpp:fs-management-test" ]
sources = [ "main.cc" ]
deps = [
":blobfs-component-config",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_cpp",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/fdio",
"//sdk/lib/syslog/cpp",
"//src/storage/blobfs",
"//src/storage/lib/block_client/cpp",
"//src/storage/lib/vfs/cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/zx",
]
}
fuchsia_component_manifest("blobfs.cml") {
component_name = "blobfs"
manifest = "meta/blobfs.cml"
}
fuchsia_component("component") {
cm_label = ":blobfs.cml"
deps = [
":blobfs",
":blobfs-component-config-values",
"//src/storage/blobfs:decompressor-sandbox",
]
}
# Prefer this over the previous target for tests because it includes the required fs_management
# shard.
group("blobfs-component") {
visibility += [
"//src/recovery/system:*",
"//src/security/tests/pkg_test/fshost:*",
"//src/storage/fshost:*",
"//src/storage/lib/fs_management/rust:*",
"//src/sys/pkg/testing/blobfs-ramdisk:*",
"//tools/blackout/blobfs-checkerboard:*",
]
deps = [
":component",
"//src/storage/lib/fs_management:fs_management_shard",
]
}
fuchsia_structured_config_cpp_elf_lib("blobfs-component-config") {
cm_label = ":blobfs.cml"
}
fuchsia_structured_config_values("blobfs-component-config-values") {
cm_label = ":blobfs.cml"
values = {
pager_threads = blobfs_num_pager_threads
}
}
test("blobfs_component_test") {
sources = [ "blobfs_test.cc" ]
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component_cpp",
"//sdk/fidl/fuchsia.fs:fuchsia.fs_cpp",
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_cpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp",
"//sdk/lib/component/incoming/cpp",
"//src/lib/fxl/test:gtest_main",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_cpp",
"//src/storage/testing:storage_driver_test_support",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
fuchsia_component("blobfs-component-test-component") {
testonly = true
manifest = "meta/blobfs_component_test.cml"
deps = [
":blobfs-component",
":blobfs_component_test",
"//src/storage/testing:storage_driver_test_realm",
]
}
fuchsia_test_package("blobfs-component-tests") {
test_components = [ ":blobfs-component-test-component" ]
}
group("tests") {
testonly = true
deps = [ ":blobfs-component-tests" ]
}