blob: aef38f4484b17da714304f42869c3b9514153ac4 [file] [log] [blame]
# 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/test/test_package.gni")
import("//build/testing/environments.gni")
group("test") {
testonly = true
deps = [
":netemul_empty_binaries",
":netemul_guest_test",
":netemul_sandbox_test",
"dummy_proc",
"dynamic_devices",
"easy_netstack_cfg",
"env_build",
"guest",
"guest_grpc_stress",
"inheritance",
"netstack_socks",
"sandbox_service",
"svc_list",
]
}
# netemul tests are defined only by their .cmx file.
# currently, there's a limitation on runtests where every test
# needs an associated binary. Some changes to how this is set up
# are on the pipeline but not ready yet, so here we just
# create some empty files and we'll use them as dummy binaries.
# If you copy this pattern, try to use the name "netemul_empty_binaries"
# as well, so when a better approach comes along I can hunt down
# for this pattern and update it everywhere.
# TODO(brunodalbo) migrate .cmx file handling
group("netemul_empty_binaries") {
write_file("$root_out_dir/svc_list_test", "")
write_file("$root_out_dir/netstack_socks_test", "")
write_file("$root_out_dir/env_build_test", "")
write_file("$root_out_dir/easy_netstack_cfg_test", "")
write_file("$root_out_dir/inheritance_test", "")
write_file("$root_out_dir/dynamic_devices_test", "")
write_file("$root_out_dir/netstack_intermediary_multi_interface_test", "")
write_file("$root_out_dir/netstack_intermediary_test", "")
write_file("$root_out_dir/guest_test", "")
write_file("$root_out_dir/grpc_client_stress_test", "")
write_file("$root_out_dir/multiple_guests_test", "")
}
test_package("netemul_sandbox_test") {
deps = [
":netemul_empty_binaries",
"dummy_proc",
"dynamic_devices",
"easy_netstack_cfg",
"env_build",
"inheritance",
"netstack_intermediary",
"netstack_socks",
"sandbox_service:sandbox_service_test",
"svc_list",
"//src/connectivity/network/testing/netemul/runner:sandbox_unittest",
"//src/connectivity/network/testing/netemul/runner/helpers/mock_device_settings:mock_device_settings_test",
"//src/connectivity/network/testing/netemul/runner/model:model_unittest",
]
meta = [
{
path = rebase_path("meta/dummy_proc.cmx")
dest = "dummy_proc.cmx"
},
{
path = rebase_path("meta/dummy_proc_with_dev.cmx")
dest = "dummy_proc_with_dev.cmx"
},
{
path = rebase_path("meta/svc_list.cmx")
dest = "svc_list.cmx"
},
{
path = rebase_path("meta/netstack_socks.cmx")
dest = "netstack_socks.cmx"
},
{
path = rebase_path("meta/env_build.cmx")
dest = "env_build.cmx"
},
{
path = rebase_path("meta/easy_netstack_cfg.cmx")
dest = "easy_netstack_cfg.cmx"
},
{
path = rebase_path("meta/inheritance.cmx")
dest = "inheritance.cmx"
},
{
path = rebase_path("meta/dynamic_devices.cmx")
dest = "dynamic_devices.cmx"
},
{
path = rebase_path("meta/netstack_intermediary.cmx")
dest = "netstack_intermediary.cmx"
},
]
binaries = [
{
name = "dummy_proc"
},
{
name = "svc_list"
},
{
name = "netstack_socks"
},
{
name = "env_build"
},
{
name = "easy_netstack_cfg"
},
{
name = "inheritance"
},
{
name = "dynamic_devices"
},
{
name = "netstack_intermediary"
},
]
tests = [
{
name = "sandbox_unittest"
environments = [ qemu_env ]
},
{
name = "model_unittest"
},
{
name = "sandbox_service_bin_test"
dest = "sandbox_service"
environments = [ qemu_env ]
},
{
name = "svc_list_test"
environments = [ qemu_env ]
},
{
name = "env_build_test"
environments = [ qemu_env ]
},
{
name = "netstack_socks_test"
environments = [ qemu_env ]
},
{
name = "easy_netstack_cfg_test"
environments = [ qemu_env ]
},
{
name = "inheritance_test"
environments = [ qemu_env ]
},
{
name = "dynamic_devices_test"
environments = [ qemu_env ]
},
{
name = "mock_device_settings_bin_test"
dest = "mock_device_settings"
},
{
name = "netstack_intermediary_multi_interface_test"
environments = [ qemu_env ]
},
{
name = "netstack_intermediary_test"
environments = [ qemu_env ]
},
]
}
test_package("netemul_guest_test") {
deps = [
":netemul_empty_binaries",
"guest",
"guest_grpc_stress",
"multiple_guests",
]
resources = [
{
path = "//src/virtualization/lib/guest_interaction/test/test_script.sh"
dest = "test_script.sh"
},
{
path = "multiple_guests/data/setup_linux_client.sh"
dest = "setup_linux_client.sh"
},
{
path = "multiple_guests/data/setup_linux_router.sh"
dest = "setup_linux_router.sh"
},
]
meta = [
{
path = rebase_path("meta/grpc_client_stress.cmx")
dest = "grpc_client_stress.cmx"
},
{
path = rebase_path("meta/guest.cmx")
dest = "guest.cmx"
},
{
path = rebase_path("meta/multiple_guests.cmx")
dest = "multiple_guests.cmx"
},
]
binaries = [
{
name = "netemul_guest"
},
{
name = "grpc_client_stress"
},
{
name = "multiple_guests"
},
]
tests = [
{
# Running guests is resource intensive. Limit this test to only run on NUCs.
name = "guest_test"
# TODO(48129): test hangs w/ ASan. Fix and switch to [ nuc_env ].
environments = nuc_env_fails_on_asan
},
{
name = "grpc_client_stress_test"
# TODO(47487): test hangs w/ ASan. Fix and switch to [ nuc_env ].
if (nuc_env_fails_on_asan != []) {
nuc_scope = nuc_env_fails_on_asan[0]
environments = [
{
dimensions = nuc_scope.dimensions
# TODO(49752): test occasionally exceeds 5 minute timeout.
tags = [ "flaky" ]
},
]
} else {
# Disable this test for all non-NUC environments.
environments = []
}
},
{
name = "multiple_guests_test"
# TODO(48129): test hangs w/ ASan. Fix and switch to [ nuc_env ].
environments = nuc_env_fails_on_asan
},
]
}