| # Copyright 2019 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/config.gni") |
| import( |
| "//src/lib/testing/expectation/fuchsia_test_component_with_expectations.gni") |
| import( |
| "//src/lib/testing/expectation/fuchsia_test_with_expectations_package.gni") |
| |
| tests = [ "sys" ] |
| |
| tests_with_err_logs = [ |
| { |
| label = "bridge" |
| }, |
| { |
| label = "dhcp" |
| }, |
| { |
| label = "dhcp-client" |
| }, |
| { |
| label = "dns" |
| }, |
| { |
| label = "fidl" |
| }, |
| { |
| label = "forwarding" |
| }, |
| { |
| label = "ipv4" |
| }, |
| { |
| label = "ipv6" |
| }, |
| { |
| label = "management" |
| }, |
| { |
| label = "product-flow" |
| }, |
| { |
| label = "reachability" |
| }, |
| { |
| label = "socket" |
| }, |
| ] |
| |
| long_tests_with_err_logs = [ |
| { |
| label = "multicast-forwarding" |
| long_test = true |
| }, |
| ] |
| |
| foreach(test, tests) { |
| name = "netstack-${test}-integration-test" |
| fuchsia_test_component_with_expectations(name) { |
| expectations = "expects/${name}.json5" |
| manifest = "meta/${name}.cml" |
| deps = [ test ] |
| } |
| } |
| |
| foreach(test, tests_with_err_logs + long_tests_with_err_logs) { |
| name = "netstack-${test.label}-integration-test" |
| fuchsia_test_component(name) { |
| manifest = "meta/${name}.cml" |
| deps = [ test.label ] |
| } |
| } |
| |
| package_deps = [ |
| # netemul-sandbox is used to create hermetic test realms. |
| "//src/connectivity/network/testing/netemul/service:netemul-sandbox", |
| |
| # netstack3 is under test. |
| "//src/connectivity/network/netstack3:component", |
| "//src/connectivity/network/netstack3:component-debug", |
| |
| # reachability monitor is under test. |
| "//src/connectivity/policy/reachability:component_with_fake_time", |
| |
| # stash_secure is used by dhcpd and netstack. |
| "//src/sys/stash:stash_secure_v2", |
| |
| # DHCPv4 Server is used to test DHCP address acquisition. |
| "//src/connectivity/network/dhcpv4/server:component", |
| |
| # DHCP(v4) client is under test. |
| "//src/connectivity/network/dhcpv4/client/bindings:component", |
| |
| # DHCPv6 client is under test. |
| "//src/connectivity/network/dhcpv6/client:component", |
| |
| # dns_resolver integration with netstack is tested. |
| "//src/connectivity/network/dns:component_with_fake_time", |
| |
| # the DNS resolver under test uses the fake clock. |
| "//src/lib/fake-clock/svc", |
| |
| # netcfg integration with netstack is tested. |
| ":netcfg-netemul-config", |
| ":netcfg-with-dhcpv6-netemul-config", |
| ":netcfg-with-duplicate-names", |
| ":netcfg-with-forwarding-netemul-config", |
| ":netcfg-with-iface-name-prefix", |
| ":netcfg-with-packet-filter-ethernet", |
| ":netcfg-with-packet-filter-wlan", |
| ":netcfg-without-provisioning-netemul-config", |
| "//src/connectivity/policy/netcfg:component-advanced", |
| "//src/connectivity/policy/netcfg:component-basic", |
| ] |
| |
| # RISC-V on Fuchsia does not support Golang. |
| if (target_cpu != "riscv64") { |
| package_deps += [ |
| "//src/connectivity/network/netstack:component", |
| "//src/connectivity/network/netstack:component-debug", |
| "//src/connectivity/network/netstack:component-with-fast-udp-debug", |
| ] |
| } |
| |
| fuchsia_test_package("netstack-integration-tests") { |
| test_components = [] |
| foreach(test, tests) { |
| test_components += [ ":netstack-${test}-integration-test" ] |
| } |
| |
| deps = package_deps + [ "//src/lib/testing/expectation:expectation_comparer" ] |
| } |
| |
| err_log_package_deps = [] |
| long_test_err_log_package_deps = [] |
| foreach(test, tests_with_err_logs + long_tests_with_err_logs) { |
| name = "netstack-${test.label}-integration-test" |
| no_err_logs_package_name = "${name}-no-err-logs" |
| fuchsia_test_with_expectations_package(no_err_logs_package_name) { |
| test_components = [ ":${name}" ] |
| expectations = "expects/${name}.json5" |
| treatment_of_cases_with_error_logs = "SKIP_CASES_WITH_ERROR_LOGS" |
| deps = |
| package_deps + [ "//src/lib/testing/expectation:expectation_comparer" ] |
| if (defined(test.long_test) && test.long_test) { |
| test_specs = { |
| # Longer timeout to reduce flake (https://fxbug.dev/42055260) |
| timeout_secs = 720 |
| } |
| } |
| } |
| with_err_logs_package_name = "${name}-with-err-logs" |
| fuchsia_test_with_expectations_package(with_err_logs_package_name) { |
| test_components = [ ":${name}" ] |
| expectations = "expects/${name}.json5" |
| treatment_of_cases_with_error_logs = "RUN_ONLY_CASES_WITH_ERROR_LOGS" |
| deps = |
| package_deps + [ "//src/lib/testing/expectation:expectation_comparer" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| if (defined(test.long_test) && test.long_test) { |
| # Longer timeout to reduce flake (https://fxbug.dev/42055260) |
| timeout_secs = 720 |
| } |
| } |
| } |
| if (defined(test.long_test) && test.long_test) { |
| long_test_err_log_package_deps += [ |
| ":${no_err_logs_package_name}", |
| ":${with_err_logs_package_name}", |
| ] |
| } else { |
| err_log_package_deps += [ |
| ":${no_err_logs_package_name}", |
| ":${with_err_logs_package_name}", |
| ] |
| } |
| } |
| |
| resource("netcfg-netemul-config") { |
| testonly = true |
| sources = [ "management/config/empty.json" ] |
| outputs = [ "netcfg/empty.json" ] |
| } |
| |
| resource("netcfg-with-dhcpv6-netemul-config") { |
| testonly = true |
| sources = [ "management/config/dhcpv6.json" ] |
| outputs = [ "netcfg/dhcpv6.json" ] |
| } |
| |
| resource("netcfg-with-forwarding-netemul-config") { |
| testonly = true |
| sources = [ "management/config/forwarding.json" ] |
| outputs = [ "netcfg/forwarding.json" ] |
| } |
| |
| resource("netcfg-without-provisioning-netemul-config") { |
| testonly = true |
| sources = [ "management/config/all_delegated.json" ] |
| outputs = [ "netcfg/all_delegated.json" ] |
| } |
| |
| resource("netcfg-with-iface-name-prefix") { |
| testonly = true |
| sources = [ "management/config/iface_prefix.json" ] |
| outputs = [ "netcfg/iface_prefix.json" ] |
| } |
| |
| resource("netcfg-with-duplicate-names") { |
| testonly = true |
| sources = [ "management/config/duplicate_names.json" ] |
| outputs = [ "netcfg/duplicate_names.json" ] |
| } |
| |
| resource("netcfg-with-packet-filter-ethernet") { |
| testonly = true |
| sources = [ "management/config/packet_filter_ethernet.json" ] |
| outputs = [ "netcfg/packet_filter_ethernet.json" ] |
| } |
| |
| resource("netcfg-with-packet-filter-wlan") { |
| testonly = true |
| sources = [ "management/config/packet_filter_wlan.json" ] |
| outputs = [ "netcfg/packet_filter_wlan.json" ] |
| } |
| |
| # We keep tests that involve the virtualization stack (and especially guest |
| # images) restricted to a separate builder. See https://fxbug.dev/42073933 for |
| # more details. |
| group("tests-involving-guests") { |
| testonly = true |
| deps = [ "guest:netstack-guest-integration-tests" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| # See comment above about tests-involving-guests |
| assert_no_deps = [ "guest:netstack-guest-integration-tests" ] |
| deps = [ |
| ":netstack-integration-tests", |
| "guest:build-only", |
| "inspect:tests", |
| "macros:netstack_testing_macros_test", |
| ] + err_log_package_deps |
| |
| if (!is_coverage) { |
| # TODO(https://fxbug.dev/42055260): Re-enable this test when it passes with |
| # the coverage variant. |
| deps += long_test_err_log_package_deps |
| } |
| } |