blob: b39a50dd81a09a32ee96db5ab9d19168de79c364 [file] [edit]
# Copyright 2025 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/rust/rustc_binary.gni")
import("//src/storage/fshost/fshost.gni")
import("//src/storage/testing/driver_test_realm.gni")
rustc_binary("bin") {
name = "block_relay"
edition = "2024"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.component.sandbox:fuchsia.component.sandbox_rust",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_rust",
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust",
"//sdk/fidl/fuchsia.storage.block:fuchsia.storage.block_rust",
"//sdk/rust/zx",
"//src/devices/bind/fuchsia.block.gpt:fuchsia.block.gpt_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-runtime",
"//src/storage/lib/vfs/rust:vfs",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:zerocopy",
]
sources = [ "src/main.rs" ]
}
fuchsia_component("component") {
component_name = "block-relay"
manifest = "meta/block-relay.cml"
deps = [ ":bin" ]
}
fuchsia_package("block-relay") {
deps = [ ":component" ]
}
fuchsia_unittest_package("block-relay-tests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [
":block-relay-integration-tests",
":block-relay-tests",
]
}
rustc_test("block_relay_integration_test") {
edition = "2024"
source_root = "src/integration_test.rs"
sources = [ "src/integration_test.rs" ]
deps = [
"testing/fidl:fuchsia.testing.simple_rust",
"//sdk/fidl/fuchsia.component.test:fuchsia.component.test_rust",
"//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_rust",
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust",
"//sdk/fidl/fuchsia.hardware.ramdisk:fuchsia.hardware.ramdisk_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.storage.block:fuchsia.storage.block_rust",
"//sdk/lib/driver_test_realm/realm_builder/rust",
"//sdk/rust/zx",
"//src/devices/bind/fuchsia.platform:fuchsia.platform_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/lib/fuchsia-fs",
"//src/storage/fshost/config",
"//src/storage/fshost/testing",
"//src/storage/gpt/rust:gpt",
"//src/storage/lib/block_client/rust:block-client",
"//src/storage/lib/block_server:vmo_backed_block_server",
"//src/storage/lib/ramdevice_client/rust",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
}
storage_driver_test_realm_component("block-relay-integration-test") {
deps = [ ":block_relay_integration_test" ]
}
fshost_component_and_config("test-fshost") {
testonly = true
options = {
storage_host = true
}
}
fuchsia_test_package("block-relay-integration-tests") {
test_components = [ ":block-relay-integration-test" ]
deps = [
":component",
":test-fshost",
"testing/toy-driver",
]
}