| # 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| rustc_binary("bin") { |
| name = "ext4_readonly" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/ext4/lib/parser", |
| "//src/storage/ext4/read-only:ext4-read-only", |
| "//src/storage/ext4/server/fidl:ext4_readonly_rust", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| rustc_test("ext4_server_integration_test") { |
| source_root = "tests/ext4_server_test.rs" |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/scoped_task", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/ext4/server/fidl:ext4_readonly_rust", |
| "//src/storage/lib/block_client/rust:remote-block-device", |
| "//src/storage/lib/ramdevice_client/rust:ramdevice_client", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:sha2", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| data_deps = [ ":bin" ] |
| |
| sources = [ "tests/ext4_server_test.rs" ] |
| } |
| |
| group("server") { |
| deps = [ ":ext4_readonly" ] |
| } |
| |
| fuchsia_component("ext4_readonly_comp") { |
| component_name = "ext4_readonly" |
| manifest = "meta/ext4_readonly.cml" |
| deps = [ ":bin" ] |
| } |
| |
| core_shard("ext4_readonly_shard") { |
| shard_file = "meta/ext4_readonly.core_shard.cml" |
| } |
| |
| fuchsia_package("ext4_readonly") { |
| deps = [ ":ext4_readonly_comp" ] |
| } |
| |
| fuchsia_unittest_package("ext4_server_tests") { |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_component("ext4_server_integration_test_comp") { |
| testonly = true |
| component_name = "ext4_server_integration_test" |
| manifest = "meta/ext4_server_integration_test.cml" |
| deps = [ ":ext4_server_integration_test" ] |
| } |
| |
| resource("ext4_server_integration_test_data") { |
| testonly = true |
| sources = [ |
| "../read-only/test_files/1file.img", |
| "../read-only/test_files/extents.img", |
| "../read-only/test_files/nest.img", |
| ] |
| outputs = [ "data/{{source_file_part}}" ] |
| } |
| |
| fuchsia_test_package("ext4_server_integration_tests") { |
| test_components = [ ":ext4_server_integration_test_comp" ] |
| deps = [ |
| ":ext4_readonly_comp", |
| ":ext4_server_integration_test_data", |
| "//src/storage/testing:storage_driver_test_realm", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ext4_server_integration_tests", |
| ":ext4_server_tests", |
| ] |
| } |