qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests/acceptance: Add a test with the Fedora 31 kernel and i


From: Cornelia Huck
Subject: Re: [PATCH] tests/acceptance: Add a test with the Fedora 31 kernel and initrd
Date: Wed, 16 Dec 2020 12:41:35 +0100

On Wed, 16 Dec 2020 12:32:22 +0100
Thomas Huth <thuth@redhat.com> wrote:

> On 16/12/2020 11.57, Thomas Huth wrote:

> > +        # Disable blinking cursor, then write some stuff into the 
> > framebuffer
> > +        # ("32-bit encoded", the screendump PPM will then only contain 
> > 24-bit)  
> 
> As just discussed offline with Cornelia, this maybe needs some more
> explanation, so I'd suggest to add something like:
> 
>  # Disable blinking cursor, then write some stuff into the
>  # framebuffer. QEMU's PPM screendumps contain uncompressed
>  # 24-bit values, while the framebuffer uses 32-bit, so we
>  # pad our text with some spaces when writing to the frame-
>  # buffer. Since the PPM is uncompressed, we then can simple
>  # read the written "magic bytes" back from the PPM file to
>  # check whether the framebuffer is working as expected.
> 
> Does that sound ok?

Sound good to me.

> 
>  Thomas
> 
> 
> > +        exec_command_and_wait_for_pattern(self,
> > +            'echo -e "\e[?25l" > /dev/tty0', ':/#')
> > +        exec_command_and_wait_for_pattern(self, 'for ((i=0;i<500;i++)); do 
> > '
> > +            'echo " The  qu ick  fo x j ump s o ver  a  laz y d og" >> 
> > fox.txt;'
> > +            'done',
> > +            ':/#')
> > +        exec_command_and_wait_for_pattern(self,
> > +            'dd if=fox.txt of=/dev/fb0 bs=1000 oflag=sync,nocache ; rm 
> > fox.txt',
> > +            '24+0 records out')
> > +        tmpfile = tempfile.NamedTemporaryFile(suffix='.ppm',
> > +                                              prefix='qemu-scrdump-')
> > +        self.vm.command('screendump', filename=tmpfile.name)
> > +        ppmfile = open(tmpfile.name, "r")
> > +        tmpfile.close
> > +        line = ppmfile.readline()
> > +        self.assertEqual(line, "P6\n")
> > +        line = ppmfile.readline()
> > +        self.assertEqual(line, "1024 768\n")
> > +        line = ppmfile.readline()
> > +        self.assertEqual(line, "255\n")
> > +        line = ppmfile.readline()
> > +        self.assertEqual(line, "The quick fox jumps over a lazy dog\n")
> > +        ppmfile.close
> >   
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]