| # 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/components.gni") |
| import("//build/rust/rustc_test.gni") |
| import( |
| "//src/lib/testing/expectation/fuchsia_test_with_expectations_package.gni") |
| |
| rustc_test("network-test-realm") { |
| edition = "2024" |
| output_name = "network_test_realm_integration_test" |
| deps = [ |
| "unreliable-echo:lib", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//sdk/fidl/fuchsia.net.dhcpv6:fuchsia.net.dhcpv6_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//sdk/fidl/fuchsia.net.interfaces.admin:fuchsia.net.interfaces.admin_rust", |
| "//sdk/fidl/fuchsia.net.root:fuchsia.net.root_rust", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust", |
| "//sdk/rust/zx", |
| "//src/connectivity/lib/fidl_fuchsia_net_dhcpv6_ext", |
| "//src/connectivity/lib/net-declare", |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/lib/packet-formats", |
| "//src/connectivity/lib/packet-formats-dhcp", |
| "//src/connectivity/network/testing/netemul/rust:lib", |
| "//src/connectivity/network/testing/network-test-realm/fidl:fuchsia.net.test.realm_rust", |
| "//src/connectivity/network/testing/network-test-realm/service:network_test_realm", |
| "//src/connectivity/network/tests/integration/common:netstack_testing_common", |
| "//src/connectivity/network/tests/integration/macros:netstack_testing_macros", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/fidl_fuchsia_net_interfaces_ext", |
| "//src/lib/network/packet", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:derivative", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:test-case", |
| "//third_party/rust_crates:uuid", |
| ] |
| sources = [ "src/lib.rs" ] |
| configs += [ "//build/config/rust/lints:deny_unused_results" ] |
| } |
| |
| fuchsia_test_component("network-test-realm-integration-test") { |
| manifest = "meta/network-test-realm-integration-test.cml" |
| deps = [ ":network-test-realm" ] |
| } |
| |
| package_deps = [ |
| # used as test stubs for testing start-stub, stop-stub, and poll-udp. |
| "unreliable-echo:unreliable-echo-v4", |
| "unreliable-echo:unreliable-echo-v6", |
| |
| # netemul-sandbox is used to create hermetic test realms. |
| "//src/connectivity/network/testing/netemul/service:netemul-sandbox", |
| |
| # controller is used to interact with the Network Test Realm. |
| "//src/connectivity/network/testing/network-test-realm/service:controller", |
| |
| # component-debug corresponds to a Netstack3 instance configured by netemul. |
| "//src/connectivity/network/netstack3:component-debug", |
| |
| # expectations comparer |
| "//src/lib/testing/expectation:expectation_comparer", |
| ] |
| |
| name = "network-test-realm-integration-test" |
| no_err_logs_name = "${name}-no-err-logs" |
| fuchsia_test_with_expectations_package("${no_err_logs_name}") { |
| test_components = [ ":${name}" ] |
| expectations = "expects/network-test-realm.json5" |
| treatment_of_cases_with_error_logs = "SKIP_CASES_WITH_ERROR_LOGS" |
| deps = package_deps |
| test_specs = { |
| parallel = 1 |
| } |
| } |
| |
| with_err_logs_name = "${name}-with-err-logs" |
| fuchsia_test_with_expectations_package("${with_err_logs_name}") { |
| test_components = [ ":${name}" ] |
| expectations = "expects/network-test-realm.json5" |
| treatment_of_cases_with_error_logs = "RUN_ONLY_CASES_WITH_ERROR_LOGS" |
| deps = package_deps |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":${no_err_logs_name}", |
| ":${with_err_logs_name}", |
| ] |
| } |