blob: 742751e9d37a5798979d8d48dfab166a83165ba5 [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_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_test("driver") {
name = "system_updater_test"
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.paver:fuchsia.paver-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.space:fuchsia.space-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//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/fidl-fuchsia-update-installer-ext",
"//src/sys/pkg/lib/fuchsia-pkg",
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib",
"//src/sys/pkg/testing/mock-paver",
"//src/sys/pkg/testing/mock-reboot",
"//src/sys/pkg/testing/mock-resolver",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:chrono",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:log",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/board.rs",
"src/channel.rs",
"src/cobalt_metrics.rs",
"src/fetch_packages.rs",
"src/history.rs",
"src/lib.rs",
"src/mode_force_recovery.rs",
"src/mode_normal.rs",
"src/progress_reporting.rs",
"src/reboot_controller.rs",
"src/update_package.rs",
"src/writes_firmware.rs",
"src/writes_images.rs",
]
}
test_package("system-updater-integration-tests") {
deps = [
":driver",
"//src/sys/pkg/bin/system-updater:bin",
]
binaries = [
{
name = "system-updater"
source = "system_updater"
},
]
resources = [
{
path = rebase_path("//src/sys/pkg/bin/system-updater/images")
dest = "images"
},
]
meta = [
{
path = rebase_path(
"//src/sys/pkg/bin/system-updater/meta/system-updater-isolated.cmx")
dest = "system-updater.cmx"
},
]
tests = [
{
name = "system_updater_test"
dest = "system-updater-test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
public_deps = [ ":system-updater-integration-tests" ]
}