qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: fam@euphon.net, berrange@redhat.com, f4bug@amsat.org,
	aurelien@aurel32.net, pbonzini@redhat.com, stefanha@redhat.com,
	crosa@redhat.com, "Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>
Subject: [PATCH v4 19/30] tests/avocado: raspi2_initrd: Wait for guest shutdown message before stopping
Date: Thu, 27 Oct 2022 19:36:25 +0100	[thread overview]
Message-ID: <20221027183637.2772968-20-alex.bennee@linaro.org> (raw)
In-Reply-To: <20221027183637.2772968-1-alex.bennee@linaro.org>

From: Peter Maydell <peter.maydell@linaro.org>

The avocado test
 tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_initrd
finishes with

    exec_command(self, 'halt')
    # Wait for VM to shut down gracefully
    self.vm.wait()

In theory this should be fine. In practice it runs into two bugs:

 * when the test calls self.vm.wait() Avocado closes the socket
   connection to the guest serial console immediately, so the
   avocado logs don't have the last part of the guest output:
   https://gitlab.com/qemu-project/qemu/-/issues/1265
 * when the socket is closed, a bug in the QEMU socket chardev
   means that it loses any data that the guest UART has not
   yet consumed. This means that the guest doesn't always read
   the full 'halt' command string, so the test intermittently
   fails with a timeout:
   https://gitlab.com/qemu-project/qemu/-/issues/1264

Work around both of these by waiting for the guest to print the
string that means it has completed the shutdown process.  This fixes
a very long standing intermittent failure in this test.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/636
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20221020102012.3015662-1-peter.maydell@linaro.org>
---
 tests/avocado/boot_linux_console.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index ca9d09b0d7..eed4b49e6e 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -489,7 +489,7 @@ def test_arm_raspi2_initrd(self):
                                                 'BCM2835')
         exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
                                                 '/soc/cprman@7e101000')
-        exec_command(self, 'halt')
+        exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted')
         # Wait for VM to shut down gracefully
         self.vm.wait()
 
-- 
2.34.1



  parent reply	other threads:[~2022-10-27 19:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 18:36 [PATCH v4 00/30] testing/next pre-PR Alex Bennée
2022-10-27 18:36 ` [PATCH v4 01/30] tests/docker: update fedora-win[32|64]-cross with lcitool Alex Bennée
2022-10-27 21:24   ` Richard Henderson
2022-10-27 18:36 ` [PATCH v4 02/30] tests/docker: update test-mingw to run single build Alex Bennée
2022-10-27 18:36 ` [PATCH v4 03/30] tests/docker: Add flex/bison to `debian-all-test` Alex Bennée
2022-10-27 18:36 ` [PATCH v4 04/30] configure: don't enable cross compilers unless in target_list Alex Bennée
2022-10-27 18:36 ` [PATCH v4 05/30] configure: fix the --enable-static --disable-pie case Alex Bennée
2022-10-27 18:36 ` [PATCH v4 06/30] tests/avocado: extend the timeout for x86_64 tcg tests Alex Bennée
2022-10-27 18:36 ` [PATCH v4 07/30] tests/docker: Add flex/bison to `debian-hexagon-cross` Alex Bennée
2022-10-27 18:36 ` [PATCH v4 08/30] tests/tcg: use regular semihosting for nios2-softmmu Alex Bennée
2022-10-27 18:36 ` [PATCH v4 09/30] tests/tcg/nios2: Tweak 10m50-ghrd.ld Alex Bennée
2022-10-27 18:36 ` [PATCH v4 10/30] semihosting/arm-compat-semi: Avoid using hardcoded /tmp Alex Bennée
2022-10-27 18:36 ` [PATCH v4 11/30] tcg: " Alex Bennée
2022-10-27 18:36 ` [PATCH v4 12/30] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files Alex Bennée
2022-10-27 18:36 ` [PATCH v4 13/30] block/vvfat: Unify the mkdir() call Alex Bennée
2022-10-27 18:36 ` [PATCH v4 14/30] hw/usb: dev-mtp: Use g_mkdir() Alex Bennée
2022-10-27 18:36 ` [PATCH v4 15/30] MAINTAINERS: add entries for the key build bits Alex Bennée
2022-10-27 18:36 ` [PATCH v4 16/30] MAINTAINERS: add features_to_c.sh to gdbstub files Alex Bennée
2022-10-27 18:36 ` [PATCH v4 17/30] MAINTAINERS: fix-up for check-tcg Makefile changes Alex Bennée
2022-10-27 18:36 ` [PATCH v4 18/30] tests/avocado: set -machine none for userfwd and vnc tests Alex Bennée
2022-10-27 18:36 ` Alex Bennée [this message]
2022-10-27 18:36 ` [PATCH v4 20/30] tests/avocado: disable sh4 rd2 tests on Gitlab Alex Bennée
2022-10-27 18:36 ` [PATCH v4 21/30] tests/tcg: re-enable linux-test for sh4 Alex Bennée
2022-10-27 18:36 ` [PATCH v4 22/30] tests/tcg: re-enable threadcount " Alex Bennée
2022-10-27 18:36 ` [PATCH v4 23/30] target/s390x: don't use ld_code2 to probe next pc Alex Bennée
2022-10-27 18:36 ` [PATCH v4 24/30] target/s390x: don't probe next pc for EXecuted insns Alex Bennée
2022-10-27 18:36 ` [PATCH v4 25/30] target/s390x: fake instruction loading when handling 'ex' Alex Bennée
2022-10-27 18:36 ` [PATCH v4 26/30] tests/tcg: include CONFIG_PLUGIN in config-host.mak Alex Bennée
2022-10-27 18:36 ` [PATCH v4 27/30] contrib/plugins: enable debug on CONFIG_DEBUG_TCG Alex Bennée
2022-10-27 18:36 ` [PATCH v4 28/30] contrib/plugins: protect execlog's last_exec expansion Alex Bennée
2022-10-27 21:21   ` Richard Henderson
2022-10-27 18:36 ` [PATCH v4 29/30] tests/unit: cleanups for test-io-channel-command Alex Bennée
2022-10-31 10:24   ` Daniel P. Berrangé
2022-10-27 18:36 ` [PATCH v4 30/30] tests/vm: use -o IdentitiesOnly=yes for ssh Alex Bennée

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=20221027183637.2772968-20-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wainersm@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).