| # 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( |
| "//src/lib/testing/expectation/fuchsia_test_component_with_expectations.gni") |
| import("//src/lib/testing/sharding/fuchsia_sharded_test_package.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":netstack-error-fidl-tests", |
| ":netstack-fidl-tests", |
| ":netstack-filter-fidl-tests", |
| ] |
| } |
| |
| tests = [ |
| "debug", |
| "interfaces", |
| "interfaces-admin", |
| "neighbor", |
| "routes", |
| "routes-admin", |
| ] |
| |
| foreach(test, tests) { |
| name = "netstack-${test}-fidl-test" |
| fuchsia_test_component_with_expectations(name) { |
| manifest = "meta/${name}.cml" |
| expectations = "expectations/${test}.json5" |
| deps = [ test ] |
| } |
| } |
| |
| filter_deprecated_tests = [ |
| "nat", |
| "tcp", |
| "udp", |
| ] |
| |
| foreach(test, filter_deprecated_tests) { |
| name = "netstack-${test}-filter-deprecated-fidl-test" |
| fuchsia_test_component_with_expectations(name) { |
| manifest = "meta/netstack-${test}-filter-deprecated-fidl-test.cml" |
| expectations = "expectations/${test}.json5" |
| deps = [ "filter-deprecated/${test}" ] |
| } |
| } |
| |
| _common_test_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-debug", |
| ] |
| |
| # RISC-V on Fuchsia does not support Golang. |
| if (target_cpu != "riscv64") { |
| _common_test_package_deps += |
| [ "//src/connectivity/network/netstack:component-debug" ] |
| } |
| |
| fuchsia_test_package("netstack-fidl-tests") { |
| test_components = [] |
| foreach(test, tests) { |
| test_components += [ ":netstack-${test}-fidl-test" ] |
| } |
| foreach(test, filter_deprecated_tests) { |
| test_components += [ ":netstack-${test}-filter-deprecated-fidl-test" ] |
| } |
| |
| deps = _common_test_package_deps + |
| [ "//src/lib/testing/expectation:expectation_comparer" ] |
| |
| # TODO(https://fxbug.dev/42144060): Figure out how to allow high-severity logs |
| # in expected-to-fail tests. |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fuchsia_test_component("netstack-interfaces-error-fidl-test") { |
| manifest = "meta/netstack-interfaces-error-fidl-test.cml" |
| deps = [ "interfaces:error" ] |
| } |
| |
| # TODO(https://fxbug.dev/42144060): Merge this with the above package once it is |
| # supported to configure acceptable error log lines. |
| fuchsia_test_package("netstack-error-fidl-tests") { |
| test_components = [ ":netstack-interfaces-error-fidl-test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = _common_test_package_deps |
| } |
| |
| fuchsia_sharded_test_package("netstack-filter-fidl-tests") { |
| test_components = [ |
| { |
| name = "netstack-filter-fidl-test" |
| manifest = "meta/netstack-filter-fidl-test.cml" |
| deps = _common_test_package_deps + [ |
| "filter", |
| "//src/lib/testing/expectation:expectation_comparer", |
| ] |
| expectations = "expectations/filter.json5" |
| num_shards = 8 |
| |
| # Matches the first two '::'-delimited parts of the test name, or just the |
| # whole name if there are no occurrences of '::'. For example, from |
| # "ingress::drop_incoming_local_ingress_v4::incoming_interface_device_class" |
| # matches "ingress::drop_incoming_local_ingress_v4", and matches all of |
| # "drop_controller_removes_resources". |
| shard_part_regex = "([^::]+(?:::[^::]+)?).*" |
| }, |
| ] |
| } |