| # Copyright 2018 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/config/fuchsia/zircon_images.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_test("netstack_fidl_integration_test") { |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/fidl_fuchsia_net_stack_ext", |
| "//garnet/lib/rust/files_async", |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:environment-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:network-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:sandbox-rustc", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:futures-preview", |
| "//zircon/system/fidl/fuchsia-hardware-ethernet:fuchsia-hardware-ethernet-rustc", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", |
| "//zircon/system/fidl/fuchsia-net-stack:fuchsia-net-stack-rustc", |
| "//zircon/system/fidl/fuchsia-posix-socket:fuchsia-posix-socket-rustc", |
| ] |
| } |
| |
| zircon_extras_manifest("device_name_provider_manifest") { |
| visibility = [ ":*" ] |
| manifest = "image" |
| patterns = [ "bin/device-name-provider" ] |
| } |
| |
| package("device_name_provider") { |
| deps = [ |
| ":device_name_provider_manifest", |
| ] |
| extra = get_target_outputs(":device_name_provider_manifest") |
| meta = [ |
| { |
| path = rebase_path("meta/device_name_provider.cmx") |
| dest = "device_name_provider.cmx" |
| }, |
| ] |
| } |
| |
| test_package("netstack_integration_tests") { |
| deps = [ |
| ":netstack_fidl_integration_test", |
| ] |
| |
| tests = [ |
| { |
| name = "netstack_fidl_integration_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |
| |
| test("netstack_bsdsocket_c_api_test") { |
| if (is_linux || is_fuchsia) { |
| sources = [ |
| "bsdsocket_test.cc", |
| "util.cc", |
| "util.h", |
| ] |
| } |
| |
| deps = [ |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| test("netstack_external_network_test_client") { |
| if (is_linux || is_fuchsia) { |
| sources = [ |
| "external_network_test_client.cc", |
| ] |
| } |
| deps = [ |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| test("netstack_fuchsia_c_api_test") { |
| sources = [ |
| "fdio_test.cc", |
| "ioctl_test.cc", |
| "util.cc", |
| "util.h", |
| ] |
| |
| deps = [ |
| "//garnet/public/lib/netstack/c", |
| "//src/lib/fxl/test:gtest_main", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/sync", |
| "//zircon/system/fidl/fuchsia-posix-socket", |
| ] |
| } |
| |
| test("netstack_no_network_test") { |
| sources = [ |
| "no_network_test.cc", |
| ] |
| |
| deps = [ |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| test("name_provider_no_network_test") { |
| sources = [ |
| "name_provider_no_network_test.cc", |
| ] |
| |
| deps = [ |
| ":device_name_provider", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//zircon/system/fidl/fuchsia-device:fuchsia-device_llcpp", |
| ] |
| } |
| |
| test("name_provider_service_not_present_test") { |
| sources = [ |
| "name_provider_service_not_present_test.cc", |
| ] |
| |
| deps = [ |
| ":device_name_provider", |
| "//src/lib/fxl/test:gtest_main", |
| "//zircon/system/fidl/fuchsia-device", |
| ] |
| } |
| |
| group("netemul_empty_binaries") { |
| write_file("$root_out_dir/netstack_external_network_test", "") |
| } |
| |
| test_package("netstack_c_api_tests") { |
| deps = [ |
| ":name_provider_no_network_test", |
| ":name_provider_service_not_present_test", |
| ":netemul_empty_binaries", |
| ":netstack_bsdsocket_c_api_test", |
| ":netstack_external_network_test_client", |
| ":netstack_fuchsia_c_api_test", |
| ":netstack_no_network_test", |
| ] |
| |
| binaries = [ |
| { |
| name = "netstack_external_network_test_client" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/netstack_external_network_test_client.cmx") |
| dest = "netstack_external_network_test_client.cmx" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "name_provider_service_not_present_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "name_provider_no_network_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack_bsdsocket_c_api_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack_external_network_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack_fuchsia_c_api_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack_no_network_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |