| // 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/ctf/test_realm/meta/test-collection.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/media/testing/media_test_realm.shard.cml", | |
| "//src/sys/component_manager/tests/capability_provider_vfs_compliance/vfs_compliance_test_realm.shard.cml", | |
| "//src/sys/test_manager/meta/chromium_system_test_realm.shard.cml", | |
| "//src/sys/test_manager/meta/chromium_test_realm.shard.cml", | |
| "//src/sys/test_manager/meta/google_test_realm.shard.cml", | |
| "//src/testing/system-validation/meta/system_validation_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: "dart_aot_runner", | |
| url: "dart-aot-wrapper-runner#meta/dart-aot-wrapper-runner.cm", | |
| }, | |
| { | |
| name: "dart_jit_runner", | |
| url: "dart-jit-wrapper-runner#meta/dart-jit-wrapper-runner.cm", | |
| }, | |
| { | |
| 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: "legacy_test_runner", | |
| url: "legacy-test-runner#meta/legacy-test-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_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_test_runners", | |
| url: "starnix-test-runners#meta/starnix_test_runners.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: "system-tests", | |
| environment: "#legacy-test-env", | |
| durability: "transient", | |
| }, | |
| { | |
| name: "starnix-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(fxbug.dev/124393): 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" }, | |
| ], | |
| use: [ | |
| { | |
| protocol: "fuchsia.component.Realm", | |
| from: "framework", | |
| }, | |
| { | |
| protocol: [ | |
| "fuchsia.element.GraphicalPresenter", | |
| "fuchsia.sys.Environment", | |
| "fuchsia.sys.Loader", | |
| ], | |
| availability: "optional", | |
| }, | |
| // TODO(fxbug.dev/86464): 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: [ | |
| "#starnix-tests", | |
| "#system-tests", | |
| "#tests", | |
| ], | |
| }, | |
| { | |
| protocol: [ | |
| // Tests can write to debug logs | |
| "fuchsia.boot.WriteOnlyLog", | |
| "fuchsia.process.Launcher", | |
| ], | |
| from: "parent", | |
| to: [ | |
| "#starnix-tests", | |
| "#system-tests", | |
| "#tests", | |
| ], | |
| }, | |
| { | |
| event_stream: [ | |
| "capability_requested", | |
| "directory_ready", | |
| ], | |
| from: "parent", | |
| to: "#starnix-tests", | |
| scope: "#starnix-tests", | |
| }, | |
| { | |
| event_stream: [ | |
| "capability_requested", | |
| "debug_started", | |
| "destroyed", | |
| "directory_ready", | |
| "discovered", | |
| "started", | |
| "stopped", | |
| ], | |
| from: "parent", | |
| to: "#system-tests", | |
| scope: "#system-tests", | |
| }, | |
| { | |
| event_stream: [ | |
| "capability_requested", | |
| "debug_started", | |
| "destroyed", | |
| "directory_ready", | |
| "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: [ | |
| "#dart_aot_runner", | |
| "#dart_jit_runner", | |
| "#g3_dart_jit_product_runner", | |
| ], | |
| }, | |
| { | |
| protocol: [ | |
| "fuchsia.sys.Environment", | |
| "fuchsia.sys.Loader", | |
| ], | |
| from: "parent", | |
| to: [ | |
| "#dart_aot_runner", | |
| "#dart_jit_runner", | |
| "#g3_dart_jit_product_runner", | |
| ], | |
| availability: "optional", | |
| }, | |
| // 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.EnergyInfoResource", | |
| "fuchsia.kernel.HypervisorResource", | |
| "fuchsia.kernel.InfoResource", | |
| "fuchsia.kernel.IoportResource", | |
| "fuchsia.kernel.IrqResource", | |
| "fuchsia.kernel.MexecResource", | |
| "fuchsia.kernel.MmioResource", | |
| "fuchsia.kernel.PowerResource", | |
| "fuchsia.kernel.RootJob", | |
| "fuchsia.kernel.RootJobForInspect", | |
| "fuchsia.kernel.SmcResource", | |
| "fuchsia.kernel.Stats", | |
| "fuchsia.kernel.VmexResource", | |
| "fuchsia.media.ProfileProvider", | |
| // Needed for Bluetooth streaming E2E tests. | |
| // TODO(fxbug.dev/90434): Consider removing when mediaplayer is v2. | |
| "fuchsia.media.SessionAudioConsumerFactory", | |
| // 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.sysmem2.Allocator", | |
| "fuchsia.vulkan.loader.Loader", | |
| ], | |
| from: "parent", | |
| to: "#system-tests", | |
| }, | |
| { | |
| protocol: [ | |
| "fuchsia.sys.Environment", | |
| "fuchsia.sys.Loader", | |
| ], | |
| from: "parent", | |
| to: [ | |
| "#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", | |
| ], | |
| availability: "optional", | |
| }, | |
| { | |
| protocol: [ | |
| "fuchsia.kernel.Stats", | |
| "fuchsia.kernel.VmexResource", | |
| "fuchsia.posix.socket.Provider", | |
| "fuchsia.posix.socket.raw.Provider", | |
| "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_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_next_vdso_runner", | |
| "#rust_test_runner", | |
| "#starnix_test_runners", | |
| ], | |
| }, | |
| { | |
| 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_next_vdso_runner", | |
| "#rust_test_runner", | |
| "#starnix_test_runners", | |
| ], | |
| }, | |
| { | |
| 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_next_vdso_runner", | |
| "#rust_test_runner", | |
| "#starnix_test_runners", | |
| ], | |
| }, | |
| { | |
| storage: "fxfs_tests_data", | |
| from: "self", | |
| as: "data", | |
| to: [ | |
| "#starnix-tests", | |
| "#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" ], | |
| }, | |
| { | |
| protocol: [ "fuchsia.factory.WeaveFactoryStoreProvider" ], | |
| 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: [ | |
| // TODO(99511) Remove dependence on config-data once it is removed from the dart_*_runner cml. | |
| "#dart_aot_runner", | |
| "#dart_jit_runner", | |
| "#g3_dart_jit_product_runner", | |
| "#system-tests", | |
| ], | |
| }, | |
| { | |
| storage: "tmp", | |
| from: "self", | |
| to: [ | |
| "#starnix-tests", | |
| "#starnix_test_runners", | |
| "#system-tests", | |
| "#tests", | |
| ], | |
| }, | |
| { | |
| storage: "cache", | |
| from: "self", | |
| to: [ | |
| "#starnix-tests", | |
| "#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: [ | |
| "#starnix-tests", | |
| "#starnix_test_runners", | |
| "#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(fxbug.dev/83512): 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(fxbug.dev/83512): 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.tracing.kernel.Controller", | |
| "fuchsia.tracing.kernel.Reader", | |
| ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // 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", | |
| "fuchsia.ui.composition.Flatland", | |
| "fuchsia.ui.scenic.Scenic", | |
| ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // `tz_version_parrot` tests use the system tzdata. | |
| { | |
| directory: "tzdata-icu-44-le", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| ], | |
| expose: [ | |
| { | |
| protocol: "fuchsia.test.manager.Query", | |
| from: "self", | |
| }, | |
| { | |
| protocol: "fuchsia.test.manager.RunBuilder", | |
| from: "self", | |
| }, | |
| ], | |
| } |