tree: e001e254a8c50f53bb81384ba483de9dbdda1674 [path history] [tgz]
  1. meta/
  2. src/
  3. test_data/
  4. tests/
  5. BUILD.gn
  6. default.shard.cml
  7. README.md
src/sys/test_runners/inspect/README.md

Inspect Test Runner

Reviewed on: 2021-04-22

Inspect test runner is a test runner that supports checking for the presence of specific Inspect properties on a system. The properties are checked from the global-system Archivist, and these tests should be run in isolation.

Building

fx set core.x64 --with //src/sys/test_runners/inspect
fx build

Examples

Examples to demonstrate how to write an Inspect test:

To run this example:

fx test sample-inspect-tests

Concurrency

Test cases are executed concurrently, respecting the test suite parallel option. The outcome of all tests are pumped together until the referenced property is found or a configurable timeout is reached.

Program Arguments

Each Inspect test exists under the “programs/tests” key in the component manifest with the following structure:

program: {
    accessor: "ALL",     // Possible values: ALL, LEGACY, FEEDBACK.
    timeout_seconds: 60, // Timeout for these keys in seconds.
    cases: [
      "core/appmgr:root:version",  // A string selector ensures that the given property is present at all.
      "bootstrap/archivist:fuchsia.inspect.Health WHERE [a] a == \"OK\"", // Arbitrary comparisons are supported using Triage format.
    ]
}

For more information about the value of the expression key, see the Triage codelab.

Limitations

No known current limitations.

Testing

Run:

fx test inspect-test-runner-unit-test

fx test inspect-runner-integration-test

Source layout

The entrypoint is located in src/main.rs, the FIDL service implementation and all the test logic exists in src/test_server.rs. Unit tests are co-located with the implementation. Integration tests are located in tests folder.