blob: dbf9e20b18dab43fb42f87a10541dcd5e80a621f [file] [log] [blame]
# Copyright 2023 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_test.gni")
import("//src/connectivity/network/unified_binary/network_unified_binary.gni")
network_unified_binary("bin") {
name = "netstack_proxy"
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.net.stackmigrationdeprecated:fuchsia.net.stackmigrationdeprecated_rust",
"//sdk/fidl/fuchsia.process:fuchsia.process_rust",
"//src/lib/cstr",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/lib/vfs/rust:vfs",
]
sources = [ "src/main.rs" ]
}
rustc_test("netstack_proxy_test") {
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp_rust",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust",
"//sdk/fidl/fuchsia.net.stackmigrationdeprecated:fuchsia.net.stackmigrationdeprecated_rust",
"//sdk/fidl/fuchsia.process:fuchsia.process_rust",
"//src/connectivity/network/testing/netemul/fidl:fuchsia.netemul_rust",
"//src/connectivity/network/testing/netemul/rust:lib",
"//src/lib/async-utils",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/network/fidl_fuchsia_net_interfaces_ext",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:test-case",
]
sources = [ "src/test.rs" ]
source_root = "src/test.rs"
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
network_unified_binary_regular_and_gub_components("component") {
component_name = "netstack-proxy"
manifest = "meta/netstack-proxy.cml"
gub_deps = [
":bin",
"//src/connectivity/network/netstack3:bin",
# TODO(https://fxbug.dev/42076541): Remove this once the DHCP client is
# in the network realm and can get the packet socket provider
# capability from there.
"//src/connectivity/network/dhcpv4/client/bindings:component",
]
non_gub_deps = [ "//src/connectivity/network/netstack:bin" ]
}
fuchsia_test_component("component-test") {
component_name = "netstack-proxy-test"
manifest = "meta/netstack-proxy-test.cml"
deps = [
":component",
":netstack_proxy_test",
"//src/connectivity/network/testing/netemul/service:netemul-sandbox",
]
}
fuchsia_test_package("netstack-proxy-test") {
test_components = [ ":component-test" ]
}
group("tests") {
testonly = true
deps = [ ":netstack-proxy-test" ]
}