| # 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/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_library("fuchsia-pkg-testing") { |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-hyper", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/fuchsia-url", |
| "//src/lib/http-sse:http_sse", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/pkg/bin/pkg-local-mirror:lib", |
| "//src/sys/pkg/lib/far/rust:fuchsia-archive", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//src/sys/pkg/lib/system-image", |
| "//src/sys/pkg/lib/update-package", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:http", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:maybe-owned", |
| "//third_party/rust_crates:openat", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:rustls", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:tokio", |
| "//third_party/rust_crates:tokio-rustls", |
| "//third_party/rust_crates:walkdir", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:matches" ] |
| |
| sources = [ |
| "src/fake_pkg_local_mirror.rs", |
| "src/inspect.rs", |
| "src/lib.rs", |
| "src/package.rs", |
| "src/process.rs", |
| "src/repo.rs", |
| "src/serve.rs", |
| "src/serve/handler.rs", |
| "src/system_image.rs", |
| "src/update_package.rs", |
| ] |
| |
| inputs = [ |
| "certs/server.rsa", |
| "certs/server.certchain", |
| ] |
| } |
| |
| fuchsia_component("fuchsia-pkg-testing-tests-component") { |
| testonly = true |
| component_name = "fuchsia-pkg-testing-tests" |
| manifest = "meta/fuchsia-pkg-testing-tests.cmx" |
| deps = [ ":fuchsia-pkg-testing_test" ] |
| } |
| |
| rustc_test("pkgfs_test") { |
| edition = "2018" |
| source_root = "tests/pkgfs_test.rs" |
| deps = [ |
| ":fuchsia-pkg-testing", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/pkgfs", |
| "//src/sys/pkg/testing/blobfs-ramdisk", |
| "//src/sys/pkg/testing/pkgfs-ramdisk", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:openat", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| sources = [ |
| "tests/get_buffer.rs", |
| "tests/pkgfs_test.rs", |
| ] |
| } |
| |
| fuchsia_component("pkgfs-test-component") { |
| testonly = true |
| component_name = "pkgfs-test" |
| manifest = "meta/pkgfs-test.cmx" |
| deps = [ ":pkgfs_test" ] |
| } |
| |
| fuchsia_test_package("fuchsia-pkg-testing-tests") { |
| test_components = [ |
| ":fuchsia-pkg-testing-tests-component", |
| ":pkgfs-test-component", |
| ] |
| deps = [ |
| "//src/storage/bin/blobfs", |
| "//src/sys/pkg/bin/pkgfs:pkgsvr", |
| "//src/sys/pkg/bin/pm:pm_bin", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":fuchsia-pkg-testing-tests", |
| "//src/lib/storage/ramdevice_client:ramdisk-isolated-devmgr", |
| "//src/sys/pkg/bin/pm:pm", |
| ] |
| } |