blob: 9370f78bb56c2987c9192d34543807a41f4e16aa [file] [log] [blame]
# Copyright 2022 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("//build/rust/rustc_library.gni")
import("//build/testing/perf/test.gni")
import("//src/storage/testing/driver_test_realm.gni")
rustc_library("framework") {
testonly = true
edition = "2021"
name = "fuchsia_storage_benchmarks_lib"
sources = [
"src/block_devices.rs",
"src/filesystems/blobfs.rs",
"src/filesystems/f2fs.rs",
"src/filesystems/fxblob.rs",
"src/filesystems/fxfs.rs",
"src/filesystems/memfs.rs",
"src/filesystems/minfs.rs",
"src/filesystems/mod.rs",
"src/filesystems/pkgdir.rs",
"src/filesystems/testing.rs",
"src/lib.rs",
]
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.hardware.block:fuchsia.hardware.block_rust",
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/lib/fuchsia-fs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/benchmarks:framework",
"//src/storage/benchmarks/fuchsia/pkgdir-component/fidl/test.pkgdir:test.pkgdir_rust",
"//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/storage/lib/vfs/rust:vfs",
"//src/storage/testing/rust:storage-isolated-driver-manager",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
]
}
rustc_binary("fuchsia-storage-benchmarks") {
edition = "2021"
testonly = true
name = "fuchsia_storage_benchmarks"
sources = [
"src/blob_benchmarks.rs",
"src/blob_loader.rs",
"src/main.rs",
]
deps = [
":framework",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-runtime",
"//src/lib/trace/rust:trace-provider",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/benchmarks:framework",
"//src/storage/lib/delivery_blob",
"//src/storage/lib/trace",
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:rand_xorshift",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/lib/fuchsia-runtime",
"//src/lib/test_util",
"//src/sys/test_runners:tmp_storage",
]
with_unit_tests = true
}
fuchsia_test_component("fuchsia-storage-benchmarks-component") {
component_name = "storage-benchmarks"
manifest = "meta/storage-benchmarks.cml"
deps = [ ":fuchsia-storage-benchmarks" ]
test_type = "device"
}
fuchsia_test_package("storage-benchmarks") {
test_components = [ ":fuchsia-storage-benchmarks-component" ]
# Prevent this test from being run as a target-side test, because it
# is run by a host-side wrapper.
test_specs = {
environments = []
}
deps = [
"//src/storage/benchmarks/fuchsia/pkgdir-component:production-component-and-config",
"//src/storage/blobfs/bin:blobfs-component",
"//src/storage/f2fs/bin:f2fs-component",
"//src/storage/fxfs:fxfs_component",
"//src/storage/fxfs-crypt",
"//src/storage/memfs:memfs_component",
"//src/storage/minfs/bin:minfs-component",
]
}
storage_driver_test_realm_v2_component(
"fuchsia-storage-benchmarks-tests-component") {
component_name = "fuchsia-storage-benchmarks-tests"
manifest = "meta/fuchsia-storage-benchmarks-tests.cml"
deps = [ ":fuchsia-storage-benchmarks_test" ]
}
fuchsia_test_package("fuchsia-storage-benchmarks-tests") {
test_components = [ ":fuchsia-storage-benchmarks-tests-component" ]
deps = [
"//src/storage/benchmarks/fuchsia/pkgdir-component:production-component-and-config",
"//src/storage/blobfs/bin:blobfs-component",
"//src/storage/f2fs/bin:f2fs-component",
"//src/storage/fxfs:fxfs_component",
"//src/storage/fxfs-crypt",
"//src/storage/memfs:memfs_component",
"//src/storage/minfs/bin:minfs-component",
]
test_specs = {
parallel = 1
log_settings = {
max_severity = "ERROR"
}
}
}
fuchsia_component_perf_test("storage_benchmarks") {
package = ":storage-benchmarks"
component_name = "storage-benchmarks"
expected_metric_names_filepath =
"//src/tests/end_to_end/perf/expected_metric_names/fuchsia.storage.txt"
results_path_test_arg = "--output-fuchsiaperf"
test_type = "device"
# We don't enable this test on Astro because of the potential for it to cause extra flash wear
# on that device type.
environments = performance_testing_environments - [ astro_env ]
}
group("benchmarks") {
testonly = true
deps = [ ":storage_benchmarks" ]
}
group("tests") {
testonly = true
deps = [ ":fuchsia-storage-benchmarks-tests" ]
}
group("benchmark-packages") {
testonly = true
deps = [ ":storage-benchmarks" ]
}