blob: 06a6bbe662bab43cd9c3000d2a45d54ef9ea3baa [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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
if (host_toolchain == current_toolchain) {
rustc_binary("blobfs-fsck-soft-host") {
testonly = true
edition = "2018"
deps = [
"//third_party/rust_crates:failure",
"//third_party/rust_crates:structopt",
"//tools/blackout/blackout:blackout-host",
]
source_root = "src/host.rs"
with_unit_tests = true
test_environments = [
{
dimensions = {
device_type = "Astro"
}
tags = [ "power-failure" ]
},
]
}
}
rustc_binary("blobfs-fsck-soft-target-bin") {
with_unit_tests = true
testonly = true
edition = "2018"
deps = [
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-zircon",
"//src/lib/cstr",
"//src/storage/fs-management",
"//src/storage/ramdevice-client",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:structopt",
"//tools/blackout/blackout:blackout-target",
]
source_root = "src/target.rs"
}
generate_manifest("blobfs-load-generator.manifest") {
visibility = [ ":*" ]
args = [ "--binary=bin/blobfs-load-generator" ]
}
generator_manifest_outputs =
get_target_outputs(":blobfs-load-generator.manifest")
generator_manifest_file = generator_manifest_outputs[0]
generate_manifest("blobfs.manifest") {
visibility = [ ":*" ]
args = [ "--binary=bin/blobfs" ]
}
blobfs_manifest_outputs = get_target_outputs(":blobfs.manifest")
blobfs_manifest_file = blobfs_manifest_outputs[0]
package("blobfs-fsck-soft-target") {
testonly = true
extra = [
generator_manifest_file,
blobfs_manifest_file,
]
deps = [
":blobfs-fsck-soft-target-bin",
":blobfs-load-generator.manifest",
":blobfs.manifest",
]
binary = "blobfs_fsck_soft_target_bin"
meta = [
{
path = rebase_path("meta/blobfs_fsck_soft_target.cmx")
dest = "blobfs_fsck_soft_target.cmx"
},
]
}
test_package("blobfs-fsck-soft-target-test") {
extra = [
generator_manifest_file,
blobfs_manifest_file,
]
deps = [
":blobfs-fsck-soft-target-bin_test",
":blobfs-load-generator.manifest",
":blobfs.manifest",
]
tests = [
{
name = "blobfs_fsck_soft_target_bin_bin_test"
environment = basic_envs
},
]
}
group("blobfs-fsck-soft") {
testonly = true
public_deps = [
":blobfs-fsck-soft-host($host_toolchain)",
# this test relies on a c++ application located in zircon for generating load on the blobfs
# partition. it's included in the base image with other zircon utilities. the target is -
# "//zircon/system/uapp/blobfs-load-generator:blobfs-load-generator",
# TODO(ZX-4672): ideally this should be a rust library that can be used in future tests with a
# content verification component.
":blobfs-fsck-soft-target",
]
}
group("tests") {
testonly = true
public_deps = [
":blobfs-fsck-soft-target-test",
]
}