blob: 76efd86d04aac4bedc5fd1c52a7d23b6cdf0c76a [file] [log] [blame]
# 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/package.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.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/inspect/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-url",
"//src/lib/http-sse:http_sse",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/lib/fuchsia_backoff",
"//src/sys/pkg/bin/pkg-local-mirror:lib",
"//src/sys/pkg/lib/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: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/repo.rs",
"src/serve.rs",
"src/serve/handler.rs",
"src/system_image.rs",
"src/update_package.rs",
]
inputs = [
"certs/server.rsa",
"certs/server.certchain",
]
}
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",
]
}
test_package("fuchsia-pkg-testing-tests") {
deps = [
":fuchsia-pkg-testing_test",
":pkgfs-test",
"//garnet/go/src/grand_unified_binary",
"//src/storage/bin/blobfs",
]
binaries = [
{
name = "blobfs"
},
{
name = "pkgsvr"
source = "grand_unified_binary"
},
]
tests = [
{
name = "fuchsia_pkg_testing_lib_test"
dest = "fuchsia-pkg-testing-tests"
environments = basic_envs
},
{
name = "pkgfs_test"
dest = "pkgfs-test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
public_deps = [
":fuchsia-pkg-testing-tests",
"//src/lib/storage/ramdevice_client:ramdisk-isolated-devmgr",
"//src/sys/pkg/bin/pm:pm",
]
}