| # 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_binary.gni") |
| import("//src/developer/ffx/build/ffx_plugin.gni") |
| |
| ffx_plugin("ffx_storage_blackout_fs_tree") { |
| version = "0.1.0" |
| edition = "2021" |
| args_sources = [ "src/args.rs" ] |
| sources = [ "src/lib.rs" ] |
| deps = [ "//tools/blackout/blackout-host" ] |
| } |
| |
| rustc_binary("blackout-minfs-tree-target-bin") { |
| output_name = "blackout_minfs_tree_target_bin" |
| with_unit_tests = true |
| testonly = true |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/storage/fs_management/rust:fs_management", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:tracing", |
| "//tools/blackout/blackout-target", |
| ] |
| data_deps = [ "//src/storage/bin/minfs" ] |
| source_root = "src/target.rs" |
| sources = [ "src/target.rs" ] |
| rustenv = [ "DATA_FILESYSTEM_FORMAT=minfs" ] |
| } |
| |
| fuchsia_component("blackout-minfs-tree-target-component") { |
| testonly = true |
| deps = [ ":blackout-minfs-tree-target-bin" ] |
| manifest = "meta/blackout_minfs_tree_target.cml" |
| } |
| |
| fuchsia_package("blackout-minfs-tree-target") { |
| testonly = true |
| deps = [ ":blackout-minfs-tree-target-component" ] |
| } |
| |
| rustc_binary("blackout-fxfs-tree-target-bin") { |
| output_name = "blackout_fxfs_tree_target_bin" |
| with_unit_tests = true |
| testonly = true |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/storage/fs_management/rust:fs_management", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:tracing", |
| "//tools/blackout/blackout-target", |
| ] |
| data_deps = [ |
| "//src/storage/fxfs", |
| "//src/storage/fxfs-crypt", |
| ] |
| source_root = "src/target.rs" |
| sources = [ "src/target.rs" ] |
| rustenv = [ "DATA_FILESYSTEM_FORMAT=fxfs" ] |
| } |
| |
| fuchsia_component("blackout-fxfs-tree-target-component") { |
| testonly = true |
| deps = [ |
| ":blackout-fxfs-tree-target-bin", |
| "//src/storage/fs_test:test_crypt_service", |
| "//src/storage/fxfs:fxfs_component", |
| "//src/storage/fxfs:test_fxfs_component_manifest_shard", |
| ] |
| manifest = "meta/blackout_fxfs_tree_target.cml" |
| } |
| |
| fuchsia_package("blackout-fxfs-tree-target") { |
| testonly = true |
| deps = [ ":blackout-fxfs-tree-target-component" ] |
| } |
| |
| if (is_host) { |
| host_test("blackout-fxfs-tree-host") { |
| binary_path = "$root_out_dir/ffx" |
| args = [ |
| "--config", |
| "storage_dev=true", |
| "storage", |
| "blackout", |
| "fs-tree", |
| "--bootserver", |
| "--dmc-reboot", |
| "--format", |
| "fxfs", |
| ] |
| |
| deps = [ "//src/developer/ffx:ffx_bin" ] |
| |
| environments = [ |
| { |
| dimensions = { |
| testbed = "pwr_sherlock" |
| pool = "fuchsia.tests.power-failure" |
| device_type = "Sherlock" |
| } |
| tags = [ "power-failure-sherlock" ] |
| netboot = true |
| }, |
| ] |
| } |
| } |
| |
| group("fs-tree") { |
| testonly = true |
| public_deps = [ |
| ":blackout-fxfs-tree-target", |
| ":blackout-minfs-tree-target", |
| ] |
| } |
| |
| group("integration") { |
| testonly = true |
| deps = [ |
| ":blackout-fxfs-tree-host($host_toolchain)", |
| ":blackout-fxfs-tree-target", |
| ] |
| } |