blob: 0632293f10c262dff4cab42d5b43675af55d3078 [file] [log] [blame]
# Copyright 2020 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/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
rustc_library("blobfs-stress-test-lib") {
edition = "2018"
source_root = "lib/mod.rs"
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager/testing:test_utils_lib",
"//src/sys/pkg/lib/fuchsia-hash",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log", # for recording messages
"//third_party/rust_crates:rand",
"//third_party/rust_crates:rand_core",
]
sources = [
"lib/blob.rs",
"lib/io.rs",
"lib/mod.rs",
"lib/state.rs",
"lib/utils.rs",
]
}
rustc_test("blobfs-stress-test-bin") {
name = "blobfs_stress_test"
edition = "2018"
source_root = "tests.rs"
deps = [
":blobfs-stress-test-lib",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog", # for initialization
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log", # for recording messages
"//third_party/rust_crates:rand",
"//third_party/rust_crates:rand_core",
]
sources = [ "tests.rs" ]
}
executable("mounter") {
testonly = true
sources = [ "mounter.cc" ]
deps = [
"//sdk/fidl/fuchsia.sys2",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/lib/isolated_devmgr/v2_component",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/block-client",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fs",
"//zircon/system/ulib/fs-management",
"//zircon/system/ulib/fvm",
"//zircon/system/ulib/ramdevice-client",
]
}
test_package("blobfs-stress-test") {
deps = [
":blobfs-stress-test-bin",
":mounter",
"//src/lib/isolated_devmgr/v2_component:isolated-devmgr",
"//src/storage/bin/blobfs:blobfs",
"//src/sys/component_manager:bin",
]
meta = [
{
path =
rebase_path("//src/sys/component_manager/meta/component_manager.cmx")
dest = "component_manager.cmx"
},
{
path = rebase_path("//src/storage/blobfs-stress-test/meta/root.cml")
dest = "root.cm"
},
{
path = rebase_path("//src/storage/blobfs-stress-test/meta/mounter.cml")
dest = "mounter.cm"
},
]
binaries = [
{
name = "component_manager"
},
{
name = "blobfs"
},
{
name = "mounter"
},
]
tests = [
{
name = "blobfs_stress_test"
log_settings = {
max_severity = "ERROR"
}
},
]
}
rustc_binary("blobfs-stressor-cli-bin") {
name = "blobfs_stressor_cli"
edition = "2018"
source_root = "main.rs"
deps = [
":blobfs-stress-test-lib",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:rand_core",
"//third_party/rust_crates:structopt",
]
sources = [ "main.rs" ]
}
package("blobfs-stressor") {
deps = [ ":blobfs-stressor-cli-bin" ]
binaries = [
{
name = "blobfs_stressor_cli"
dest = "blobfs_stressor"
shell = true
},
]
}