Crate netstack_testing_common

Source
Expand description

Provides utilities for Netstack integration tests.

Modules§

constants
Useful constants for tests.
devices
Utilities for interacting with devices during integration tests.
dhcpv4
Utilities for interacting with DHCPv4 client/server during integration tests.
interfaces
Provides utilities for using fuchsia.net.interfaces and fuchsia.net.interfaces.admin in Netstack integration tests.
ndp
Helpers for tests involving the Neighbor Discovery Protocol.
nud
Useful NUD functions for tests.
packets
Packet parsing helpers.
ping
Ping utilities.
realms
Provides utilities for test realms.

Constants§

ASYNC_EVENT_CHECK_INTERVAL
The time to wait between two consecutive checks of an event.
ASYNC_EVENT_NEGATIVE_CHECK_TIMEOUT
Extra time to use when waiting for an async event to not occur.
ASYNC_EVENT_POSITIVE_CHECK_TIMEOUT
Extra time to use when waiting for an async event to occur.

Functions§

annotate
Wraps fut so that it prints event_name and the caller’s location to stderr every interval until fut completes.
get_child_component_event_matcher
Gets an event matcher for component_moniker in realm.
get_component_moniker
Gets the moniker of a component in a test realm, relative to the root of the dynamic collection in which it is running.
get_component_stopped_event_stream
Gets a component event stream yielding component stopped events.
get_deprecated_netstack2_inspect_data
Read an Inspect hierarchy and filter it down to properties of interest from the diagnostics directory of Netstack2. For any other component, please use get_inspect_data, this function doesn’t apply to any other component and won’t work.
get_inspect_data
Gets inspect data in realm.
get_inspect_property
Like get_inspect_data but returns a single property matched by property_selector.
pause_fake_clock
Pauses the fake clock in the given realm.
setup_network
Sets up a realm with a network with no required services.
setup_network_with
Sets up a realm with required services and a network used for tests requiring manual packet inspection and transmission.
sleep
Asynchronously sleeps for specified secs seconds.
try_all
Returns true if the stream only yields true.
try_any
Returns true once the stream yields a true.
wait_for_component_stopped
Like wait_for_component_stopped_with_stream but retrieves an event stream for the caller.
wait_for_component_stopped_with_stream
Waits for a stopped event to be emitted for a component in a test realm.

Type Aliases§

Result
An alias for Result<T, anyhow::Error>.