| # 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/sysconfig-client", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite-rustc", |
| "//sdk/fidl/fuchsia.recovery:fuchsia.recovery-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-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/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-url", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/inspect/rust/fuchsia-inspect-contrib", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/pkg/lib/event-queue", |
| "//src/sys/pkg/lib/fidl-fuchsia-update-ext", |
| "//src/sys/pkg/lib/forced-fdr", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/system-health-check", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:proptest", |
| "//third_party/rust_crates:proptest-derive", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| "//zircon/system/fidl/fuchsia-cobalt:fuchsia-cobalt-rustc", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| ] |
| } |
| |
| 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" ] |
| } |