From nobody Tue Nov 4 15:26:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530219284349437.9208771655144; Thu, 28 Jun 2018 13:54:44 -0700 (PDT) Received: from localhost ([::1]:38557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdwB-0006XC-A9 for importer@patchew.org; Thu, 28 Jun 2018 16:54:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdBH-00080d-Mj for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:06:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYdBG-0001gt-LF for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:06:15 -0400 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]:37253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYdBG-0001ea-EJ for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:06:14 -0400 Received: by mail-wr0-x22e.google.com with SMTP id k6-v6so6689076wrp.4 for ; Thu, 28 Jun 2018 13:06:14 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 127-v6sm6211110wmd.18.2018.06.28.13.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=o+nkNwRakOqNcLHJIz2rtJm7d1CX5+MB94kB1BbNP5c=; b=FTmieeQ1KHjstAPigyLaB63P1+a5Rxj1616fsalOX6OY63h4WZuhjnhQBjcL/V7e6B RQLeZrpvhBi1gXtyRmn5YTxLPUBl1bO9BWM2FMddnbX2IYopEYJ6981TDylPVUrhqiK7 qb1+kEEqmpAAiDnW0KL08RIoDous4qNXhlBL16+cbgfb2GdYYUmXiqd42Lnu17pG+J8a PgjGWILituYPtpgrssAW21kO6bDqDnTyhuPfTzh3YTPjJOmyUq/cekqh1VPVOOCLmLM5 +qOYbwNwSaxxnyosZ4L8ONAd+XVpRMPkQU1oLyzvafT4nnBCjCuCa/Au7k3fK8UGGHMY KB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=o+nkNwRakOqNcLHJIz2rtJm7d1CX5+MB94kB1BbNP5c=; b=e4WEtrlBEIHiwpCHLwPN01d+xL8pSXPvymAKbo3krKa47M1zjzET7uJkl/GEgCU04M MT1gDNUQoki7cWXiZR7cfUQ0Azdg+sBlsS+UQJxgRzWIzuKlMkaggyl6eRwKw/VZW9w3 2RZG6r2MMDv97BZZauFbNI0Jfy8gMCvep/9DzX6zYQsPciCc7bzCi2lqhPfeyw4hBeO6 2/w2tLokXBNKdgKx/4aIP3us6rUrFwz0O1i/KPlp0v5peO1uqQ0ybH3FUyWYML4Cp5Mj qmpSxPNZNdBeeEWcb3Uu/oACMFYd2qs9b0t0WL8WVSvEzSbZ646gSAta4/Noia+b3KKY HBbw== X-Gm-Message-State: APt69E13QKZVG2cBTeh9+pMBOGzl50abej0P/L72+/Tp6oaw8WRA/CeF hF8jWXnYJbie3d7OEU9RdGGQ7SrJ X-Google-Smtp-Source: AAOMgpdWaOB/hTjQRrbOxUYQSlOqisOtzvqe846AiDkme8dihnRpZs9gR0TGhXz9pBvnb2OwwLLnSQ== X-Received: by 2002:adf:adc9:: with SMTP id w67-v6mr2239155wrc.135.1530216373098; Thu, 28 Jun 2018 13:06:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 22:05:10 +0200 Message-Id: <1530216310-52873-61-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> References: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22e Subject: [Qemu-devel] [PULL 60/60] tests/boot-serial: Do not delete the output file in case of errors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Peter reported that the boot-serial tester sometimes runs into timeouts with SPARC guests. It's currently completely unclear whether this is due to too much load on the host machine (so that the guest really just ran too slow), or whether there is something wrong with the guest's firmware boot. For further debugging, we need the serial output of the guest in case of errors, so instead of unlinking the file immediately, this is now only done in case of success. In case of error, print the name of the file with the serial output via g_error() (which then also calls abort() internally to mark the test as failed). Signed-off-by: Thomas Huth Message-Id: <1526977831-31129-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- tests/boot-serial-test.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index 4d6815c..952a2e7 100644 --- a/tests/boot-serial-test.c +++ b/tests/boot-serial-test.c @@ -111,9 +111,8 @@ static testdef_t tests[] =3D { { NULL } }; =20 -static void check_guest_output(const testdef_t *test, int fd) +static bool check_guest_output(const testdef_t *test, int fd) { - bool output_ok =3D false; int i, nbr =3D 0, pos =3D 0, ccnt; char ch; =20 @@ -125,8 +124,7 @@ static void check_guest_output(const testdef_t *test, i= nt fd) pos +=3D 1; if (test->expect[pos] =3D=3D '\0') { /* We've reached the end of the expected string! */ - output_ok =3D true; - goto done; + return true; } } else { pos =3D 0; @@ -136,8 +134,7 @@ static void check_guest_output(const testdef_t *test, i= nt fd) g_usleep(10000); } =20 -done: - g_assert(output_ok); + return false; } =20 static void test_machine(const void *data) @@ -180,12 +177,16 @@ static void test_machine(const void *data) "-no-shutdown -serial chardev:serial0 %s", codeparam, code ? codetmp : "", test->machine, serialtmp, test->extra); - unlink(serialtmp); if (code) { unlink(codetmp); } =20 - check_guest_output(test, ser_fd); + if (!check_guest_output(test, ser_fd)) { + g_error("Failed to find expected string. Please check '%s'", + serialtmp); + } + unlink(serialtmp); + qtest_quit(global_qtest); =20 close(ser_fd); --=20 1.8.3.1