From patchwork Thu Oct 20 10:20:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 616716 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp162749pvb; Thu, 20 Oct 2022 03:39:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4R45PqR06MYsSBQbh0c5bUW5Wf1UboGJKp/TdKovLoOB7vHIcE3Qq8jQ0TvGFRiUuRkvkq X-Received: by 2002:a05:622a:100e:b0:39c:e7d2:21d0 with SMTP id d14-20020a05622a100e00b0039ce7d221d0mr10248954qte.352.1666262348170; Thu, 20 Oct 2022 03:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666262348; cv=none; d=google.com; s=arc-20160816; b=Kk88SPLpO+DMYQLK62hp3x372Mcyvh6p4IEXPBpfrsVp5BPqCbSppcxTXGrPB2poZu nGR/AylaOAQtwRZmgpByz90Hy42vqP3TlPkZI9iGhCVJJuDiGc0Ik6NYMNPrI6r/muh5 j4S52+n+g2mHHG/GpGH0bUd3vMk/HomT4QXbFEnun+9ItAggXQmrBl7lRHdvl4Pebi0g Ob+LcsJCHn/3SVnvEJeUHESTw1unKCC5VkqnvLyLeF8lMRaNd+BaGfG0xm3cgt97QVcP KIAsMrIfuMOAK1KoL/nlqfQCTUQgtfx/pbT3oSycpeTQ6rLZwZM4zly5cuI96q8k1zem 3JcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=+TEzLKXHSYLYaRf2ur7/YkVrD096ac7fNMXbBKKnNGw=; b=MCbOvKxgV8NJLM431MGL738D/Z23PXZ7XViuXN8f6px+8FnLRNM50+6Ce8XSKRpnWL PIlCNUIkOVFx5TcO02yB0ar+J0vOQy0LVaZwg5WIZkGhVXR+COcpnkf26X4M9q5OA6A6 rkqESMuNn1MxqsyGa18FYubSMpJPRcYNHSKRwuL3m5elhYGLYBwC61JpeR+BxOmT3sbw 2v3xljsR776I5x3jXHxts97+RSeSIqrxwc1YGCMyQvnk+eSjg0UAu7x5KIgpPd+5ykmk eirvFq62VaxoQ3dCvjXFzV+4FC4oQyxLoqreXJMO0vWfRRWmwfTy8VFE0pdke362RPEf xLOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qbSKD5FN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fy17-20020a05622a5a1100b0039ce18eded9si8233669qtb.535.2022.10.20.03.39.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Oct 2022 03:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qbSKD5FN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olSx9-0000pO-3M for patch@linaro.org; Thu, 20 Oct 2022 06:39:07 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olSmY-0004YD-KJ for patch@linaro.org; Thu, 20 Oct 2022 06:28:10 -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) 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-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) 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) 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: John Snow --- 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 halted') # Wait for VM to shut down gracefully self.vm.wait()