blob: bf50ec999fbdd36e3203fbb77cb1c8748ce2b3b6 [file] [log] [blame]
// Copyright 2022 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.
{
include: [
"//src/lib/vulkan/vulkan_test_realm.shard.cml",
"//src/sys/test_manager/meta/google_test_realm.shard.cml",
"//src/sys/testing/meta/chromium_system_test_realm.shard.cml",
"//src/sys/testing/meta/chromium_test_realm.shard.cml",
"inspect/client.shard.cml",
"sys/component/realm_builder.shard.cml",
"syslog/client.shard.cml",
"trace/client.shard.cml",
],
program: {
runner: "elf",
binary: "bin/test_manager",
},
children: [
{
name: "elf_test_runner",
url: "elf-test-runner#meta/elf-test-runner.cm",
},
{
name: "elf_test_ambient_exec_runner",
url: "elf-test-ambient-exec-runner#meta/elf-test-ambient-exec-runner.cm",
},
{
name: "elf_test_create_raw_processes_runner",
url: "elf-test-create-raw-processes-runner#meta/elf-test-create-raw-processes-runner.cm",
},
{
name: "elf_test_create_raw_processes_ambient_exec_runner",
url: "elf-test-create-raw-processes-ambient-exec-runner#meta/elf-test-create-raw-processes-ambient-exec-runner.cm",
},
{
name: "fuzz_test_runner",
url: "fuzz-test-runner#meta/fuzz-test-runner.cm",
},
{
name: "g3_dart_jit_product_runner",
url: "fuchsia-pkg://fuchsia.com/g3_dart_jit_product_runner#meta/g3_dart_jit_product_runner.cm",
},
{
name: "gtest_runner",
url: "gtest-runner#meta/gtest-runner.cm",
},
{
name: "gunit_runner",
url: "gunit-runner#meta/gunit-runner.cm",
},
{
name: "lib_loader_cache",
url: "lib_loader_runner_cache#meta/lib_loader_runner_cache.cm",
},
{
name: "netemul_test_runner",
url: "netemul-test-runner#meta/netemul-test-runner.cm",
},
{
name: "rust_test_create_raw_processes_runner",
url: "rust-test-create-raw-processes-runner#meta/rust-test-create-raw-processes-runner.cm",
},
{
name: "rust_test_next_vdso_runner",
url: "rust-test-next-vdso-runner#meta/rust-test-next-vdso-runner.cm",
},
{
name: "rust_test_runner",
url: "rust-test-runner#meta/rust-test-runner.cm",
},
{
name: "starnix_unit_test_runner",
url: "starnix-test-runners#meta/starnix_unit_test_runner.cm",
},
{
name: "go_test_runner",
url: "go-test-runner#meta/go-test-runner.cm",
},
{
name: "inspect_test_runner",
url: "inspect-test-runner#meta/inspect-test-runner.cm",
},
{
name: "stress_test_runner",
url: "stress-test-runner#meta/stress-test-runner.cm",
},
{
name: "runner_memfs",
url: "#meta/memfs.cm",
},
{
name: "test_tmpfs",
url: "#meta/memfs.cm",
},
{
name: "debug_data",
url: "#meta/debug_data_processor.cm",
},
{
name: "fxfs_data",
url: "#meta/fxfs_backed_data_for_tests.cm",
},
{
name: "early_boot_instrumentation",
url: "#meta/early-boot-instrumentation.cm",
},
],
collections: [
{
name: "tests",
environment: "#test-env",
durability: "transient",
},
{
name: "tier-2-tests",
environment: "#test-env",
durability: "transient",
},
{
name: "system-tests",
environment: "#test-env",
durability: "transient",
},
],
capabilities: [
{
storage: "memfs_data",
from: "#runner_memfs",
backing_dir: "memfs",
storage_id: "static_instance_id_or_moniker",
},
{
storage: "tmp",
from: "#test_tmpfs",
subdir: "tmp",
backing_dir: "memfs",
storage_id: "static_instance_id_or_moniker",
},
{
storage: "cache",
from: "#test_tmpfs",
subdir: "cache",
backing_dir: "memfs",
storage_id: "static_instance_id_or_moniker",
},
{
storage: "fxfs_tests_data",
from: "#fxfs_data",
backing_dir: "fxfs_data",
storage_id: "static_instance_id_or_moniker",
},
// TODO(https://fxbug.dev/42075284): Adding dummy capability to make cmc tool
// happy. This capability is not routed to any component.
{
storage: "data",
from: "#fxfs_data",
backing_dir: "fxfs_data",
storage_id: "static_instance_id_or_moniker",
},
{ protocol: "fuchsia.test.manager.Query" },
{ protocol: "fuchsia.test.manager.RunBuilder" },
{ protocol: "fuchsia.test.manager.TestCaseEnumerator" },
{ protocol: "fuchsia.test.manager.SuiteRunner" },
{ protocol: "fuchsia.test.manager.EarlyBootProfile" },
],
use: [
{
protocol: "fuchsia.component.Realm",
from: "framework",
},
{
protocol: [ "fuchsia.element.GraphicalPresenter" ],
availability: "optional",
},
// TODO(https://fxbug.dev/42167477): Clean this up
{ protocol: "fuchsia.component.resolution.Resolver" },
{
directory: "debugdata",
from: "#early_boot_instrumentation",
rights: [ "r*" ],
path: "/debugdata",
},
{
protocol: "fuchsia.test.debug.DebugDataProcessor",
from: "#debug_data",
},
{
storage: "tmp",
rights: [ "rw*" ],
path: "/tmp",
},
],
offer: [
{
storage: "data",
from: "parent",
to: "#fxfs_data",
},
{
// Tests are permitted to use /dev/null and /dev/zero.
directory: "dev-builtin",
from: "parent",
to: [
"#system-tests",
"#tests",
],
},
{
protocol: [
// Tests can write to debug logs
"fuchsia.boot.WriteOnlyLog",
"fuchsia.process.Launcher",
],
from: "parent",
to: [
"#system-tests",
"#tests",
],
},
{
event_stream: [
"capability_requested",
"debug_started",
"destroyed",
"discovered",
"started",
"stopped",
],
from: "parent",
to: "#system-tests",
scope: "#system-tests",
},
{
event_stream: [
"capability_requested",
"debug_started",
"destroyed",
"discovered",
"started",
"stopped",
],
from: "parent",
to: "#tests",
scope: "#tests",
},
{
protocol: [
"fuchsia.device.NameProvider",
"fuchsia.feedback.CrashReporter",
"fuchsia.intl.PropertyProvider",
"fuchsia.net.name.Lookup",
"fuchsia.posix.socket.Provider",
],
from: "parent",
to: [ "#g3_dart_jit_product_runner" ],
},
// These capabilities are offered for use by certain non-hermetic tests.
{
// update https://fuchsia.dev/fuchsia-src/concepts/testing/v2/test_runner_framework#legacy_non-hermetic_tests
// when this list is updated.
protocol: [
"fuchsia.boot.ReadOnlyLog",
"fuchsia.exception.Handler",
"fuchsia.kernel.CpuResource",
"fuchsia.kernel.DebuglogResource",
"fuchsia.kernel.DebugResource",
"fuchsia.kernel.EnergyInfoResource",
"fuchsia.kernel.FramebufferResource",
"fuchsia.kernel.HypervisorResource",
"fuchsia.kernel.InfoResource",
"fuchsia.kernel.IommuResource",
"fuchsia.kernel.IoportResource",
"fuchsia.kernel.IrqResource",
"fuchsia.kernel.MexecResource",
"fuchsia.kernel.MmioResource",
"fuchsia.kernel.MsiResource",
"fuchsia.kernel.PowerResource",
"fuchsia.kernel.ProfileResource",
"fuchsia.kernel.RootJob",
"fuchsia.kernel.RootJobForInspect",
"fuchsia.kernel.SmcResource",
"fuchsia.kernel.Stats",
"fuchsia.kernel.VmexResource",
"fuchsia.media.ProfileProvider",
// Needed for //src/cobalt/bin/meta/cobalt_testapp_for_prober_do_not_run_manually.cml
// TODO(https://fxbug.dev/42163671): Remove once e2e is better supported.
"fuchsia.net.http.Loader",
// Dart runners allow connections from the Dart Observatory,
// for debugging.
"fuchsia.posix.socket.Provider",
"fuchsia.scheduler.deprecated.ProfileProvider",
"fuchsia.scheduler.RoleManager",
"fuchsia.sysinfo.SysInfo",
"fuchsia.sysmem.Allocator",
"fuchsia.sysmem2.Allocator",
"fuchsia.vulkan.loader.Loader",
],
from: "parent",
to: "#system-tests",
},
{
protocol: "fuchsia.process.Launcher",
from: "parent",
to: [
"#elf_test_ambient_exec_runner",
"#elf_test_create_raw_processes_ambient_exec_runner",
"#elf_test_create_raw_processes_runner",
"#elf_test_runner",
"#fuzz_test_runner",
"#go_test_runner",
"#gtest_runner",
"#gunit_runner",
"#netemul_test_runner",
"#rust_test_create_raw_processes_runner",
"#rust_test_next_vdso_runner",
"#rust_test_runner",
"#starnix_unit_test_runner",
],
},
{
protocol: "fuchsia.test.runner.LibraryLoaderCacheBuilder",
from: "#lib_loader_cache",
to: [
"#elf_test_ambient_exec_runner",
"#elf_test_create_raw_processes_ambient_exec_runner",
"#elf_test_create_raw_processes_runner",
"#elf_test_runner",
"#fuzz_test_runner",
"#go_test_runner",
"#gtest_runner",
"#gunit_runner",
"#rust_test_create_raw_processes_runner",
"#rust_test_next_vdso_runner",
"#rust_test_runner",
"#starnix_unit_test_runner",
],
},
{
protocol: "fuchsia.fuzzer.Registrar",
from: "parent",
to: "#fuzz_test_runner",
},
{
protocol: "fuchsia.diagnostics.ArchiveAccessor",
from: "parent",
as: "fuchsia.diagnostics.RealArchiveAccessor",
to: [
"#inspect_test_runner",
"#system-tests",
],
},
{
protocol: "fuchsia.diagnostics.FeedbackArchiveAccessor",
from: "parent",
as: "fuchsia.diagnostics.RealFeedbackArchiveAccessor",
to: [ "#inspect_test_runner" ],
},
{
protocol: "fuchsia.diagnostics.LegacyMetricsArchiveAccessor",
from: "parent",
as: "fuchsia.diagnostics.RealLegacyMetricsArchiveAccessor",
to: [ "#inspect_test_runner" ],
},
{
storage: "memfs_data",
from: "self",
as: "data",
to: [
"#gtest_runner",
"#gunit_runner",
"#rust_test_create_raw_processes_runner",
"#rust_test_next_vdso_runner",
"#rust_test_runner",
"#starnix_unit_test_runner",
],
},
{
storage: "fxfs_tests_data",
from: "self",
as: "data",
to: [
"#system-tests",
"#tests",
],
rights: [ "rw*" ],
},
{
directory: "root-ssl-certificates",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// audio_core_hardware_tests records from the real microphone, so it needs system audio.
// bt-a2dp-loopback-test needs system audio.
{
protocol: [
"fuchsia.media.Audio",
"fuchsia.media.AudioDeviceEnumerator",
],
from: "parent",
to: [ "#system-tests" ],
},
// Test realms may offer subdirectories of config-data to test
// components. See:
// https://fuchsia.dev/fuchsia-src/development/components/data#product-specific_configuration_with_config_data
{
directory: "config-data",
from: "parent",
to: [
"#g3_dart_jit_product_runner",
"#system-tests",
],
},
{
storage: "tmp",
from: "self",
to: [
"#g3_dart_jit_product_runner",
"#system-tests",
"#tests",
],
},
{
storage: "cache",
from: "self",
to: [
"#system-tests",
"#tests",
],
},
// temporary solution for tests that depend on having admin rights on
// /tmp. Will be removed once these tests either remove this requirement
// or begin hosting their own memfs.
{
directory: "memfs",
from: "#test_tmpfs",
as: "deprecated-tmp",
to: [
"#system-tests",
"#tests",
],
},
// Some non-hermetic tests require access to real input.
{
directory: "dev-input",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-input-report",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// Some non-hermetic tests require access to the real display controller.
{
directory: "dev-display-coordinator",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// Some non-hermetic tests require access to the GPU and vulkan
{
directory: "dev-goldfish-address-space",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-goldfish-control",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-goldfish-pipe",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-goldfish-sync",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-gpu",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-gpu-performance-counters",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// audio_driver_tests requires access to audio drivers.
{
directory: [
"dev-audio-input",
"dev-audio-output",
"dev-composite",
"dev-dai",
],
from: "parent",
to: [ "#system-tests" ],
},
// optee_test requires access to /dev/class/tee.
{
directory: "dev-tee",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// Tests of the media system want to test against the real hardware
// TODO(https://fxbug.dev/42164198): Remove when specialized test realms are ready.
{
directory: "dev-mediacodec",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-sysmem",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "dev-securemem",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
{
directory: "boot",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rx*" ],
},
{
directory: "boot",
from: "parent",
to: [ "#early_boot_instrumentation" ],
rights: [ "r*" ],
},
{
protocol: "fuchsia.boot.SvcStashProvider",
from: "parent",
to: [ "#early_boot_instrumentation" ],
},
// Tests of the media system change their behavior based on board
// TODO(https://fxbug.dev/42164198): Remove when specialized test realms are ready.
{
protocol: "fuchsia.sysinfo.SysInfo",
from: "parent",
to: [ "#system-tests" ],
},
// System tests can capture a trace.
{
protocol: [ "fuchsia.tracing.controller.Controller" ],
from: "parent",
to: [ "#system-tests" ],
},
// CPU Profiling tests require access to ktrace data to parse results
{
protocol: [
"fuchsia.kernel.Counter",
"fuchsia.tracing.kernel.Controller",
"fuchsia.tracing.kernel.Reader",
],
from: "parent",
to: [ "#system-tests" ],
availability: "same_as_target",
},
// CPU Profiling tests require access to the /dev/sys/cpu-trace device
{
directory: "sys",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// flutter_*_runner
{
protocol: [
"fuchsia.fonts.Provider",
"fuchsia.intl.PropertyProvider",
"fuchsia.memorypressure.Provider",
],
from: "parent",
to: [ "#system-tests" ],
},
// `tz_version_parrot` tests use the system tzdata.
{
directory: [
// `tzdata-icu` offers /config/tzdata/icu.
// `tzdata-icu-44-le` offers /config/tzdata/icu/44/le only.
"tzdata-icu",
"tzdata-icu-44-le",
],
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// Only available on some products.
{
protocol: [
"fuchsia.factory.WeaveFactoryStoreProvider",
"fuchsia.ui.composition.Flatland",
"fuchsia.ui.scenic.Scenic",
],
from: "parent",
to: [ "#system-tests" ],
availability: "same_as_target",
},
// Needed for Bluetooth streaming E2E tests.
{
protocol: "fuchsia.media.SessionAudioConsumerFactory",
from: "parent",
to: [ "#system-tests" ],
availability: "same_as_target",
},
],
expose: [
{
protocol: "fuchsia.test.manager.Query",
from: "self",
},
{
protocol: "fuchsia.test.manager.RunBuilder",
from: "self",
},
{
protocol: "fuchsia.test.manager.TestCaseEnumerator",
from: "self",
},
{
protocol: "fuchsia.test.manager.SuiteRunner",
from: "self",
},
{
protocol: "fuchsia.test.manager.EarlyBootProfile",
from: "self",
},
],
}