qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 2/3] tests: Enable boot-serial-test for hppa


From: Thomas Huth
Subject: Re: [Qemu-devel] [PULL 2/3] tests: Enable boot-serial-test for hppa
Date: Fri, 16 Feb 2018 06:53:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 16.02.2018 00:55, Philippe Mathieu-Daudé wrote:
> On 02/04/2018 07:23 PM, Richard Henderson wrote:
>> Reviewed-by: Thomas Huth <address@hidden>
>> Signed-off-by: Richard Henderson <address@hidden>
>> ---
>>  tests/boot-serial-test.c | 1 +
>>  tests/Makefile.include   | 2 ++
>>  2 files changed, 3 insertions(+)
>>
>> diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c
>> index 418c5b92dc..ea87a80be7 100644
>> --- a/tests/boot-serial-test.c
>> +++ b/tests/boot-serial-test.c
>> @@ -87,6 +87,7 @@ static testdef_t tests[] = {
>>        sizeof(kernel_plml605), kernel_plml605 },
>>      { "moxie", "moxiesim", "", "TT", sizeof(bios_moxiesim), 0, 
>> bios_moxiesim },
>>      { "arm", "raspi2", "", "TT", sizeof(bios_raspi2), 0, bios_raspi2 },
>> +    { "hppa", "hppa", "", "SeaBIOS wants SYSTEM HALT" },
>>  
>>      { NULL }
>>  };
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index ca82e0c0cc..83def6994c 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -299,6 +299,8 @@ gcov-files-x86_64-y = $(subst 
>> i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y)
>>  
>>  check-qtest-alpha-y = tests/boot-serial-test$(EXESUF)
>>  
>> +check-qtest-hppa-y = tests/boot-serial-test$(EXESUF)
>> +
>>  check-qtest-m68k-y = tests/boot-serial-test$(EXESUF)
>>  
>>  check-qtest-microblaze-y = tests/boot-serial-test$(EXESUF)
>>
> 
> I got this failure in 2 different branches:
> 
>   GTESTER check-qtest-hppa
> **
> ERROR:tests/boot-serial-test.c:137:check_guest_output: assertion failed:
> (output_ok)
> GTester: last random seed: R02S55e7df877597841c1b3b62962e410123
> make: *** [check-qtest-hppa] Error 1
> make: *** Waiting for unfinished jobs....

Uh, oh, I actually can also reproduce this on my laptop when putting a
lot of load on the system (make -j10 in another window). I think I know
what the problem is: I've introduced a counter in commit 92b540dac9fc3a5
to handle the timeouts in a better way. But in case ccnt reaches 512,
the current read character is ignored - and if that character is part of
the string that we are looking for, the test fails to match the string.

Almost all of the tests look for a string within the first 512 bytes of
firmware output, so the problem never triggered there. But the hppa test
looks for a string at the very end of a long output, so that's likely
the reason that the problem triggered here.

The fix is pretty simple:

diff a/tests/boot-serial-test.c b/tests/boot-serial-test.c
--- a/tests/boot-serial-test.c
+++ b/tests/boot-serial-test.c
@@ -117,7 +117,7 @@ static void check_guest_output(const testdef_t
*test, int fd)
     /* Poll serial output... Wait at most 60 seconds */
     for (i = 0; i < 6000; ++i) {
         ccnt = 0;
-        while ((nbr = read(fd, &ch, 1)) == 1 && ccnt++ < 512) {
+        while (ccnt++ < 512 && (nbr = read(fd, &ch, 1)) == 1) {
             if (ch == test->expect[pos]) {
                 pos += 1;
                 if (test->expect[pos] == '\0') {

I'll submit this as a proper patch...

 Thomas



reply via email to

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