blob: eaaeb870983d63cba23a5eac1a7b0d1456bca5b3 [file] [log] [blame]
# Copyright 2021 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/dart/test.gni")
import("//build/host.gni")
import("//build/images/args.gni")
import("//build/images/custom_signing.gni")
import("//build/testing/host_test_data.gni")
dart_test("flash_script_test") {
sources = [
"flash_script_test.dart",
"utils.dart",
]
deps = [
"//sdk/testing/sl4f/client",
"//third_party/dart-pkg/pub/path",
"//third_party/dart-pkg/pub/test",
]
non_dart_deps = [ ":test_deps($host_toolchain)" ]
environments = [
{
dimensions = {
device_type = "Astro"
}
# Add a tag to make sure this does not run in all builders.
tags = [ "flash-tests" ]
# This is only present to force this test to run in its own shard.
service_account =
"internal-artifacts-readers@fuchsia-infra.iam.gserviceaccount.com"
},
]
}
dart_test("ffx_flash_test") {
sources = [
"ffx_flash_test.dart",
"utils.dart",
]
deps = [
"//third_party/dart-pkg/pub/logging",
"//third_party/dart-pkg/pub/path",
"//third_party/dart-pkg/pub/retry",
"//third_party/dart-pkg/pub/test",
]
non_dart_deps = [
":ffx_deps($host_toolchain)",
":test_deps($host_toolchain)",
]
environments = [
{
dimensions = {
device_type = "Sherlock"
}
# This is only present to force this test to run in its own shard.
service_account =
"internal-artifacts-readers@fuchsia-infra.iam.gserviceaccount.com"
},
]
}
if (is_host) {
host_test_data("test_deps") {
sources = [
"$root_build_dir/flash.json",
"$root_build_dir/flash.sh",
"$root_build_dir/fuchsia.vbmeta",
"$root_build_dir/host_x64/fastboot",
"$root_build_dir/obj/build/images/fuchsia/fuchsia/fvm.fastboot.blk",
"$root_build_dir/zedboot.vbmeta",
]
if (board_name == "astro") {
sources += [
"$root_build_dir/firmware.img",
"$root_build_dir/firmware_bl2.img",
]
} else if (board_name == "sherlock") {
sources += [
"$root_build_dir/firmware_skip_metadata.img",
"$root_build_dir/unlock_creds/unlock_creds.zip",
]
}
foreach(file, bootstrap_files) {
file_name = get_path_info(file.path, "file")
sources += [ "${root_build_dir}/${file_name}" ]
}
if (custom_signing_script != "" || use_vboot) {
sources += [
"$root_build_dir/fuchsia.zbi.signed",
"$root_build_dir/zedboot.zbi.signed",
]
} else {
sources += [
"$root_build_dir/fuchsia.zbi",
"$root_build_dir/zedboot.zbi",
]
}
}
host_test_data("ffx_deps") {
sources = [ "$host_tools_dir/ffx" ]
outputs = [ "$target_gen_dir/runtime_deps/{{source_file_part}}" ]
deps = [ "//src/developer/ffx:host($host_toolchain)" ]
}
}
group("tests") {
testonly = true
deps = []
if (board_name == "astro") {
deps += [ ":flash_script_test($host_toolchain)" ]
}
# TODO(fxbug.dev/91321): Enable test once flakiness is fixed.
# if (board_name == "sherlock") {
# deps += [ ":ffx_flash_test($host_toolchain)" ]
# }
}