|  | # 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 = "2024" | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.component:fuchsia.component_rust", | 
|  | "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", | 
|  | "//sdk/fidl/fuchsia.device:fuchsia.device_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.hardware.block.volume:fuchsia.hardware.block.volume_rust", | 
|  | "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | 
|  | "//sdk/fidl/fuchsia.storage.partitions:fuchsia.storage.partitions_rust", | 
|  | "//sdk/rust/zx", | 
|  | "//src/lib/fdio/rust:fdio", | 
|  | "//src/lib/fidl/rust/fidl", | 
|  | "//src/lib/fuchsia-async", | 
|  | "//src/lib/fuchsia-component/client", | 
|  | "//src/lib/fuchsia-fs", | 
|  | "//src/lib/fuchsia-runtime", | 
|  | "//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_rust", | 
|  | "//src/storage/lib/block_client/rust", | 
|  | "//third_party/rust_crates:anyhow", | 
|  | "//third_party/rust_crates:futures", | 
|  | "//third_party/rust_crates:log", | 
|  | "//third_party/rust_crates:thiserror", | 
|  | ] | 
|  | test_deps = [ | 
|  | "//src/lib/fuchsia", | 
|  | "//src/lib/fuchsia-fs", | 
|  | "//src/storage/fs_test:crypt_service", | 
|  | "//src/storage/lib/block_server", | 
|  | "//src/storage/lib/block_server:vmo_backed_block_server", | 
|  | "//src/storage/lib/ramdevice_client", | 
|  | "//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/blobfs/bin:blobfs-component", | 
|  | "//src/storage/f2fs/bin:f2fs-component", | 
|  | "//src/storage/fxfs:fxfs_component", | 
|  | "//src/storage/fxfs:test_fxfs_component_manifest_shard", | 
|  | "//src/storage/minfs/bin:minfs-component", | 
|  | ] | 
|  | } | 
|  |  | 
|  | rustc_test("open_partition_test") { | 
|  | edition = "2024" | 
|  | deps = [ | 
|  | "//sdk/rust/zx", | 
|  | "//src/lib/fuchsia", | 
|  | "//src/storage/lib/fs_management/rust:fs_management", | 
|  | "//src/storage/lib/ramdevice_client/rust:ramdevice_client", | 
|  | ] | 
|  | 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" ] | 
|  | } | 
|  |  | 
|  | rustc_test("static-child-test") { | 
|  | edition = "2024" | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | 
|  | "//src/lib/fuchsia", | 
|  | "//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_rust", | 
|  | "//src/storage/lib/fs_management/rust:fs_management", | 
|  | "//src/storage/lib/ramdevice_client/rust:ramdevice_client", | 
|  | ] | 
|  | sources = [ "tests/static_child_test.rs" ] | 
|  | source_root = "tests/static_child_test.rs" | 
|  | } | 
|  |  | 
|  | fuchsia_unittest_component("static-child-test-component") { | 
|  | manifest = "meta/static_child_test.cml" | 
|  | deps = [ | 
|  | ":static-child-test", | 
|  | "//src/storage/blobfs/bin:component", | 
|  | "//src/storage/fxfs:fxfs_component", | 
|  | "//src/storage/minfs/bin:minfs-component", | 
|  | "//src/storage/testing:storage_driver_test_realm", | 
|  | ] | 
|  | } | 
|  |  | 
|  | 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", | 
|  | ":static-child-test-component", | 
|  | ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ ":fs-management-rust-tests" ] | 
|  | } |