qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Richard Henderson" <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PULL 2/3] tests: Enable boot-serial-test for hppa
Date: Fri, 16 Feb 2018 06:53:21 +0100	[thread overview]
Message-ID: <b1fc9805-a231-6f78-ed0d-318a3f1293bb@redhat.com> (raw)
In-Reply-To: <3edd5d86-1c7c-1a32-4203-5ea4c432ad1f@amsat.org>

On 16.02.2018 00:55, Philippe Mathieu-Daudé wrote:
> On 02/04/2018 07:23 PM, Richard Henderson wrote:
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>  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

  parent reply	other threads:[~2018-02-16  5:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-04 22:23 [Qemu-devel] [PULL 0/3] hppa-softmmu update Richard Henderson
2018-02-04 22:23 ` [Qemu-devel] [PULL 1/3] hw/hppa: Use qemu_log_mask instead of fprintf to stderr Richard Henderson
2018-02-04 22:23 ` [Qemu-devel] [PULL 2/3] tests: Enable boot-serial-test for hppa Richard Henderson
2018-02-15 23:55   ` Philippe Mathieu-Daudé
2018-02-16  1:28     ` Philippe Mathieu-Daudé
2018-02-16  5:53     ` Thomas Huth [this message]
2018-02-04 22:23 ` [Qemu-devel] [PULL 3/3] roms/seabios-hppa: Update submodule and image Richard Henderson
2018-02-06 16:02 ` [Qemu-devel] [PULL 0/3] hppa-softmmu update Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1fc9805-a231-6f78-ed0d-318a3f1293bb@redhat.com \
    --to=thuth@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).