From patchwork Thu Oct 27 18:36:25 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: 619217 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp508860pvb; Thu, 27 Oct 2022 12:15:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75iPaBkXEp2h/guGJSox3qzb1K+3fqJXGcajAUxB3QZg2BDjUP7ZKNUzjxlMnXgmu4rdGr X-Received: by 2002:a05:622a:155:b0:39c:dd12:3d10 with SMTP id v21-20020a05622a015500b0039cdd123d10mr41082408qtw.202.1666898126107; Thu, 27 Oct 2022 12:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666898126; cv=none; d=google.com; s=arc-20160816; b=GiR9wJHGrnNzBGrOQV5Qowsx+2pso3ehCGS6XPveDV/ZGoeDVwj/0SQK2IeTif8MMy Lewr9GPZLHAQ3EIGgG/EC30LAbMvt4jouLu3kU6x+RETw3+CSqjC6SG3++wE5fyrxzjp 9H+5cWe1du2lKgjiYXVIjam7UdVM1Fyp/GPs42kASEv7Fs8P9ZB2KP+ytTGtuoT9XMfM rf075htrwWmb6wusl21enHQGh+HewHx//tvndZhNtb/tgcDgi4AmYnD9nCpyu5uYh+G+ KuarpoCZpHfxC1Vjy0gKMz2TdQCSqWB+mWEQfngq9XeGXLkaYk31o8xz/aZasbmDaF1n 6hkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=+MUx8tu/rSHErPzSyKT8A82g1ji64kTn3Kr9KzrS0Qo=; b=qAOaXW18IwuYamSqGb99XCLqh6nrzjrVdR60TbPSxqOex8scFkiXY2VJ26VfPFiIRw aXxDZB17D5t58f2wWNQcVIgxL18KJlcTSzoqapo6s0cmLCQgogRO5bChHtBjS1klqjm0 73tLPVny2ol807dRVthV40F1Bx5u0MgoFFZY/7OG0nU5gnzXDGkkqTcP4YH9QwWCZlRA OcLuL6rrGV2gQD7I9f2fpNbhkclq489+Xt4sUn8sdBY2/YrqO6t3ZpsyIUsccdty7mdc oBVy2We9HMjh9aAV5+wKOyvGTLLtNHHv/1PdBRhvH+Dw27bYtiK+wiWjT1BkREUPegMO P9/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V31VVniP; 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 a9-20020ac86109000000b0039cce908bd5si1205328qtm.74.2022.10.27.12.15.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Oct 2022 12:15:26 -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=V31VVniP; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo82t-0001cY-6U; Thu, 27 Oct 2022 14:56:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo82G-000059-C0 for qemu-devel@nongnu.org; Thu, 27 Oct 2022 14:55:27 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo81n-0006AM-KY for qemu-devel@nongnu.org; Thu, 27 Oct 2022 14:55:23 -0400 Received: by mail-wr1-x436.google.com with SMTP id k8so3777607wrh.1 for ; Thu, 27 Oct 2022 11:54:54 -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=+MUx8tu/rSHErPzSyKT8A82g1ji64kTn3Kr9KzrS0Qo=; b=V31VVniP9/h+TPAj1GY6ndRreRTWw9TtoY3WFnnIkfENog3Nkqs6jx0g27npvOe8H7 X+w8OLu/SQjGY60HK+yBj9RZj6dRsP2++Blgny1UNyxER8KahXlWIvfGb1JLstiOYhw/ ZmT2C63sMrshlbxPrsSM+/usScRyS78uiCH/1ee4K7xaZPwhExGjCa4vEmoJXcGKTl+0 K555HWm03gvx/ne08EWlmIw+fhCgRC3HHKoN7qX5n2+gzy2o5F8MWuI8vqMat0U+8wON IMFcSuskPs8PE2O8/9LXTth8M8wNOv1xK5bBlYKd2Acx7V2E+078Ankji5Gm/hCghc43 ZCxw== 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=+MUx8tu/rSHErPzSyKT8A82g1ji64kTn3Kr9KzrS0Qo=; b=125vIlsXBCF3MTGxLnomBRxVa3mR7/ASROO8qGK23mwN0K3iinwMyD6RNnRRzj2vI/ ZrMDEa4irUnrtZQKRgrFZnuPUK+iFJkzwkRZVu/tpFNjdkN1uyHaEW8KNHCCicAfxr4K LcPe6wIXQFUtw7sRVNjW7bVWmR8XCjLXYFgMJrnYuy+eZoWPn2DxB4rijvorA4mRawwQ Clb1z/4C3BNqvxGUgdJukTbYweT0yyLDZCX/m2BOwEvpi2fJfsppPCzyUykKVK3UIpEj ZwbC1eOUsi+1/3TNHPNLO/keqQcC180lWhJe2iS5CmDbhO2ICXbPTZkXZFqKx/1Zd7MR zx/A== X-Gm-Message-State: ACrzQf3VjBCmwJGpoVjcq6tAglWEyc+inPMnBlDanuLH3iVCfSQVrwrG SbRGTr61NeseIGHdechZfGKGVA== X-Received: by 2002:adf:eb41:0:b0:22e:fb16:cc43 with SMTP id u1-20020adfeb41000000b0022efb16cc43mr31508652wrn.489.1666896893055; Thu, 27 Oct 2022 11:54:53 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id j31-20020a05600c1c1f00b003c701c12a17sm5609606wms.12.2022.10.27.11.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 11:54:51 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 21F9C1FFBA; Thu, 27 Oct 2022 19:36:39 +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?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal 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 Message-Id: <20221027183637.2772968-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027183637.2772968-1-alex.bennee@linaro.org> References: <20221027183637.2772968-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell 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 Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth 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()