Module testutil

Module testutil 

Source
Expand description

Testing-related utilities.

Structs§

FakeBindingsCtx
Test-only implementation of BindingsContext.
FakeBindingsCtxState
Bindings context state held by FakeBindingsCtx.
FakeCtxBuilder
A builder for FakeCtxs.
FakeDeviceId
A fake device ID for use in testing.
NoOpLinkResolutionNotifier
A link resolution notifier that ignores all notifications.
PureIpDeviceAndIpVersion
A tuple of device ID and IP version.
TestApi
An API struct for test utilities.

Enums§

DispatchedEvent
Wraps all events emitted by Core into a single enum type.
DispatchedFrame
A frame that’s been dispatched to Bindings to be sent out the device driver.
FakeCtxNetworkSpec
The fake network spec to use in integration tests.

Constants§

DEFAULT_INTERFACE_METRIC
The default interface routing metric for test interfaces.

Traits§

CtxPairExt
Extensions to CtxPair when it holds a full stack state.
TestIpExt
An extension trait for Ip providing test-related functionality.

Functions§

new_filter_egress_ip_packet
Creates a new IpPacket with the specified addresses and body.
new_simple_fake_network
Creates a new FakeNetwork of Ctxs in a simple two-host configuration.

Type Aliases§

Ctx
Context available during the execution of the netstack.
FakeCoreCtx
Shorthand for StackState that uses a FakeBindingsCtx.
FakeCtx
Shorthand for Ctx with a FakeBindingsCtx.