blob: ebd362703d1ea285b9e420a48e545e54f3bacc55 [file]
# 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_binary.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
import("//src/sys/pkg/bin/system-update-checker/ota_config.gni")
rustc_binary("bin") {
name = "system_update_checker"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/io_util",
"//garnet/lib/rust/sysconfig-client",
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite-rustc",
"//sdk/fidl/fuchsia.update:fuchsia.update-rustc",
"//sdk/fidl/fuchsia.update.channel:fuchsia.update.channel-rustc",
"//sdk/fidl/fuchsia.update.channelcontrol:fuchsia.update.channelcontrol-rustc",
"//src/lib/diagnostics/inspect/contrib/rust",
"//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-url",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer-rustc",
"//src/sys/pkg/lib/async-generator",
"//src/sys/pkg/lib/event-queue",
"//src/sys/pkg/lib/fidl-fuchsia-update-ext",
"//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext",
"//src/sys/pkg/lib/fuchsia-hash",
"//src/sys/pkg/lib/system-health-check",
"//src/sys/pkg/lib/update-package",
"//third_party/rust_crates:anyhow",
"//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:thiserror",
]
test_deps = [
"//src/sys/pkg/testing/mock-reboot",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:proptest-derive",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/apply.rs",
"src/channel.rs",
"src/channel_handler.rs",
"src/check.rs",
"src/config.rs",
"src/connect.rs",
"src/errors.rs",
"src/last_update_storage.rs",
"src/main.rs",
"src/poller.rs",
"src/rate_limiter.rs",
"src/update_manager.rs",
"src/update_monitor.rs",
"src/update_service.rs",
]
}
package("system-update-checker") {
deps = [ ":bin" ]
binaries = [
{
name = "system_update_checker"
dest = "system-update-checker"
},
]
meta = [
{
path = rebase_path("meta/system-update-checker.cmx")
dest = "system-update-checker.cmx"
},
]
}
test_package("system-update-checker-tests") {
deps = [
":bin_test",
"//third_party/sbase:test_bin",
]
tests = [
{
name = "system_update_checker_bin_test"
dest = "system-update-checker-bin-test"
environments = basic_envs
},
]
binaries = [
{
name = "test-shell-command"
source = "test"
},
]
meta = [
{
path = rebase_path(
"//src/sys/pkg/bin/system-update-checker/meta/test-shell-command.cmx")
dest = "test-shell-command.cmx"
},
]
}
ota_config("auto_update") {
# Check for updates every 60 minutes
poll_frequency_minutes = 60
}
config_data("config") {
for_pkg = "sysmgr"
outputs = [ "system_update_checker_sysmgr.config" ]
sources = [ "sysmgr.config" ]
}
group("tests") {
testonly = true
public_deps = [ ":system-update-checker-tests" ]
}