From patchwork Mon Oct 31 13:09:59 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: 620238 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2820022pvb; Mon, 31 Oct 2022 06:22:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66OOgFC6IVAUAxv6BMDbK/btEB7sD0CTUe/c57O9B7ahnPFUcl/pbAfrEC+TINab2AW4q6 X-Received: by 2002:a37:696:0:b0:6f9:78f9:fac2 with SMTP id 144-20020a370696000000b006f978f9fac2mr8807781qkg.255.1667222546242; Mon, 31 Oct 2022 06:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667222546; cv=none; d=google.com; s=arc-20160816; b=m1k5BA0k1BwQEi+EltpFTkkTCVtP3tLIeOyu5ddDnoJKizkeSEgIYoNTZen/YyJmSs JK7tXIQtxHLKiN9JAdsulw28gEivFDbM2Bla9MJzOaYOn8G6HvWFCYYGD5NWHWhBvu00 SWBmnUk3Kyk5vU2nwHBp9YXQWs1qrKHljEK8XLn/VvWeSakZZ0hdjqhjJ/gzlC2fIXGZ 1QHVnGSJCzMHh3ka1Sdfub/deYltcWjGDAgUyZDcWeRlQ1aGZwdQ4XRbGsgugxMflv+n YgExyfGlH2zyp4ANAQWVE9pSLBzL61+UvpbYSgmGeuBZrDQcOUkGl56ZfQB5Hyfrth1F VcGQ== 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=BNTO1oPO10qcAY9aWmNU3TzyVHXmp7R/Qudvzcnb1Ls=; b=akwLE/QvYFLmmnO8v0YGpSSPXqyA9+tbTwCP//nl+6ag7f0locB88pIlcCgv4ngWxZ 4neyGQS/DfyU5uGZQ+r09GFn6NJTDSLnAGWPYPyLsczxcGRHRqYkdh7Kap2xz4CQSHYo vlcWYyqerzzC6pvnIWcQVAEygSJgEbybBkuUueKvb1QrEuGZnp/t1kumZ/ZFSgIBu06R PD9l2fA5lOBs54vE9k+dR/8kP/HgyDhT71f+ov8TC5Ud7VkFV1idDgKgATGxVSxS9kX0 jA4RY3J8JSVk6XIBb+KttD2bSYzaXhZ7IYDDVxTTBzn1VvUPy8n1FMVmzweq/Pave/Ne 8vrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EniinSF7; spf=pass (google.com: domain of qemu-devel-bounces+peter.griffin=linaro.org+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+peter.griffin=linaro.org+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 m5-20020a0562141bc500b004afa9a702f3si3918113qvc.177.2022.10.31.06.22.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Oct 2022 06:22:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+peter.griffin=linaro.org+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=EniinSF7; spf=pass (google.com: domain of qemu-devel-bounces+peter.griffin=linaro.org+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+peter.griffin=linaro.org+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 1opUiR-0004yz-LO; Mon, 31 Oct 2022 09:20:35 -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 1opUhx-00034H-NE for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:20:07 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opUhp-0005RD-4o for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:20:03 -0400 Received: by mail-wr1-x42f.google.com with SMTP id j15so15953361wrq.3 for ; Mon, 31 Oct 2022 06:19:56 -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=BNTO1oPO10qcAY9aWmNU3TzyVHXmp7R/Qudvzcnb1Ls=; b=EniinSF7WjOkM2VhkvMK8mlh9flKj6JWvuO1RMaSD+Y01/bxBw4AgzQ47BfavTR1lx 3QA5H72AzMFrVdwX0T5du7zqd/TggUzZnkCeAhJGwE3St4mIeYzhQi+XZ5rok16zH3ZG sNoZOmQnhAcTnMPbGNXDliXbMvDFBhk2yXtjsnrkOJ+FHcsNtWnJSgIiAm5pVVuE1WEz DOFa5cMO8Ysj9Yf0Xzh/I+WAZKJRGjr1KIA1jiJLegqi9bmLVAUhkRB3Fem5CkVl7MOi 5Alk7dwLgcZfqn1dz1wj0gd5wfGQc77q1kmZop0s0PO5EfPfoZjkaDQtrrJliU4/kkMD 622Q== 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=BNTO1oPO10qcAY9aWmNU3TzyVHXmp7R/Qudvzcnb1Ls=; b=ndt7Jx9uYHOHtfPMB9hf1vhFlQuvDHgiVqfXVmr/u/5rMItpZzg8I1GSFZ9qgXJ0vk 0KWe1CEeSIIo5zDzFn0zKaWM8YyoByMQykns4onYLs8El0shJ1RMpdWjLPs44BvDVAwm nlSYc30rLvMY2Iuk/KzddDPXV+NXc8YB0P6VsvHxPEvcuzuzA7Oh5iqL/75lcT9MPIDH AmY6j+AkFJeou0dcRrFRwlwH77KBQbey2I9Nrhteq1fN7x/5Nzera7PYf4yby4eg3gPS qVb5mhrs6FD6EGNrJl9bb9MeIuRdkdmpXkcuxFAic7I2/x73o51qB/xoG4hpQ2Ac8ddv z5nw== X-Gm-Message-State: ACrzQf13lrcChbamzVB8n0s0m+NozimT+MSqMleVQr7xm5zWq/mllWik yQLlXmNfjT91FLAtOfyfFVnwGQ== X-Received: by 2002:adf:d1c9:0:b0:225:f98:d602 with SMTP id b9-20020adfd1c9000000b002250f98d602mr8180576wrd.419.1667222395791; Mon, 31 Oct 2022 06:19:55 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id l7-20020a05600c1d0700b003b505d26776sm2182038wms.5.2022.10.31.06.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 06:19:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CEFFF1FFCA; Mon, 31 Oct 2022 13:10:12 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Thomas Huth , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 20/31] tests/avocado: raspi2_initrd: Wait for guest shutdown message before stopping Date: Mon, 31 Oct 2022 13:09:59 +0000 Message-Id: <20221031131010.682984-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221031131010.682984-1-alex.bennee@linaro.org> References: <20221031131010.682984-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+peter.griffin=linaro.org+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> Message-Id: <20221027183637.2772968-20-alex.bennee@linaro.org> 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()