blob: f1f752051577ed055238c6e7f2304c95e5d79bdd [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: [
"//sdk/cts/test_realm/meta/cts_test_realm.shard.cml",
"//src/devices/testing/devices_test_realm.shard.cml",
"//src/lib/vulkan/vulkan_test_realm.shard.cml",
"//src/media/testing/drm_test_realm.shard.cml",
"//src/sys/test_manager/meta/chromium_test_realm.shard.cml",
"//src/sys/test_manager/meta/google_test_realm.shard.cml",
"inspect/client.shard.cml",
"sys/component/realm_builder.shard.cml",
"syslog/client.shard.cml",
],
program: {
runner: "elf",
binary: "bin/test_manager",
},
children: [
{
name: "dart_aot_runner",
url: "fuchsia-pkg://fuchsia.com/dart_aot_runner#meta/dart_aot_runner.cm",
},
{
name: "dart_jit_runner",
url: "fuchsia-pkg://fuchsia.com/dart_jit_runner#meta/dart_jit_runner.cm",
},
{
name: "elf_test_runner",
url: "fuchsia-pkg://fuchsia.com/elf-test-runner#meta/elf-test-runner.cm",
},
{
name: "elf_test_ambient_exec_runner",
url: "fuchsia-pkg://fuchsia.com/elf-test-ambient-exec-runner#meta/elf-test-ambient-exec-runner.cm",
},
{
name: "gtest_runner",
url: "fuchsia-pkg://fuchsia.com/gtest-runner#meta/gtest-runner.cm",
},
{
name: "gunit_runner",
url: "fuchsia-pkg://fuchsia.com/gunit-runner#meta/gunit-runner.cm",
},
{
name: "legacy_test_runner",
url: "fuchsia-pkg://fuchsia.com/legacy-test-runner#meta/legacy-test-runner.cm",
},
{
name: "lib_loader_cache",
url: "fuchsia-pkg://fuchsia.com/lib_loader_runner_cache#meta/lib_loader_runner_cache.cm",
},
{
name: "netemul_test_runner",
url: "fuchsia-pkg://fuchsia.com/netemul-test-runner#meta/netemul-test-runner.cm",
},
{
name: "rust_test_runner",
url: "fuchsia-pkg://fuchsia.com/rust-test-runner#meta/rust-test-runner.cm",
},
{
name: "starnix_test_runners",
url: "fuchsia-pkg://fuchsia.com/starnix-test-runners#meta/starnix_test_runners.cm",
},
{
name: "go_test_runner",
url: "fuchsia-pkg://fuchsia.com/go-test-runner#meta/go-test-runner.cm",
},
{
name: "inspect_test_runner",
url: "fuchsia-pkg://fuchsia.com/inspect-test-runner#meta/inspect-test-runner.cm",
},
{
name: "stress_test_runner",
url: "fuchsia-pkg://fuchsia.com/stress-test-runner#meta/stress-test-runner.cm",
},
{
// This is not a test runner. This is used to run wrapped legacy
// component under tests.
name: "cmx_runner",
url: "#meta/cmx_runner.cm",
},
{
name: "runner_memfs",
url: "fuchsia-pkg://fuchsia.com/test_manager#meta/memfs.cm",
},
{
name: "test_tmpfs",
url: "fuchsia-pkg://fuchsia.com/test_manager#meta/memfs.cm",
},
{
name: "debug_data",
url: "fuchsia-pkg://fuchsia.com/test_manager#meta/debug_data_rust.cm",
},
{
name: "early_boot_instrumentation",
url: "#meta/early-boot-instrumentation.cm",
},
],
collections: [
{
name: "tests",
environment: "#test-env",
durability: "transient",
},
{
name: "tier-2-tests",
environment: "#legacy-test-env",
durability: "transient",
},
{
name: "system-tests",
environment: "#legacy-test-env",
durability: "transient",
},
{
name: "starnix-tests",
environment: "#test-env",
durability: "transient",
},
],
capabilities: [
{
storage: "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: "custom_artifacts",
from: "#test_tmpfs",
subdir: "custom_artifacts",
backing_dir: "memfs",
storage_id: "static_instance_id_or_moniker",
},
{ protocol: "fuchsia.test.manager.Query" },
{ protocol: "fuchsia.test.manager.RunBuilder" },
],
use: [
{
protocol: "fuchsia.component.Realm",
from: "framework",
},
{ protocol: "fuchsia.sys.Environment" },
{ protocol: "fuchsia.sys.Loader" },
// TODO(fxbug.dev/86464): Clean this up
{ protocol: "fuchsia.component.resolution.Resolver" },
{
protocol: "fuchsia.sys2.StorageAdmin",
from: "#custom_artifacts",
},
{
directory: "prof-data",
from: "#early_boot_instrumentation",
rights: [ "r*" ],
path: "/prof-data",
},
{
protocol: "fuchsia.test.internal.DebugDataController",
from: "#debug_data",
},
],
offer: [
{
protocol: [
// Tests can write to debug logs
"fuchsia.boot.WriteOnlyLog",
"fuchsia.logger.LogSink",
"fuchsia.process.Launcher",
"fuchsia.sys2.EventSource",
// Tests can produce trace.
"fuchsia.tracing.provider.Registry",
],
from: "parent",
to: [
"#starnix-tests",
"#system-tests",
"#tests",
"#tier-2-tests",
],
},
{
protocol: [
"fuchsia.device.NameProvider",
"fuchsia.feedback.CrashReporter",
"fuchsia.intl.PropertyProvider",
"fuchsia.logger.LogSink",
"fuchsia.net.name.Lookup",
"fuchsia.posix.socket.Provider",
// TODO(99511) Remove |Environment| and |Loader| once it is removed from the dart_*_runner cml.
"fuchsia.sys.Environment",
"fuchsia.sys.Loader",
"fuchsia.tracing.provider.Registry",
],
from: "parent",
to: [
"#dart_aot_runner",
"#dart_jit_runner",
],
},
{
protocol: [ "fuchsia.sys2.EventSource" ],
from: "parent",
to: "#debug_data",
},
// 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.boot.RootResource",
// Needed for test_manager_tests and test runner tests.
// TODO(fxbug.dev/86464): Remove this once we have facet API.
"fuchsia.component.resolution.Resolver",
"fuchsia.exception.Handler",
// fuchsia.hardware.pty.Device is needed for terminal_tests.
// TODO(fxbug.dev/97992): Remove this once the test is hermetic.
"fuchsia.hardware.pty.Device",
"fuchsia.kernel.Counter",
"fuchsia.kernel.CpuResource",
"fuchsia.kernel.DebugResource",
"fuchsia.kernel.HypervisorResource",
"fuchsia.kernel.InfoResource",
"fuchsia.kernel.IoportResource",
"fuchsia.kernel.IrqResource",
"fuchsia.kernel.MmioResource",
"fuchsia.kernel.PowerResource",
"fuchsia.kernel.RootJob",
"fuchsia.kernel.RootJobForInspect",
"fuchsia.kernel.SmcResource",
"fuchsia.kernel.Stats",
"fuchsia.kernel.VmexResource",
// Needed for //src/cobalt/bin/meta/cobalt_testapp_for_prober_do_not_run_manually.cml
// TODO(fxbug.dev/83038): 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.ProfileProvider",
"fuchsia.sysmem.Allocator",
"fuchsia.vulkan.loader.Loader",
],
from: "parent",
to: "#system-tests",
},
{
protocol: "fuchsia.logger.LogSink",
from: "parent",
to: [
"#cmx_runner",
"#debug_data",
"#early_boot_instrumentation",
"#elf_test_ambient_exec_runner",
"#elf_test_runner",
"#go_test_runner",
"#gtest_runner",
"#gunit_runner",
"#inspect_test_runner",
"#legacy_test_runner",
"#lib_loader_cache",
"#netemul_test_runner",
"#runner_memfs",
"#rust_test_runner",
"#starnix_test_runners",
"#stress_test_runner",
"#test_tmpfs",
],
},
{
protocol: [
"fuchsia.sys.Environment",
"fuchsia.sys.Loader",
],
from: "parent",
to: [
"#cmx_runner",
"#legacy_test_runner",
// TODO(https://fxbug.dev/87164): when these legacy capabilities used by the
// realm builder server can be optional, don't offer them to the
// netemul_test_runner.
"#netemul_test_runner",
],
},
{
protocol: [ "fuchsia.tracing.provider.Registry" ],
from: "parent",
to: [ "#starnix_test_runners" ],
},
{
protocol: [
"fuchsia.kernel.VmexResource",
"fuchsia.sysmem.Allocator",
"fuchsia.ui.composition.Allocator",
"fuchsia.ui.composition.Flatland",
"fuchsia.ui.input3.Keyboard",
"fuchsia.ui.scenic.Scenic",
"fuchsia.vulkan.loader.Loader",
],
from: "parent",
to: [
"#starnix-tests",
"#starnix_test_runners",
],
},
{
protocol: "fuchsia.process.Launcher",
from: "parent",
to: [
"#elf_test_ambient_exec_runner",
"#elf_test_runner",
"#go_test_runner",
"#gtest_runner",
"#gunit_runner",
"#netemul_test_runner",
"#rust_test_runner",
"#starnix_test_runners",
],
},
{
protocol: "fuchsia.test.runner.LibraryLoaderCacheBuilder",
from: "#lib_loader_cache",
to: [
"#elf_test_ambient_exec_runner",
"#elf_test_runner",
"#go_test_runner",
"#gtest_runner",
"#gunit_runner",
"#rust_test_runner",
"#starnix_test_runners",
],
},
{
event: "capability_requested",
from: "framework",
to: "#debug_data",
filter: { name: "fuchsia.debugdata.Publisher" },
},
{
event: "started",
from: "framework",
to: "#debug_data",
},
{
event: "destroyed",
from: "framework",
to: "#debug_data",
},
{
protocol: "fuchsia.diagnostics.ArchiveAccessor",
from: "parent",
as: "fuchsia.diagnostics.RealArchiveAccessor",
to: [ "#inspect_test_runner" ],
},
{
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: "data",
from: "self",
to: [
"#gtest_runner",
"#gunit_runner",
"#rust_test_runner",
"#starnix-tests",
"#starnix_test_runners",
"#system-tests",
"#tests",
"#tier-2-tests",
],
},
{
storage: "tmp",
from: "parent",
to: "#debug_data",
rights: [ "rw*" ],
},
{
directory: "root-ssl-certificates",
from: "parent",
to: [ "#system-tests" ],
rights: [ "r*" ],
},
// 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: [
// TODO(99511) Remove dependence on config-data once it is removed from the dart_*_runner cml.
"#dart_aot_runner",
"#dart_jit_runner",
"#system-tests",
],
},
{
storage: "tmp",
from: "self",
to: [
"#starnix-tests",
"#system-tests",
"#tests",
"#tier-2-tests",
],
},
{
storage: "cache",
from: "self",
to: [
"#starnix-tests",
"#system-tests",
"#tests",
"#tier-2-tests",
],
},
{
storage: "custom_artifacts",
from: "self",
to: [
"#starnix-tests",
"#system-tests",
"#tests",
"#tier-2-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",
"#tier-2-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-controller",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
// Some non-hermetic tests require access to the GPU and vulkan
{
directory: "dev-goldfish-address-space",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
{
directory: "dev-goldfish-control",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
{
directory: "dev-goldfish-pipe",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
{
directory: "dev-goldfish-sync",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
{
directory: "dev-gpu",
from: "parent",
to: [
"#starnix-tests",
"#starnix_test_runners",
"#system-tests",
],
rights: [ "rw*" ],
},
{
directory: "dev-gpu-performance-counters",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
// optee_test requires access to /dev/class/tee.
{
directory: "dev-tee",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
// Tests of the media system want to test against the real hardware
// TODO(fxbug.dev/83512): Remove when specialized test realms are ready.
{
directory: "dev-mediacodec",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
{
directory: "dev-sysmem",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rw*" ],
},
{
directory: "boot",
from: "parent",
to: [ "#system-tests" ],
rights: [ "rx*" ],
},
{
directory: "boot",
from: "parent",
to: [ "#early_boot_instrumentation" ],
rights: [ "r*" ],
},
// Tests of the media system change their behavior based on board
// TODO(fxbug.dev/83512): Remove when specialized test realms are ready.
{
protocol: "fuchsia.sysinfo.SysInfo",
from: "parent",
to: [ "#system-tests" ],
},
],
expose: [
{
protocol: "fuchsia.test.manager.Query",
from: "self",
},
{
protocol: "fuchsia.test.manager.RunBuilder",
from: "self",
},
{
directory: "hub",
from: "framework",
},
],
}