Module virtio_device::fake_queue

source ·
Expand description

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 FakeQueue implementation.

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.

Structs§