qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Thomas Huth <thuth@redhat.com>, Cleber Rosa <crosa@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Willian Rampazzo <wrampazz@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
	Michael Tsirkin <mst@redhat.com>
Subject: Re: [PATCH] tests/qtest/boot-sector: Check that the guest did not panic
Date: Fri, 12 Feb 2021 14:18:06 +0100	[thread overview]
Message-ID: <32e75366-22fb-823e-2778-ad8fec102060@redhat.com> (raw)
In-Reply-To: <20210212113141.854871-1-thuth@redhat.com>

On 2/12/21 12:31 PM, Thomas Huth wrote:
> The s390-ccw bios code panics if it can not boot successfully. In
> this case, it does not make sense that we wait the full 600 seconds
> for the boot sector test to finish and can signal the failure
> immediately, thus let's check the status of the guest with the
> "query-status" QMP command here, too.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qtest/boot-sector.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/tests/qtest/boot-sector.c b/tests/qtest/boot-sector.c
> index 24df5c4734..ea8f264661 100644
> --- a/tests/qtest/boot-sector.c
> +++ b/tests/qtest/boot-sector.c
> @@ -138,6 +138,7 @@ void boot_sector_test(QTestState *qts)
>      uint8_t signature_low;
>      uint8_t signature_high;
>      uint16_t signature;
> +    QDict *qrsp, *qret;
>      int i;
>  
>      /* Wait at most 600 seconds (test is slow with TCI and --enable-debug) */
> @@ -155,6 +156,14 @@ void boot_sector_test(QTestState *qts)
>          if (signature == SIGNATURE) {
>              break;
>          }
> +
> +        /* check that guest is still in "running" state and did not panic */
> +        qrsp = qtest_qmp(qts, "{ 'execute': 'query-status' }");
> +        qret = qdict_get_qdict(qrsp, "return");
> +        g_assert_nonnull(qret);
> +        g_assert_cmpstr(qdict_get_try_str(qret, "status"), ==, "running");

Interesting idea. Does it make sense to have a similar (optional?) check
done in QEMUMachine? This could benefit integration tests, quicker exit
on failure.

> +        qobject_unref(qrsp);
> +
>          g_usleep(TEST_DELAY);
>      }
>  
> 



  reply	other threads:[~2021-02-12 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 11:31 [PATCH] tests/qtest/boot-sector: Check that the guest did not panic Thomas Huth
2021-02-12 13:18 ` Philippe Mathieu-Daudé [this message]
2021-02-12 13:59   ` Thomas Huth
2021-02-15 19:17   ` John Snow

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=32e75366-22fb-823e-2778-ad8fec102060@redhat.com \
    --to=philmd@redhat.com \
    --cc=crosa@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wrampazz@redhat.com \
    /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).