fuchsia.testing.harness

Added: 20

PROTOCOLS

RealmProxy

Defined in fuchsia.testing.harness/realm_proxy.fidl

This protocol mediates a test suite's access to a component under test.

A RealmProxy is a test harness which allows some test suite to create instances of the component(s) under test on demand. Most importantly, the test suite does not have to know which components are created or how they are created; It is only required to know which capabilities the components expose.

For example, a generic test suite for Fuchsia filesystems can use the RealmProxy protocol to spawn components that serve protocols from the fuchsia.io FIDL library. The test suite doesn't need to know which filesystem it's testing or how the filesystem is initialized. It just needs to call [ConnectToNamedProtocol] with the name of a fuchsia.io protocol and start testing. By running this test suite with different proxies that initialize different filesystems, we can use the same suite to validate each system.

Prefer to connect to RealmFactory instead to obtain an instance of RealmProxy; in the future RealmProxy will no longer be discoverable TODO(https://fxbug.dev/42077343).

Added: HEAD

ConnectToNamedProtocol

Connects [server_end] to the [protocol] from this proxy's namespace.

Request

NameType
protocol string[255]
server_end handle<channel>

Response

NameType
payload RealmProxy_ConnectToNamedProtocol_Result

ConnectToServiceInstance

Connects [server_end] to the [service]/[instance] from this proxy's namespace.

Request

NameType
service string[255]
instance string[255]
server_end handle<channel>

Response

NameType
payload RealmProxy_ConnectToServiceInstance_Result

OpenService

Connects [server_end] to the [service] directory from this proxy's namespace.

Request

NameType
service string[255]
server_end handle<channel>

Response

NameType
payload RealmProxy_OpenService_Result

STRUCTS

RealmProxy_ConnectToNamedProtocol_Response

Defined in fuchsia.testing.harness/realm_proxy.fidl

<EMPTY>

RealmProxy_ConnectToServiceInstance_Response

Defined in fuchsia.testing.harness/realm_proxy.fidl

<EMPTY>

RealmProxy_OpenService_Response

Defined in fuchsia.testing.harness/realm_proxy.fidl

<EMPTY>

ENUMS

OperationError flexible

Type: uint32

Defined in fuchsia.testing.harness/errors.fidl

Fuchsia test harness operation error type.

A harness is responsible for maintaining the state for a particular test run. This type is returned when an operation fails.

NameValueDescription
0

The requested operation is invalid.

This is returned when a test case asked the harness to do something incompatible with the harness' current state. This error signifies a bug in the test code itself.

Returning this value MUST fail the corresponding test.

Example: Test asked for the size of a file before it was created.

1

The requested operation failed.

This is returned when the test harness failed to complete an operation, even though the current state should have permitted the operation to work. This error signifies a bug in a dependency of the harness.

Returning this value MUST fail the corresponding test.

Example: Test asked for the size of a file after it was created, but the query failed.

2

The requested operation is not supported by this harness.

This is returned when the test harness does not support the requested operation. This is not necessarily a fatal error, it is used to signify that the harness has knowledge of what was requested, but it does not implement the behavior.

Returning this value MAY fail the corresponding test, but it does not need to. This return value is useful to determine compatibility with different feature sets or versions.

Example: Test asked for the size of a file, but the ability to check file sizes was removed in the previous component version.

UNIONS

RealmProxy_ConnectToNamedProtocol_Result strict

Defined in fuchsia.testing.harness/realm_proxy.fidl

OrdinalVariantTypeDescription
response RealmProxy_ConnectToNamedProtocol_Response
err OperationError

RealmProxy_ConnectToServiceInstance_Result strict

Defined in fuchsia.testing.harness/realm_proxy.fidl

OrdinalVariantTypeDescription
response RealmProxy_ConnectToServiceInstance_Response
err OperationError

RealmProxy_OpenService_Result strict

Defined in fuchsia.testing.harness/realm_proxy.fidl

OrdinalVariantTypeDescription
response RealmProxy_OpenService_Response
err OperationError

CONSTANTS

NameValueTypeDescription
MAX_PROTOCOL_LEN fuchsia.io/MAX_NAME_LENGTH uint64

The maximum number of characters allowed in a FIDL protocol name. This is set to the maximum length of filesystem node name because we generally use the filesystem for protocol discovery.

Added: HEAD