blob: 043be2c651e00de6fd0229d89ac2ee88c450714a [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/fshost/generated_fshost_config.gni")
rustc_library("blobfs-ramdisk") {
testonly = true
version = "0.1.0"
edition = "2021"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//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/zircon/rust:fuchsia-zircon",
"//src/storage/blobfs/bin:blobfs-component",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/storage/lib/blob_writer:blob-writer",
"//src/storage/lib/delivery_blob",
"//src/storage/lib/fs_management/rust:fs_management",
"//src/storage/lib/ramdevice_client",
"//src/sys/pkg/lib/blobfs",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:openat",
]
test_deps = [
"//src/storage/lib/ramdevice_client",
"//third_party/rust_crates:assert_matches",
]
sources = [
"src/lib.rs",
"src/test.rs",
]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
# The GN variable `fxfs_blob` sets the structured config that determines whether production
# pkg-cache uses the fuchsa.fxfs/BlobCreator write API. Tests that use the production pkg-cache
# structured config need to know this value so they can create the correct blobfs dependency.
rustenv = [ "FXFS_BLOB=${fxfs_blob}" ]
}
fuchsia_component("test-component") {
testonly = true
manifest = "meta/test_driver.cml"
deps = [
":blobfs-ramdisk_test",
"//src/storage/fxfs:fxfs_component",
"//src/storage/testing:storage_driver_test_realm",
"//src/storage/tools/blobfs-corrupt",
]
}
fuchsia_test_package("unit-tests-package") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
package_name = "blobfs-ramdisk-tests"
test_components = [ ":test-component" ]
}
group("tests") {
testonly = true
public_deps = [ ":unit-tests-package" ]
}