| # 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 = "2024" |
| name = "fuchsia_storage_benchmarks" |
| 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", |
| "src/testing.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.partition:fuchsia.hardware.block.partition_rust", |
| "//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.storage.partitions:fuchsia.storage.partitions_rust", |
| "//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_rust", |
| "//sdk/rust/zx", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/fuchsia-fs", |
| "//src/storage/benchmarks:framework", |
| "//src/storage/benchmarks/fuchsia/pkgdir-component/fidl/test.pkgdir:test.pkgdir_rust", |
| "//src/storage/crypt/policy", |
| "//src/storage/crypt/zxcrypt", |
| "//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_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:log", |
| ] |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//src/storage/gpt/rust", |
| "//src/storage/lib/block_client/rust:block-client", |
| "//src/storage/lib/block_server:vmo_backed_block_server", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| with_unit_tests = true |
| } |
| |
| rustc_binary("fuchsia-storage-benchmarks") { |
| edition = "2024" |
| testonly = true |
| name = "fuchsia_storage_benchmarks" |
| |
| sources = [ |
| "src/blob_benchmarks.rs", |
| "src/blob_loader.rs", |
| "src/main.rs", |
| ] |
| deps = [ |
| ":framework", |
| ":fuchsia-storage-benchmarks-config", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/rust/zx", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/trace/rust:trace-provider", |
| "//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", |
| ] |
| with_unit_tests = true |
| test_deps = [ "//src/lib/test_util" ] |
| } |
| |
| fuchsia_component_manifest("fuchsia-storage-benchmarks-component-manifest") { |
| component_name = "storage-benchmarks" |
| manifest = "meta/storage-benchmarks.cml" |
| } |
| |
| fuchsia_structured_config_rust_lib("fuchsia-storage-benchmarks-config") { |
| name = "fuchsia_storage_benchmarks_config" |
| cm_label = ":fuchsia-storage-benchmarks-component-manifest" |
| } |
| |
| fuchsia_test_component("fuchsia-storage-benchmarks-component") { |
| component_name = "storage-benchmarks" |
| cm_label = ":fuchsia-storage-benchmarks-component-manifest" |
| deps = [ ":fuchsia-storage-benchmarks" ] |
| test_type = "storage" |
| } |
| |
| 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/crypt/fxfs", |
| "//src/storage/f2fs/bin:f2fs-component", |
| "//src/storage/fvm:fvm-component", |
| "//src/storage/fxfs:fxfs_component", |
| "//src/storage/memfs:memfs_component", |
| "//src/storage/minfs/bin:minfs-component", |
| ] |
| } |
| |
| storage_driver_test_realm_component( |
| "fuchsia-storage-benchmarks-lib-tests-component") { |
| manifest = "meta/fuchsia-storage-benchmarks-lib-tests.cml" |
| deps = [ ":framework_test" ] |
| } |
| |
| storage_driver_test_realm_component( |
| "fuchsia-storage-benchmarks-tests-component") { |
| manifest = "meta/fuchsia-storage-benchmarks-tests.cml" |
| deps = [ ":fuchsia-storage-benchmarks_test" ] |
| } |
| |
| fuchsia_test_package("fuchsia-storage-benchmarks-tests") { |
| test_components = [ |
| ":fuchsia-storage-benchmarks-lib-tests-component", |
| ":fuchsia-storage-benchmarks-tests-component", |
| ] |
| deps = [ |
| "//src/storage/benchmarks/fuchsia/pkgdir-component:production-component-and-config", |
| "//src/storage/blobfs/bin:blobfs-component", |
| "//src/storage/crypt/fxfs", |
| "//src/storage/f2fs/bin:f2fs-component", |
| "//src/storage/fxfs:fxfs_component", |
| "//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 = "storage" |
| |
| # 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" ] |
| } |