From nobody Mon Feb 9 03:29:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1666262450; cv=none; d=zohomail.com; s=zohoarc; b=THVx7kzsyX6L55NBHUnuqLU5L0Vc4uha6xTI3UAVhRX/vLC3CJ2p0S7by87qIouOxTpq+dNJxVC4ZSj+0vqYgSZ6yOcNErw9+bbmbS//XWtIxWmBKHUdK7iERBHLdjX1HjfsYBmpbN1UkSwtOzTm84FpuqcBy6UM/kJ4mphSolc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666262450; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=+TEzLKXHSYLYaRf2ur7/YkVrD096ac7fNMXbBKKnNGw=; b=frasVDZz4xgUzTsePwL9fhKYNpH1mBLf8IVb/WKBKSZIpVWe2CukZJUDHRGFA0i3SLgP1Fe/p3hgkqfysZUc76YUazVPWyvWfKgiqEjPjDhXDT4nMhxQ0Jc2kTXZhs9BC9IX8ZEzGXD1D0xIsd9o+OQWr0Sr0X4fxb5uBMzWyyE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666262450722221.97023789829518; Thu, 20 Oct 2022 03:40:50 -0700 (PDT) Received: from localhost ([::1]:56608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olSyl-00048F-WB for importer@patchew.org; Thu, 20 Oct 2022 06:40:48 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olSrN-0002GQ-1y for importer@patchew.org; Thu, 20 Oct 2022 06:33:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olSew-0004K8-0F for qemu-devel@nongnu.org; Thu, 20 Oct 2022 06:20:18 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:34813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olSeu-0004LB-56 for qemu-devel@nongnu.org; Thu, 20 Oct 2022 06:20:17 -0400 Received: by mail-wm1-x32c.google.com with SMTP id l14-20020a05600c1d0e00b003c6ecc94285so2118932wms.1 for ; Thu, 20 Oct 2022 03:20:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c24-20020a7bc018000000b003b47ff307e1sm2249128wmb.31.2022.10.20.03.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 03:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+TEzLKXHSYLYaRf2ur7/YkVrD096ac7fNMXbBKKnNGw=; b=qbSKD5FNYtrb4ylu4LG71MbNRMYOQthWLifiQRYxD55kYMt8mcCNCw1Rq7AsruuHGQ ESONAlje6LFk8hAJXgdPcuWIyRDuiSYif9bIZ9384jp5R5PNQO5epwZdpPNqcu2p00V0 XKYsDHM2fEQCH+OGLXqfMwIkQ2RnsAYkweZYM+DCUm8G61CNpDGeObchI5n6h19Ii2x7 Ax0nLvPcBjIbRBIouQGiy+ZxARVscbye6AM1oj9xoHg8JcjC65yhaNVJ2+VVsNQmAR35 r439c7vYnPFP+nJubWEQtAa5WVpZELjA4QrovHymmWQyQV3HkTZ24oB11jQzxIPvci/M e5EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+TEzLKXHSYLYaRf2ur7/YkVrD096ac7fNMXbBKKnNGw=; b=OP2wctWtvTSmv+jfmB77u2K0//YSE/YW+gY4wZfwl1fwgdeE5sAWPTCVZ2eO+caIU2 4Whq+wDdkUra6OKtPyMIwLD2TcSOW4MjLdIwWsXLYMxPnF7Pc9qGvdtN48kQbfjpSQFe IZxsoo4LEZc+QkOPRKLoPUyFLdzkSpmGyhUIaQdhj2dStvbKlHVWFH2zd5MqOY+Pgd3N 6n2TiFiGll1eUzIGyJKbVz8K4NBOfIin4iRhq064YbXkYatbV1ZbahQcq/Dd95SO0pEp v5HuAsruW7AHytxv19TIIbCbWdbgv7I++f9+b2T9UzDwy95Jpvy/hr9GSQ8LElBGpVau FGwA== X-Gm-Message-State: ACrzQf0hYEsreGq26MaOhb6gEBilAE7gl29ZxGYOYz6HN6FqbdjhfmKr t//eQf6uAITcx4HV1PBbQ+iAtw== X-Google-Smtp-Source: AMsMyM6U2vroAO0FqNYAdDadNugaGYEyuW83ACucPbn4b/UnXkjkVkTAhIYceRs5zrHIWX+ppbivJw== X-Received: by 2002:a05:600c:219a:b0:3c6:f259:7e30 with SMTP id e26-20020a05600c219a00b003c6f2597e30mr16628662wme.111.1666261214456; Thu, 20 Oct 2022 03:20:14 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Thomas Huth , John Snow Subject: [PATCH] tests/avocado: raspi2_initrd: Wait for guest shutdown message before stopping Date: Thu, 20 Oct 2022 11:20:12 +0100 Message-Id: <20221020102012.3015662-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1666262452179100003 Content-Type: text/plain; charset="utf-8" The avocado test tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_initrd finishes wiith 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 ca9d09b0d7c..eed4b49e6e4 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 ha= lted') # Wait for VM to shut down gracefully self.vm.wait() =20 --=20 2.25.1