From patchwork Thu Oct 20 11:52:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 616752 Delivered-To: patch@linaro.org Received: by 2002:a17:906:1c0f:b0:78b:b85f:9498 with SMTP id k15csp348594ejg; Thu, 20 Oct 2022 06:51:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM50Z+aNaLCG1c6Yw0gG73JUrsC0dqWgjyTaehhgXyPq2DHZzubq0vgT/tPxy9VE+jPJx8s7 X-Received: by 2002:a37:e118:0:b0:6ec:565e:f2d8 with SMTP id c24-20020a37e118000000b006ec565ef2d8mr9331179qkm.719.1666273902109; Thu, 20 Oct 2022 06:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666273902; cv=none; d=google.com; s=arc-20160816; b=VrsVK3/uW0xH9bLeqQ5vqziH+Q99p5a61elZLpyc4/RssusBgpPEaxgGzY4yA0HPnU UWtzVZF8kmaMJ8AdQ2Z5aGgQk7mNfHpqTsusR9wm0U6DFRAmEu3jIo1E6JuvxkgZWzKc hY31H9HaFPhVKnFqIWU/3IGoXhSiq9xlMwSkSsvNSj/RhXKuC9ft9CJe/D8ZsY+ZbqW5 ULKMgOP2zv8GnHxWT9dluGDCllvvG3R/0tAajL+ja/E1YSmZ68298XWckntZh3gdf8JQ 2W7q/PjL5W66vFosKjNGXrZSx0rzDJPWD2PWcVuLOVRsZRa4Ww8ZU0Px8Cev347tsTFS 9auw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=32dQNvuQE0WB5UgXj4/0Ow+Vp+DtTMBdaIfa03x7tow=; b=sqWwAFIF1MWHqBZjbnngnwgY+tXJxWlEPPoerhUCNZhyFEJpAOgIwma9apIK0f+PH6 XvVV3ZuHlElSj1xyIb6J6wgol+YjWyQHTLtK0iotY3LFm2CyMSw/t3ukusKyYWSI4lO0 4GiQlgUs/JlCi5GfZzzE+nt4CdFnfr+30700PtTU3Ol4BS7MbcFugU+8QCwpBLJ08FaV mZpXb/W9Xkq/Ai3vixEqzFcdQVa/sUfmm28JjM8RWyzkiFeJR19rW4EEqnzd99Z5BKDP O1pdSY05caTbWHPdQgfZ31ji6QxzbKToa6ajet4dxqBns0lnCuH2Ru082Jp4ORn7lRYp nm7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HYr751Jh; 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 fw6-20020a056214238600b004a85378abb9si10436247qvb.425.2022.10.20.06.51.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Oct 2022 06:51:42 -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=HYr751Jh; 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]:52610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olVxU-00018G-GF for patch@linaro.org; Thu, 20 Oct 2022 09:51:40 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olVau-0006TY-Ox for patch@linaro.org; Thu, 20 Oct 2022 09:28:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olUDQ-0000bk-3i for qemu-devel@nongnu.org; Thu, 20 Oct 2022 08:00:19 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:36655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olUDM-00050g-3I for qemu-devel@nongnu.org; Thu, 20 Oct 2022 07:59:59 -0400 Received: by mail-wr1-x431.google.com with SMTP id j7so34031208wrr.3 for ; Thu, 20 Oct 2022 04:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=32dQNvuQE0WB5UgXj4/0Ow+Vp+DtTMBdaIfa03x7tow=; b=HYr751Jhr6JamZPkBp11jC0J709v0eyykBTs7PHtEQgd/X7r5rbLU9Rk2gyr2N0wZw 6M8iEnD+dWMY1GXHbtyagc+Nki+4s0ZXCkZlElFMq4uSWHKlXLlHR7by2gGpHjLYxovd DdTcNGGBhG66WUfYPi3yRGXIcj2ge+aS4IytLi26ujMlITkWiSXkjNdRaqpx+5jC92zC S7D0kBZ9qJ5NrZdSXwtnZQ9H0HdtgSse9qdCHEpSF7AcAqAnD2L/0r1DA7YHjLDjsXbR LKa5StS7lbYOAr/AKMeMAX2SWwKs9wOFVlqntK8CJULXNrYH2W+8fVU4RJggsxv9tD+6 Dziw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=32dQNvuQE0WB5UgXj4/0Ow+Vp+DtTMBdaIfa03x7tow=; b=ETvwQA/Vze/dHTrb3UP3azsmPqNgvnRYqEkZdHD1BVOQ356fZs6/jq8JFT4HWV6Bk7 CVtOsB2EQGCWSG2tl9jnUNkjz9l9zpDrayMYrIw8QQMP1G99Z5MMqI7+qAq13SAOtlBq Mb58jofMosHTWiQKJr2Fi+BluuXoqws8JUxjcwmQorGQAbgJfMJuDqMmolFXDLvH0qv6 6gIWhE8XxkP2j7JbNRTb8LNW/gHZt0htUgMSO/TZqbXm8hKfr5TEGR8mmU7zDI+vt41W 5jbYSaSJ3nsKvYqNa1LJatlt5zFiyoDXgITDVWoYi3/RylKzr2qapmIN4mklYxiaxVx3 L0OA== X-Gm-Message-State: ACrzQf0tOVCeMk7fToul650O4JyLm9HLrpmptSrHPXqe1ZebaAN45rJo lz5THly4H7qQY2CmNQM4YQV8/A== X-Received: by 2002:adf:d215:0:b0:22e:479e:8cc1 with SMTP id j21-20020adfd215000000b0022e479e8cc1mr8836978wrh.39.1666267194806; Thu, 20 Oct 2022 04:59:54 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id b10-20020a5d550a000000b0022860e8ae7csm15881668wrv.77.2022.10.20.04.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 04:59:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CC7E71FFBB; Thu, 20 Oct 2022 12:52:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= 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 , =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PATCH v3 19/26] tests/avocado: raspi2_initrd: Wait for guest shutdown message before stopping Date: Thu, 20 Oct 2022 12:52:02 +0100 Message-Id: <20221020115209.1761864-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221020115209.1761864-1-alex.bennee@linaro.org> References: <20221020115209.1761864-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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" From: Peter Maydell 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 Signed-off-by: Alex Bennée Message-Id: <20221020102012.3015662-1-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé 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 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()