blob: c0223ec71aed050aaa60f2251bbdbaf8bd65916b [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/rust/rustc_library.gni")
import("//src/storage/testing/driver_test_realm.gni")
# This does not include any filesystems. Callers should depend on the filesystems they need.
rustc_library("fs_management") {
with_unit_tests = true
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component_rust",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.fs:fuchsia.fs_rust",
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_rust",
"//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/cstr",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-runtime",
"//src/lib/storage/fuchsia-watch",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_rust",
"//src/storage/fxfs:fuchsia.fxfs_rust",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/lib/fuchsia",
"//src/lib/fuchsia-fs",
"//src/lib/storage/block_client/rust:remote-block-device",
"//src/lib/storage/ramdevice_client",
"//src/storage/fs_test:crypt_service",
"//third_party/rust_crates:futures",
]
sources = [
"src/error.rs",
"src/filesystem.rs",
"src/format.rs",
"src/format/constants.rs",
"src/lib.rs",
"src/partition.rs",
]
}
storage_driver_test_realm_v2_component("fs-management-rust-tests-component") {
component_name = "fs-management-rust-tests"
deps = [
":fs_management_test",
"//src/storage/bin/blobfs:blobfs-component",
"//src/storage/bin/f2fs:f2fs-component",
"//src/storage/bin/minfs:minfs-component",
"//src/storage/fxfs:fxfs_component",
"//src/storage/fxfs:test_fxfs_component_manifest_shard",
]
}
rustc_test("open_partition_test") {
edition = "2021"
deps = [
"//src/lib/fuchsia",
"//src/lib/storage/fs_management/rust:fs_management",
"//src/lib/storage/ramdevice_client/rust:ramdevice_client",
"//src/lib/zircon/rust:fuchsia-zircon",
]
sources = [ "tests/open_partition_test.rs" ]
source_root = "tests/open_partition_test.rs"
}
storage_driver_test_realm_v2_component("open_partition_test-component") {
component_name = "open_partition_test-component"
deps = [ ":open_partition_test" ]
}
fuchsia_test_package("fs-management-rust-tests") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [
":fs-management-rust-tests-component",
":open_partition_test-component",
]
deps = [
"//src/storage/bin/factoryfs",
"//src/storage/bin/minfs",
]
}
group("tests") {
testonly = true
deps = [ ":fs-management-rust-tests" ]
}