[PATCH 11/11] RFC: test: dm: virtio: Test virtio-rng with faked device
Andrew Scull
ascull at google.com
Tue Apr 12 12:33:19 CEST 2022
On Mon, 11 Apr 2022 at 19:35, Simon Glass <sjg at chromium.org> wrote:
>
> On Thu, 31 Mar 2022 at 04:10, Andrew Scull <ascull at 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 at google.com>
> > ---
> > test/dm/virtio.c | 36 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 36 insertions(+)
>
> Reviewed-by: Simon Glass <sjg at 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 at google.com>
More information about the U-Boot
mailing list