
On Mon, 11 Apr 2022 at 19:35, Simon Glass sjg@chromium.org wrote:
On Thu, 31 Mar 2022 at 04:10, Andrew Scull ascull@google.com wrote:
When looking into possibilities for testing virtio drivers I was trying to simulate the device's responses in the virtqueue. It required a hack to get access to the virtqueue by accessing the driver's private data and only allows pre-programmed buffer returns but no dynamic responses, data or descriptor modifications.
This is an example of a regression test for the virtio-rng fix in the previous patch.
Signed-off-by: Andrew Scull ascull@google.com
test/dm/virtio.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
Seems fine to me.
If using dev_get_priv() in the test is ok, the commit message should be updated: ..
test: dm: virtio: Test virtio-rng with faked device
Add a regression test for virtio-rng reading beyond the end of its buffer if the virtio device provides an invalid length.
Signed-off-by: Andrew Scull ascull@google.com