routing_test_helpers

Struct CommonRoutingTest

Source
pub struct CommonRoutingTest<T: RoutingTestModelBuilder> { /* private fields */ }

Implementations§

Source§

impl<T: RoutingTestModelBuilder> CommonRoutingTest<T>

Source

pub fn new() -> Self

Source

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.

Source

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

Source

pub async fn test_use_from_self(&self)

a: uses protocol /svc/hippo from self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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.

Source

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.

Source

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

Source

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

Source

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

Source

pub async fn test_expose_from_self_and_child(&self)

Source

pub async fn test_use_not_exposed(&self)

Source

pub async fn test_invalid_use_from_component_manager(&self)

(cm) | a

a: uses an invalid service from the component manager.

Source

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

Source

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.

Source

pub async fn test_use_event_stream_from_above_root(&self)

a
b

b: uses framework events “started”, and “capability_requested”

Source

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.

Source

pub async fn test_can_offer_capability_requested_event(&self)

a
b

a; attempts to offer event “capability_requested” to b.

Source

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.

Source

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.

Source

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.

Source

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

Source

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

Source

pub async fn test_route_service_from_parent(&self)

a / b

a: offer to b from self b: use from parent

Source

pub async fn test_route_service_from_child(&self)

a / b

a: use from #b b: expose to parent from self

Source

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

Source

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

Source

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

Source

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”.

Source

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”.

Source

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”.

Source

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”.

Source

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.

Source

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”.

Source

pub async fn test_route_builtin_runner_from_root_env(&self)

a

a: uses built-in runner “elf” from the root environment.

Source

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.

Source

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.

Source

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”.

Source

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”.

Source

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.

Source

pub async fn test_use_config_from_self(&self)

a
b

b: declares “fuchsia.MyConfig” capability b: uses “fuchsia.MyConfig” from self

Source

pub async fn test_use_config_from_parent(&self)

a
b

a: declares “fuchsia.MyConfig” capability b: uses “fuchsia.MyConfig” from parent

Source

pub async fn test_use_config_from_void(&self)

a
b

a: routes “fuchsia.MyConfig” from void b: uses “fuchsia.MyConfig” from parent

Source

pub async fn test_use_dictionary_protocol_from_self(&self)

Source

pub async fn test_offer_dictionary_to_grandchild_not_supported(&self)

Source

pub async fn test_expose_dictionary_to_grandparent_not_supported(&self)

Auto Trait Implementations§

§

impl<T> Freeze for CommonRoutingTest<T>

§

impl<T> RefUnwindSafe for CommonRoutingTest<T>
where T: RefUnwindSafe,

§

impl<T> Send for CommonRoutingTest<T>
where T: Send,

§

impl<T> Sync for CommonRoutingTest<T>
where T: Sync,

§

impl<T> Unpin for CommonRoutingTest<T>
where T: Unpin,

§

impl<T> UnwindSafe for CommonRoutingTest<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

Source§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Cast the given object into a dyn std::any::Any.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more