| # Copyright 2020 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/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/connectivity/network/unified_binary/network_unified_binary.gni") |
| import( |
| "//src/lib/testing/expectation/fuchsia_test_with_expectations_package.gni") |
| |
| network_unified_binary("dhcpv6_client") { |
| edition = "2021" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//sdk/fidl/fuchsia.net.dhcpv6:fuchsia.net.dhcpv6_rust", |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name_rust", |
| "//src/connectivity/lib/fidl_fuchsia_net_dhcpv6_ext", |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/lib/packet-formats-dhcp", |
| "//src/connectivity/network/dhcpv6/core", |
| "//src/connectivity/network/lib/dns_server_watcher", |
| "//src/lib/async-utils", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/packet", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:socket2", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| test_deps = [ |
| "//sdk/fidl/fuchsia.net.interfaces.admin:fuchsia.net.interfaces.admin_rust", |
| "//src/connectivity/lib/net-declare", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| sources = [ |
| "src/client.rs", |
| "src/main.rs", |
| "src/provider.rs", |
| ] |
| } |
| |
| network_unified_binary_regular_and_gub_components("component") { |
| component_name = "dhcpv6-client" |
| manifest = "meta/dhcpv6-client.cml" |
| gub_deps = [ ":dhcpv6_client" ] |
| } |
| |
| network_unified_binary_regular_and_gub_packages("package") { |
| package_name = "dhcpv6-client" |
| gub_deps = [ ":component" ] |
| visibility = [ "//bundles/assembly/*" ] |
| } |
| |
| fuchsia_test_component("dhcpv6-client-test") { |
| manifest = "meta/dhcpv6-client-test.cml" |
| deps = [ ":dhcpv6_client_test" ] |
| } |
| |
| fuchsia_test_with_expectations_package("dhcpv6-client-test-with-err-logs") { |
| expectations = "expects/dhcpv6-client-test-expectations.json5" |
| treatment_of_cases_with_error_logs = "RUN_ONLY_CASES_WITH_ERROR_LOGS" |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| test_components = [ ":dhcpv6-client-test" ] |
| deps = [ |
| # The DHCPv6 client creates sockets so it depends on an implementation of |
| # `fuchsia.posix.socket.Provider`. |
| "//src/connectivity/network/netstack:component-debug", |
| ] |
| } |
| |
| fuchsia_test_with_expectations_package("dhcpv6-client-test-no-err-logs") { |
| expectations = "expects/dhcpv6-client-test-expectations.json5" |
| treatment_of_cases_with_error_logs = "SKIP_CASES_WITH_ERROR_LOGS" |
| test_components = [ ":dhcpv6-client-test" ] |
| deps = [ |
| # The DHCPv6 client creates sockets so it depends on an implementation of |
| # `fuchsia.posix.socket.Provider`. |
| "//src/connectivity/network/netstack:component-debug", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":dhcpv6-client-test-no-err-logs", |
| ":dhcpv6-client-test-with-err-logs", |
| ] |
| } |