| // Copyright 2023 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/sys/testing/meta/test-memfs.shard.cml" ], | |
| collections: [ | |
| { | |
| name: "system-tests", | |
| environment: "#test-env", | |
| durability: "transient", | |
| }, | |
| ], | |
| offer: [ | |
| { | |
| // Tests are permitted to use /dev/null and /dev/zero. | |
| directory: "dev-builtin", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| protocol: [ | |
| // Tests can write to debug logs | |
| "fuchsia.boot.WriteOnlyLog", | |
| "fuchsia.process.Launcher", | |
| // Tests can produce trace. | |
| "fuchsia.tracing.provider.Registry", | |
| ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| event_stream: [ | |
| "capability_requested", | |
| "debug_started", | |
| "destroyed", | |
| "started", | |
| "stopped", | |
| ], | |
| from: "parent", | |
| to: "#system-tests", | |
| scope: "#system-tests", | |
| }, | |
| { | |
| dictionary: "starnix-volume", | |
| from: "parent", | |
| to: "#system-tests", | |
| 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.exception.Handler", | |
| "fuchsia.kernel.CpuResource", | |
| "fuchsia.kernel.DebuglogResource", | |
| "fuchsia.kernel.DebugResource", | |
| "fuchsia.kernel.EnergyInfoResource", | |
| "fuchsia.kernel.HypervisorResource", | |
| "fuchsia.kernel.InfoResource", | |
| "fuchsia.kernel.IommuResource", | |
| "fuchsia.kernel.IoportResource", | |
| "fuchsia.kernel.IrqResource", | |
| "fuchsia.kernel.MmioResource", | |
| "fuchsia.kernel.MsiResource", | |
| "fuchsia.kernel.PowerResource", | |
| "fuchsia.kernel.ProfileResource", | |
| "fuchsia.kernel.RootJob", | |
| "fuchsia.kernel.RootJobForInspect", | |
| "fuchsia.kernel.SamplingResource", | |
| "fuchsia.kernel.SmcResource", | |
| "fuchsia.kernel.StallResource", | |
| "fuchsia.kernel.Stats", | |
| "fuchsia.kernel.TracingResource", | |
| "fuchsia.kernel.VmexResource", | |
| "fuchsia.media.ProfileProvider", | |
| // Needed for Bluetooth streaming E2E tests. | |
| // TODO(https://fxbug.dev/42171886): 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(https://fxbug.dev/42163671): Remove once e2e is better supported. | |
| "fuchsia.net.http.Loader", | |
| "fuchsia.posix.socket.Provider", | |
| "fuchsia.scheduler.deprecated.ProfileProvider", | |
| "fuchsia.scheduler.RoleManager", | |
| "fuchsia.sysmem.Allocator", | |
| "fuchsia.sysmem2.Allocator", | |
| "fuchsia.vulkan.loader.Loader", | |
| ], | |
| from: "parent", | |
| to: "#system-tests", | |
| }, | |
| { | |
| protocol: "fuchsia.diagnostics.ArchiveAccessor", | |
| from: "parent/diagnostics-accessors", | |
| as: "fuchsia.diagnostics.RealArchiveAccessor", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| dictionary: "diagnostics", | |
| from: "parent", | |
| to: "#system-tests", | |
| }, | |
| // TODO(b/345827642): Remove once out-of-tree users | |
| // have been migrated to dictionaries. | |
| { | |
| protocol: [ | |
| "fuchsia.inspect.InspectSink", | |
| "fuchsia.logger.LogSink", | |
| ], | |
| from: "parent/diagnostics", | |
| to: "#system-tests", | |
| }, | |
| { | |
| storage: "fxfs_tests_data", | |
| from: "self", | |
| as: "data", | |
| to: [ "#system-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. | |
| // audio_device_registry_enumeration_tests_* need system audio. | |
| { | |
| protocol: [ | |
| "fuchsia.audio.device.Registry", | |
| "fuchsia.media.Audio", | |
| "fuchsia.media.AudioDeviceEnumerator", | |
| ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| protocol: [ "fuchsia.factory.WeaveFactoryStoreProvider" ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // RemoteControlService tests need to connect to RemoteControlService. | |
| { | |
| protocol: [ "fuchsia.developer.remotecontrol.connector.Connector" ], | |
| 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: [ "#system-tests" ], | |
| }, | |
| { | |
| storage: "cache", | |
| from: "self", | |
| to: [ "#system-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" ], | |
| }, | |
| // Some non-hermetic tests require access to real input. | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-input", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.input.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| service: "fuchsia.input.report.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // Some non-hermetic tests require access to the real display controller. | |
| { | |
| service: "fuchsia.hardware.display.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // Some non-hermetic tests require access to the haptics service. | |
| // TODO(https://fxbug.dev/491484564): Move this test to a separate realm. | |
| { | |
| service: "fuchsia.hardware.haptics.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // Some non-hermetic tests require access to the GPU and vulkan | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-goldfish-address-space", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.goldfish.AddressSpaceService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-goldfish-control", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.goldfish.ControlService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-goldfish-pipe", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.goldfish.ControllerService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-goldfish-sync", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.goldfish.SyncService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-gpu-performance-counters", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.gpu.magma.PerformanceCounterService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| // audio_driver_tests requires access to audio drivers. | |
| service: [ | |
| "fuchsia.hardware.audio.CodecConnectorService", | |
| "fuchsia.hardware.audio.CompositeConnectorService", | |
| "fuchsia.hardware.audio.DaiConnectorService", | |
| "fuchsia.hardware.audio.StreamConfigConnectorInputService", | |
| "fuchsia.hardware.audio.StreamConfigConnectorOutputService", | |
| ], | |
| 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. | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-mediacodec", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.mediacodec.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| directory: "dev-sysmem", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-securemem", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.hardware.securemem.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| directory: "boot", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "rx*" ], | |
| }, | |
| { | |
| directory: "boot", | |
| from: "parent", | |
| as: "boot-kernel", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| subdir: "kernel", | |
| }, | |
| // 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.Provisioner", | |
| "fuchsia.tracing.controller.Session", | |
| ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // CPU Profiling tests require access to ktrace data to parse results | |
| { | |
| protocol: [ "fuchsia.kernel.Counter" ], | |
| 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: [ "rw*" ], | |
| }, | |
| // flutter_*_runner | |
| { | |
| protocol: [ | |
| "fuchsia.fonts.Provider", | |
| "fuchsia.intl.PropertyProvider", | |
| "fuchsia.memory.debug.MemoryPressure", | |
| "fuchsia.memorypressure.Provider", | |
| "fuchsia.ui.composition.Flatland", | |
| "fuchsia.ui.composition.FlatlandFactory", | |
| ], | |
| 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*" ], | |
| }, | |
| { | |
| storage: "tmp", | |
| from: "self", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have | |
| // been migrated to services. The service capability has been added below. | |
| directory: "dev-gpu", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| rights: [ "r*" ], | |
| }, | |
| { | |
| // This service replaces the directory capability above. | |
| service: "fuchsia.gpu.magma.Service", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| service: "fuchsia.gpu.magma.PowerService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| service: "fuchsia.gpu.magma.TrustedService", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| dictionary: "diagnostics", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| // Proprietary TEE manager's session capabilitites for system tests. | |
| { | |
| dictionary: "tee_session", | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| }, | |
| { | |
| directory: "debug_block", | |
| from: "parent", | |
| to: "#system-tests", | |
| rights: [ "r*" ], | |
| availability: "optional", | |
| }, | |
| { | |
| protocol: [ "fuchsia.power.cpu.manager.Boost" ], | |
| from: "parent", | |
| to: [ "#system-tests" ], | |
| availability: "optional", | |
| }, | |
| ], | |
| } |