pub struct CommonRoutingTest<T: RoutingTestModelBuilder> { /* private fields */ }
Implementations§
Source§impl<T: RoutingTestModelBuilder> CommonRoutingTest<T>
impl<T: RoutingTestModelBuilder> CommonRoutingTest<T>
pub fn new() -> Self
Sourcepub async fn test_use_from_parent(&self)
pub async fn test_use_from_parent(&self)
a
b
a: offers directory /data/foo from self as /data/bar a: offers service /svc/foo from self as /svc/bar a: offers service /svc/file from self as /svc/device b: uses directory /data/bar as /data/hippo b: uses service /svc/bar as /svc/hippo b: uses service /svc/device
The test related to /svc/file
is used to verify that services that require
extended flags, like OPEN_FLAG_DESCRIBE
, work correctly. This often
happens for fuchsia.hardware protocols that compose fuchsia.io protocols,
and expect that fdio_open
should operate correctly.
Sourcepub async fn test_use_from_child(&self)
pub async fn test_use_from_child(&self)
a
b
a: uses directory /data/bar from #b as /data/hippo a: uses service /svc/bar from #b as /svc/hippo b: exposes directory /data/foo from self as /data/bar b: exposes service /svc/foo from self as /svc/bar
Sourcepub async fn test_use_from_self(&self)
pub async fn test_use_from_self(&self)
a: uses protocol /svc/hippo from self
Sourcepub async fn test_use_from_grandchild(&self)
pub async fn test_use_from_grandchild(&self)
a
b
c
a: uses /data/baz from #b as /data/hippo a: uses /svc/baz from #b as /svc/hippo b: exposes directory /data/bar from #c as /data/baz b: exposes service /svc/bar from #c as /svc/baz c: exposes directory /data/foo from self as /data/bar c: exposes service /svc/foo from self as /svc/bar
Sourcepub async fn test_use_from_grandparent(&self)
pub async fn test_use_from_grandparent(&self)
a
b
c
a: offers directory /data/foo from self as /data/bar a: offers service /svc/foo from self as /svc/bar b: offers directory /data/bar from realm as /data/baz b: offers service /svc/bar from realm as /svc/baz c: uses /data/baz as /data/hippo c: uses /svc/baz as /svc/hippo
Sourcepub async fn test_use_builtin_from_grandparent(&self)
pub async fn test_use_builtin_from_grandparent(&self)
a
b
c
a: offers service /svc/builtin.Echo from realm b: offers service /svc/builtin.Echo from realm c: uses /svc/builtin.Echo as /svc/hippo
Sourcepub async fn test_use_from_sibling_no_root(&self)
pub async fn test_use_from_sibling_no_root(&self)
a
/
b
/
d c
d: exposes directory /data/foo from self as /data/bar b: offers directory /data/bar from d as /data/foobar to c c: uses /data/foobar as /data/hippo
Sourcepub async fn test_use_from_sibling_root(&self)
pub async fn test_use_from_sibling_root(&self)
a
/
b c
b: exposes directory /data/foo from self as /data/bar a: offers directory /data/bar from b as /data/baz to c c: uses /data/baz as /data/hippo
Sourcepub async fn test_use_from_niece(&self)
pub async fn test_use_from_niece(&self)
a
/
b c
/
d
d: exposes directory /data/foo from self as /data/bar b: exposes directory /data/bar from d as /data/baz a: offers directory /data/baz from b as /data/foobar to c c: uses /data/foobar as /data/hippo
Sourcepub async fn test_use_kitchen_sink(&self)
pub async fn test_use_kitchen_sink(&self)
a
/ \
/
b c
/ \ /
d e f g
h
a,d,h: hosts /svc/foo and /data/foo e: uses /svc/foo as /svc/hippo from a, uses /data/foo as /data/hippo from d f: uses /data/foo from d as /data/hippo, uses /svc/foo from h as /svc/hippo
Sourcepub async fn test_use_from_component_manager_namespace(&self)
pub async fn test_use_from_component_manager_namespace(&self)
component manager’s namespace | a
a: uses directory /use_from_cm_namespace/data/foo as foo_data a: uses service /use_from_cm_namespace/svc/foo as foo
Sourcepub async fn test_offer_from_component_manager_namespace(&self)
pub async fn test_offer_from_component_manager_namespace(&self)
component manager’s namespace
|
a
b
a: offers directory /offer_from_cm_namespace/data/foo from realm as bar_data a: offers service /offer_from_cm_namespace/svc/foo from realm as bar b: uses directory bar_data as /data/hippo b: uses service bar as /svc/hippo
Sourcepub async fn test_use_not_offered(&self)
pub async fn test_use_not_offered(&self)
a
b
b: uses directory /data/hippo as /data/hippo, but it’s not in its realm b: uses service /svc/hippo as /svc/hippo, but it’s not in its realm
Sourcepub async fn test_use_offer_source_not_exposed(&self)
pub async fn test_use_offer_source_not_exposed(&self)
a
/
b c
a: offers directory /data/hippo from b as /data/hippo, but it’s not exposed by b a: offers service /svc/hippo from b as /svc/hippo, but it’s not exposed by b c: uses directory /data/hippo as /data/hippo c: uses service /svc/hippo as /svc/hippo
Sourcepub async fn test_use_offer_source_not_offered(&self)
pub async fn test_use_offer_source_not_offered(&self)
a
b
c
b: offers directory /data/hippo from its realm as /data/hippo, but it’s not offered by a b: offers service /svc/hippo from its realm as /svc/hippo, but it’s not offfered by a c: uses directory /data/hippo as /data/hippo c: uses service /svc/hippo as /svc/hippo
Sourcepub async fn test_use_from_expose(&self)
pub async fn test_use_from_expose(&self)
a
b
c
b: uses directory /data/hippo as /data/hippo, but it’s exposed to it, not offered b: uses service /svc/hippo as /svc/hippo, but it’s exposed to it, not offered c: exposes /data/hippo c: exposes /svc/hippo
Sourcepub async fn test_route_protocol_from_expose(&self)
pub async fn test_route_protocol_from_expose(&self)
a
b
a: exposes “foo” to parent from child b: exposes “foo” to parent from self
Sourcepub async fn test_use_from_expose_to_framework(&self)
pub async fn test_use_from_expose_to_framework(&self)
a
/
b c
b: exposes directory /data/foo from self as /data/bar to framework (NOT realm) a: offers directory /data/bar from b as /data/baz to c, but it is not exposed via realm c: uses /data/baz as /data/hippo
Sourcepub async fn test_offer_from_non_executable(&self)
pub async fn test_offer_from_non_executable(&self)
a
b
a: offers directory /data/hippo to b, but a is not executable a: offers service /svc/hippo to b, but a is not executable b: uses directory /data/hippo as /data/hippo, but it’s not in its realm b: uses service /svc/hippo as /svc/hippo, but it’s not in its realm
Sourcepub async fn test_route_filtered_aggregate_service(&self)
pub async fn test_route_filtered_aggregate_service(&self)
a
/ |
b c d
a: offers “foo” from both b and c to d b: exposes “foo” to parent from self c: exposes “foo” to parent from self d: uses “foo” from parent routing an aggregate service with non-conflicting filters should succeed.
Sourcepub async fn test_route_anonymized_aggregate_service(&self)
pub async fn test_route_anonymized_aggregate_service(&self)
a | b /| c d
a: offers “foo” from self to b
b: offers “foo” from parent, c, and itself to d, forming an aggregate
c: exposes “foo” to parent from self
d: uses “foo” from parent
routing an aggregate service without specifying a source_instance_filter should fail.
Sourcepub async fn test_use_directory_with_subdir_from_grandparent(&self)
pub async fn test_use_directory_with_subdir_from_grandparent(&self)
a
b
c
a: offers directory /data/foo from self with subdir ‘s1/s2’ b: offers directory /data/foo from realm with subdir ‘s3’ c: uses /data/foo as /data/hippo
Sourcepub async fn test_use_directory_with_subdir_from_sibling(&self)
pub async fn test_use_directory_with_subdir_from_sibling(&self)
a
/
b c
b: exposes directory /data/foo from self with subdir ‘s1/s2’
a: offers directory /data/foo from b
to c
with subdir ‘s3’
c: uses /data/foo as /data/hippo
Sourcepub async fn test_expose_directory_with_subdir(&self)
pub async fn test_expose_directory_with_subdir(&self)
a
b
c
c: exposes /data/foo from self
b: exposes /data/foo from c
with subdir s1/s2
a: exposes /data/foo from b
with subdir s3
as /data/hippo
use /data/hippo from a’s exposed dir
pub async fn test_expose_from_self_and_child(&self)
pub async fn test_use_not_exposed(&self)
Sourcepub async fn test_invalid_use_from_component_manager(&self)
pub async fn test_invalid_use_from_component_manager(&self)
(cm) | a
a: uses an invalid service from the component manager.
Sourcepub async fn test_invalid_offer_from_component_manager(&self)
pub async fn test_invalid_offer_from_component_manager(&self)
(cm) | a | b
a: offers an invalid service from the component manager to “b”. b: attempts to use the service
Sourcepub async fn test_event_stream_aliasing(&self)
pub async fn test_event_stream_aliasing(&self)
Tests event stream aliasing (scoping rules are applied correctly)
root
|
a
/|
b c d
A offers started to b with scope b, A offers started to c with scope d,
A offers started to d with scope c.
Sourcepub async fn test_use_event_stream_from_above_root(&self)
pub async fn test_use_event_stream_from_above_root(&self)
a
b
b: uses framework events “started”, and “capability_requested”
Sourcepub async fn test_use_event_stream_from_above_root_and_downscoped(&self)
pub async fn test_use_event_stream_from_above_root_and_downscoped(&self)
a
/
b c
/
d e
c: uses framework events “started”, and “capability_requested”,
scoped to b and c.
d receives started which is scoped to b, c, and e.
Sourcepub async fn test_can_offer_capability_requested_event(&self)
pub async fn test_can_offer_capability_requested_event(&self)
a
b
a; attempts to offer event “capability_requested” to b.
Sourcepub async fn test_use_protocol_denied_by_capability_policy(&self)
pub async fn test_use_protocol_denied_by_capability_policy(&self)
a
b
b: uses service /svc/hippo as /svc/hippo. a: provides b with the service but policy prevents it.
Sourcepub async fn test_use_directory_with_alias_denied_by_capability_policy(&self)
pub async fn test_use_directory_with_alias_denied_by_capability_policy(&self)
a
b
b: uses directory /data/foo as /data/bar. a: provides b with the directory but policy prevents it.
Sourcepub async fn test_use_protocol_partial_chain_allowed_by_capability_policy(&self)
pub async fn test_use_protocol_partial_chain_allowed_by_capability_policy(&self)
a
b
c
c: uses service /svc/hippo as /svc/hippo.
b: uses service /svc/hippo as /svc/hippo.
a: provides b with the service policy allows it.
b: provides c with the service policy does not allow it.
Sourcepub async fn test_use_protocol_component_provided_capability_policy(&self)
pub async fn test_use_protocol_component_provided_capability_policy(&self)
a
b
/
c d
b: provides d with the service policy allows denies it.
b: provides c with the service policy allows it.
c: uses service /svc/hippo as /svc/hippo.
Tests component provided caps in the middle of a path
Sourcepub async fn test_use_from_component_manager_namespace_denied_by_policy(&self)
pub async fn test_use_from_component_manager_namespace_denied_by_policy(&self)
component manager’s namespace | a
a: uses service /use_from_cm_namespace/svc/foo as foo
Sourcepub async fn test_route_service_from_parent(&self)
pub async fn test_route_service_from_parent(&self)
a / b
a: offer to b from self b: use from parent
Sourcepub async fn test_route_service_from_child(&self)
pub async fn test_route_service_from_child(&self)
a / b
a: use from #b b: expose to parent from self
Sourcepub async fn test_route_service_from_sibling(&self)
pub async fn test_route_service_from_sibling(&self)
a
/
b c
a: offer to b from child c b: use from parent c: expose from self
Sourcepub async fn test_route_filtered_service_from_sibling(&self)
pub async fn test_route_filtered_service_from_sibling(&self)
a
/
b c
a: offer to b with service instance filter set from child c b: use from parent c: expose from self
Sourcepub async fn test_route_renamed_service_instance_from_sibling(&self)
pub async fn test_route_renamed_service_instance_from_sibling(&self)
a
/
b c
a: offer to b with a service instance renamed from child c b: use from parent c: expose from self
Sourcepub async fn test_route_runner_from_parent_environment(&self)
pub async fn test_route_runner_from_parent_environment(&self)
a
b
a: declares runner “elf” with service format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from “self”. a: registers runner “elf” from self in environment as “hobbit”. b: uses runner “hobbit”.
Sourcepub async fn test_route_runner_from_grandparent_environment(&self)
pub async fn test_route_runner_from_grandparent_environment(&self)
a
b
c
a: declares runner “elf” at path format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from self. a: offers runner “elf” from self to “b” as “dwarf”. b: registers runner “dwarf” from realm in environment as “hobbit”. c: uses runner “hobbit”.
Sourcepub async fn test_route_runner_from_sibling_environment(&self)
pub async fn test_route_runner_from_sibling_environment(&self)
a
/
b c
a: registers runner “dwarf” from “b” in environment as “hobbit”. b: exposes runner “elf” at path format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from self as “dwarf”. c: uses runner “hobbit”.
Sourcepub async fn test_route_runner_from_inherited_environment(&self)
pub async fn test_route_runner_from_inherited_environment(&self)
a
b
c
a: declares runner “elf” at path format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from self. a: registers runner “elf” from realm in environment as “hobbit”. b: creates environment extending from realm. c: uses runner “hobbit”.
Sourcepub async fn test_route_runner_from_environment_not_found(&self)
pub async fn test_route_runner_from_environment_not_found(&self)
a
b
a: declares runner “elf” with service format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from “self”. a: registers runner “elf” from self in environment as “hobbit”. b: uses runner “hobbit”. Fails because “hobbit” was not in environment.
Sourcepub async fn test_route_builtin_runner(&self)
pub async fn test_route_builtin_runner(&self)
a
b
a: registers built-in runner “elf” from realm in environment as “hobbit”. b: uses runner “hobbit”.
Sourcepub async fn test_route_builtin_runner_from_root_env(&self)
pub async fn test_route_builtin_runner_from_root_env(&self)
a
a: uses built-in runner “elf” from the root environment.
Sourcepub async fn test_route_builtin_runner_not_found(&self)
pub async fn test_route_builtin_runner_not_found(&self)
a
b
a: registers built-in runner “elf” from realm in environment as “hobbit”. The ELF runner is registered in the root environment, but not declared as a built-in capability. b: uses runner “hobbit”; should fail.
Sourcepub async fn test_route_builtin_runner_from_root_env_registration_not_found(
&self,
)
pub async fn test_route_builtin_runner_from_root_env_registration_not_found( &self, )
a
a: Attempts to use unregistered runner “hobbit” from the root environment. The runner is provided as a built-in capability, but not registered in the root environment.
Sourcepub async fn test_use_runner_from_child(&self)
pub async fn test_use_runner_from_child(&self)
a
b
a: uses runner “elf” from “#b” as “dwarf”. b: exposes runner “elf” at path format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from self as “dwarf”.
Sourcepub async fn test_use_runner_from_parent(&self)
pub async fn test_use_runner_from_parent(&self)
a
b
a: offers runner “elf” at path format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from self as “dwarf”. b: uses runner “elf” from “parent” as “dwarf”.
Sourcepub async fn test_use_runner_from_parent_environment(&self)
pub async fn test_use_runner_from_parent_environment(&self)
a
b
a: declares runner “elf” with service format!(“/svc/{}”, fcrunner::ComponentRunnerMarker::DEBUG_NAME) from “self”. a: registers runner “elf” from self in environment as “hobbit”. b: uses runner “hobbit” from environment.
Sourcepub async fn test_use_config_from_self(&self)
pub async fn test_use_config_from_self(&self)
a
b
b: declares “fuchsia.MyConfig” capability b: uses “fuchsia.MyConfig” from self
Sourcepub async fn test_use_config_from_parent(&self)
pub async fn test_use_config_from_parent(&self)
a
b
a: declares “fuchsia.MyConfig” capability b: uses “fuchsia.MyConfig” from parent
Sourcepub async fn test_use_config_from_void(&self)
pub async fn test_use_config_from_void(&self)
a
b
a: routes “fuchsia.MyConfig” from void b: uses “fuchsia.MyConfig” from parent