blob: 58c5cb36eee044758327b4c943acf7d3e50de7b7 [file] [log] [blame]
# Copyright 2020 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_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_test("driver") {
name = "usb_system_update_checker_integration_test"
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.update.usb:fuchsia.update.usb-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer-rustc",
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//src/sys/pkg/lib/isolated-swd",
"//src/sys/pkg/lib/update-package",
"//src/sys/pkg/lib/version",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
]
sources = [ "src/lib.rs" ]
}
generate_manifest("empty-repo.manifest") {
visibility = [ ":*" ]
testonly = true
sources = []
args = []
foreach(path,
[
"keys/root.json",
"keys/snapshot.json",
"keys/targets.json",
"keys/timestamp.json",
"repository/1.root.json",
"repository/1.snapshot.json",
"repository/1.targets.json",
"repository/root.json",
"repository/snapshot.json",
"repository/targets.json",
"repository/timestamp.json",
]) {
source = "//src/sys/pkg/tests/pkg-resolver/template/${path}"
sources += [ source ]
args += [ "--entry=empty-repo/${path}=" + rebase_path(source) ]
}
}
empty_repo_manifest_outputs = get_target_outputs(":empty-repo.manifest")
empty_repo_manifest = empty_repo_manifest_outputs[0]
test_package("usb-system-update-checker-integration-tests") {
extra = [ empty_repo_manifest ]
deps = [
":driver",
":empty-repo.manifest",
"//garnet/go/src/grand_unified_binary",
"//src/storage/bin/blobfs",
"//src/sys/pkg/bin/grand-swd-binary",
"//src/sys/pkg/bin/pkg-cache:bin",
"//src/sys/pkg/bin/pm:pm_bin",
"//src/sys/pkg/bin/usb-system-update-checker:bin",
]
binaries = [
{
name = "blobfs"
},
{
name = "pkg-cache"
source = "pkg_cache"
},
{
name = "pkg-resolver"
source = "grand_swd_binary"
},
{
name = "pkgsvr"
source = "grand_unified_binary"
},
{
name = "pm"
},
{
name = "usb_system_update_checker"
},
]
meta = [
{
path = rebase_path(
"//src/sys/pkg/bin/usb-system-update-checker/meta/usb-system-update-checker-isolated.cmx")
dest = "usb-system-update-checker-isolated.cmx"
},
{
path =
rebase_path("//src/sys/pkg/bin/pkg-cache/meta/pkg-cache-isolated.cmx")
dest = "pkg-cache.cmx"
},
{
path = rebase_path(
"//src/sys/pkg/bin/pkg-resolver/meta/pkg-resolver-isolated.cmx")
dest = "pkg-resolver.cmx"
},
]
resources = [
{
path = rebase_path("//src/sys/pkg/lib/fuchsia-pkg-testing/certs/ca.cert")
dest = "ssl/cert.pem"
},
]
tests = [
{
log_settings = {
max_severity = "ERROR"
}
name = "usb_system_update_checker_integration_test"
dest = "usb-system-update-checker-integration-test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
public_deps = [
":usb-system-update-checker-integration-tests",
"//src/lib/storage/ramdevice_client:ramdisk-isolated-devmgr",
]
}