| # Copyright 2022 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/assembly/assembled_system.gni") |
| import("//build/assembly/board_configuration.gni") |
| import("//build/assembly/product_assembly_configuration.gni") |
| import("//src/storage/fshost/generated_fshost_config.gni") |
| import("//src/sys/core/build/core.gni") |
| |
| # Wraps assembled_system to allow adding internal network-conformance test stubs. |
| # |
| # Parameters |
| # |
| # additional_base_packages |
| # Additional package labels to include in the `base_packages` passed to `assembled_system`. |
| # |
| template("assemble_network_conformance_system") { |
| _image_name = target_name |
| |
| labels = { |
| product_config = "${target_name}.product_assembly_config" |
| product_config_fxfs = "${target_name}.product_assembly_config_fxfs" |
| board_config = "${target_name}.board_config" |
| } |
| |
| core_realm_definition("core") { |
| testonly = true |
| } |
| |
| board_configuration(labels.board_config) { |
| name = "network-conformance" |
| filesystems = { |
| fvm = { |
| slice_size = 1048576 |
| sparse_output = { |
| } |
| } |
| } |
| if (target_cpu == "x64") { |
| input_bundles = [ |
| "//boards/x64:x64_common", |
| "//boards/emulation/virtio", |
| ] |
| } |
| } |
| |
| product_assembly_configuration(labels.product_config) { |
| platform = { |
| build_type = "eng" |
| intl = { |
| config_type = "none" |
| } |
| storage = { |
| filesystems = { |
| image_name = _image_name |
| volume = { |
| fvm = { |
| data = { |
| } |
| blob = { |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| product_assembly_configuration(labels.product_config_fxfs) { |
| platform = { |
| build_type = "eng" |
| intl = { |
| config_type = "none" |
| } |
| storage = { |
| filesystems = { |
| image_name = _image_name |
| } |
| } |
| } |
| } |
| |
| assembled_system(target_name) { |
| testonly = true |
| |
| if (!fxfs_blob) { |
| product_assembly_config_label = ":${labels.product_config}" |
| generate_fvm = true |
| } else { |
| product_assembly_config_label = ":${labels.product_config_fxfs}" |
| generate_fxfs = true |
| } |
| ramdisk_in_zbi = true |
| |
| board_config_label = ":${labels.board_config}" |
| allow_eng_platform_bundle_use = true |
| base_packages = [ |
| "//src/connectivity/network/net-cli", |
| "//src/connectivity/network/testing/network-test-realm/service:network-test-realm", |
| ] |
| base_packages += invoker.additional_base_packages |
| |
| core_realm_definition = ":core" |
| |
| additional_boot_args = [ "virtcon.disable=true" ] |
| cmdline = [ "kernel.halt-on-panic=true" ] |
| |
| bootfs_labels = [ "//build/input:recovery_bootfs" ] |
| } |
| } |