Fake queue for simulating driver interactions in unittests
To facilitate writing unittests it is useful to manipulate the queues from the perspective of a a driver. This module contains helpers that allow for:
- Building simple descriptor chains
- Publishing the build descriptors in the available ring
- Receiving written descriptors from the used ring
This functionality centers around the
For simplicity of writing tests the
TestQueue struct packages together all the pieces
commonly needed to write a test.
This module is available as, in addition to be used for writing the unittests for this library, it can also be used for writing unittests for actual virtio device drivers without needing a guest environment.
- Descriptor chain that can be published in a
- Builder for a
- Iterator for the data in a
- Simulates driver side interactions of a queue for facilitating tests.
- Implementation of
crate::mem::DriverMemassuming the identity translation.
- Wraps common state needed for writing test code with a
- Represents a chain returned by a device.