| { |
| include: [ "sdk/lib/diagnostics/syslog/client.shard.cml" ], |
| program: { |
| binary: "bin/shutdown_shim_mock_services", |
| }, |
| children: [ |
| { |
| name: "test-driver", |
| url: "fuchsia-pkg://fuchsia.com/shutdown-shim-integration-test#meta/test-driver.cm", |
| }, |
| ], |
| collections: [ |
| // These collections all contain different environments the |
| // shutdown-shim could find itself in. These integration tests create a |
| // new shim in each collection, feed it input, and see which mock |
| // services it accesses to perform its job. |
| { |
| // In this collection statecontrol.Admin is present and functioning |
| // correctly |
| name: "shutdown-shim-statecontrol-present", |
| durability: "transient", |
| }, |
| { |
| // In this collection statecontrol.Admin is present but the provider |
| // of it does not respond to requests (requests hang forever) |
| name: "shutdown-shim-statecontrol-missing", |
| durability: "transient", |
| }, |
| { |
| // In this collection statecontrol.Admin is not available at all, |
| // and connection attempts to it result in a routing failure |
| name: "shutdown-shim-statecontrol-not-present", |
| durability: "transient", |
| }, |
| ], |
| capabilities: [ |
| { |
| protocol: [ |
| "fuchsia.device.manager.SystemStateTransition", |
| "fuchsia.hardware.power.statecontrol.Admin", |
| "fuchsia.sys2.SystemController", |
| "fuchsia.test.shutdownshim.Tests", |
| ], |
| }, |
| { |
| protocol: "black_hole-fuchsia.hardware.power.statecontrol.Admin", |
| path: "/black_hole/svc/fuchsia.hardware.power.statecontrol.Admin", |
| }, |
| ], |
| use: [ |
| { runner: "elf" }, |
| { |
| protocol: "fuchsia.sys2.Realm", |
| from: "framework", |
| }, |
| ], |
| offer: [ |
| { |
| protocol: [ "fuchsia.test.shutdownshim.Tests" ], |
| from: "self", |
| to: [ "#test-driver" ], |
| }, |
| { |
| protocol: [ "fuchsia.logger.LogSink" ], |
| from: "parent", |
| to: [ "#test-driver" ], |
| }, |
| { |
| protocol: [ "fuchsia.boot.WriteOnlyLog" ], |
| from: "parent", |
| to: [ |
| "#shutdown-shim-statecontrol-missing", |
| "#shutdown-shim-statecontrol-not-present", |
| "#shutdown-shim-statecontrol-present", |
| ], |
| }, |
| |
| // #shutdown-shim-statecontrol-present gets the correct versions of |
| // everything |
| { |
| protocol: [ |
| "fuchsia.device.manager.SystemStateTransition", |
| "fuchsia.hardware.power.statecontrol.Admin", |
| "fuchsia.sys2.SystemController", |
| ], |
| from: "self", |
| to: [ "#shutdown-shim-statecontrol-present" ], |
| }, |
| |
| // #shutdown-shim-statecontrol-missing gets everything, but statecontrol |
| // is black holed |
| { |
| protocol: [ |
| "fuchsia.device.manager.SystemStateTransition", |
| "fuchsia.sys2.SystemController", |
| ], |
| from: "self", |
| to: [ "#shutdown-shim-statecontrol-missing" ], |
| }, |
| { |
| protocol: "black_hole-fuchsia.hardware.power.statecontrol.Admin", |
| from: "self", |
| as: "fuchsia.hardware.power.statecontrol.Admin", |
| to: [ "#shutdown-shim-statecontrol-missing" ], |
| }, |
| |
| // #shutdown-shim-statecontrol-not-present gets no statecontrol at all, |
| // but everything else is present |
| { |
| protocol: [ |
| "fuchsia.device.manager.SystemStateTransition", |
| "fuchsia.sys2.SystemController", |
| ], |
| from: "self", |
| to: [ "#shutdown-shim-statecontrol-not-present" ], |
| }, |
| ], |
| expose: [ |
| { |
| protocol: "fuchsia.test.Suite", |
| from: "#test-driver", |
| }, |
| ], |
| } |