From patchwork Thu Nov 21 16:57:43 2024 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: 844683 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:8b:b0:382:43a8:7b94 with SMTP id m11csp2385112wrx; Thu, 21 Nov 2024 09:02:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV6hR+k0HPT5muQpAtjxl3lbv28SSU6SxBerlKNJGqN/6KUI1gZv08UKPr5W775JvyyrcgHqA==@linaro.org X-Google-Smtp-Source: AGHT+IGw2SyjprUNlM9UGb5A1mRvBwsFcXnKVIB8SmxzEVPeHpfNd+Sq3unIBJTwIVsi4T9P4KJ6 X-Received: by 2002:ac8:7f0e:0:b0:45f:20b:c1c8 with SMTP id d75a77b69052e-464777e1648mr77634751cf.9.1732208546507; Thu, 21 Nov 2024 09:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732208546; cv=none; d=google.com; s=arc-20240605; b=EXkpegsrsFDkLaCxv19o0xVfYIBdkbGPsVQ1x8dxOJ1iJ6SHo8gJKb3FFfWyYJ8ghb ja4xVUJaU0IR8mCb2WysRM2JHkTLcqxDI8K2C2rERjcH48twgx3EUOwBoYCsrNqmM8uc F4FC45Ipelbu0fdNZ5gfwQNOo+n1KfJBxL4FPLjav9ucnReyleO0D1Ni3fYHihfYFHlA kwkpn58RArbtaO/Xihmrl43QeV/w1s+sKwA8vZjDR3y9CdQTEbKYT51lZOEyUcWUbTLR 5+QylRSIODxd2FL94b0hrmmvM/gGflwR/XPR7T2fgvWHnz3ObIWArTXsRRjhFC9hEL+e 4XBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=KjYXio7sBTQrYDC2ySSBbQ9mNKNL4IwihX3wcslKJhg=; fh=kD8gGl3e3ra3edo6fHRuv01yNgMQ5IRvVhUmLIIG5FM=; b=bopdViRHT/iY4tyupiSbmtehv1LUPmYLuiAWouHXMJvXa29n1XRCWx1C5RzeUfYO6I jV0N2XIZPoBPkufDrRD6kYbmLqWShFNNj7LSrw1FAKq8jg0xwcaPRqCtrxC2ni4Mm2c3 Tn33JoGiSusoWh8q48ZVzJRoap+tRYzAO5EJw/8k0aePxOomflHrjF6lFHmgTGV2/HOC hkm2Is/L6Hgr8EKpoFlFPSncE2x2bJ58SE/CvDVHYF8BbxcwvaX1i7PJe/Nj6odDj7dy /yjL4foHzFiL3LV3rBtuMpEv6Z9d+llio5ylKe1dN7nbRl7T0hDYR58ORo4/8N0s4WWu kC5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cutSNmQx; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4653c486630si943771cf.372.2024.11.21.09.02.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Nov 2024 09:02:26 -0800 (PST) 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=cutSNmQx; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEAWT-0005kv-43; Thu, 21 Nov 2024 11:59:17 -0500 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 1tEAVq-0004nr-T1 for qemu-devel@nongnu.org; Thu, 21 Nov 2024 11:58:39 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tEAVW-00084w-TW for qemu-devel@nongnu.org; Thu, 21 Nov 2024 11:58:38 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4315df7b43fso10079385e9.0 for ; Thu, 21 Nov 2024 08:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732208297; x=1732813097; darn=nongnu.org; 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=KjYXio7sBTQrYDC2ySSBbQ9mNKNL4IwihX3wcslKJhg=; b=cutSNmQxpdR0O3gRXmcF7OuN0CB961t2alKds9f1HPP+qFT1EJVYdAz5CiETZvYNCL Lf1IdtcHw8/Y9BGmWd7e3bO6lsNvHdWjIa8oSAi/+ccJ7EpaGtLglDySdpUswazpCeYK 7HNNuRrqQ7RD18Q1L7P5XU48L3bBcWr/TXmdGz2k7jmgu24I1Mz9ZfyqJrp0Zjy5LUq/ fpNObBzEgbf0yyARJ0DGxGV8i/5+KYTORvhJjBkqmFkdddslokgftS92cKPsX2VsfAEM hoFLF4dn6ssz5B37uEKuV7Lka2GTv5QbKMZmDJmJB8RgH4iqiLOztiOCSmDpnNIZXxFQ 9p8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732208297; x=1732813097; 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=KjYXio7sBTQrYDC2ySSBbQ9mNKNL4IwihX3wcslKJhg=; b=t2QbK4s1AhkG77xmsdoTFMS+ovRJwOWsTCURQ+uKmlEVVTBVTcD06EdNiXAf7EVvdU wbJmz0YMEuX1I7OOjRaRsgujB2iIXEkl15wZEO/TrVkmiweV1LqEZ3QSSF7g3t/Bk0UW wqLMWuT5FXgGSjuamJscmkOn5bANMnKX1kWkN4aUtFUsxYXdapeMN/ZCpMUqIjACy0si Nz8lA1t4GoWQ4rs9hEHzGATDRH1VH7H2JY2U2cW/qV/27dNN7QM2hk+A3l+UfKX0kNG4 rXdVZmjRCD2/Uh+AKlN4nUgNZh0nuCwkOCkA5xXN9H55T7qxIs5dP2hdnHUlN3PmhwFJ FNWQ== X-Gm-Message-State: AOJu0YxtHbHJqtyNV8LAa6XyBCMuvFJd7ktAxScrbNt3qFZV9rDcgOf7 UV552uFtEgwp/ZXnzBgZt4QZsdBNLi1yNfsYyxNWo/9QhkQ5sByHyAVhI4Ugxg0= X-Gm-Gg: ASbGncvq3rI/tQQcPpZi9cGm9rosqnSD6/mLVrd5PxVipQtmZjZV2NxLCh12DsegMHy 9ksSpR+fGqOtx6dzMQYu9FCrao+uymjakzmoPcV15ZfqgCeVPDcWpAdl7Qqniz4oBR3m0vunVWT 63Lab4uT9LVuss7M6AlMQxqRZtGyXVmQ5lDKO76AmkHzCrCIJ2+Md2E9PkV4RJGrsM8PO1wFp8I U2X32847gNkIpxog5pqBOgW83I+iACcowfpW6wmXqR1MqRs X-Received: by 2002:a05:600c:1e23:b0:431:157a:986e with SMTP id 5b1f17b1804b1-4334f016fccmr59644595e9.20.1732208296970; Thu, 21 Nov 2024 08:58:16 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fb2679dsm31790f8f.45.2024.11.21.08.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 08:58:14 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DF4D1603EA; Thu, 21 Nov 2024 16:58:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , "Michael S. Tsirkin" , Daniel Henrique Barboza , Pierrick Bouvier , Harsh Prateek Bora , Marcel Apfelbaum , Jiaxun Yang , Halil Pasic , Christian Borntraeger , qemu-ppc@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , qemu-riscv@nongnu.org, Thomas Huth , Bernhard Beschow , Thomas Huth , Eric Farman , Bin Meng , qemu-s390x@nongnu.org, Niek Linnenbank , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , John Snow , Wainer dos Santos Moschetta , Cleber Rosa , qemu-rust@nongnu.org, Nicholas Piggin , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Palmer Dabbelt , Markus Armbruster , Weiwei Li , Mahmoud Mandour , Mark Cave-Ayland , Liu Zhiwei , Aurelien Jarno , Ani Sinha , Alistair Francis Subject: [PATCH 16/39] tests/functional: remove time.sleep usage from tuxrun tests Date: Thu, 21 Nov 2024 16:57:43 +0000 Message-Id: <20241121165806.476008-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241121165806.476008-1-alex.bennee@linaro.org> References: <20241121165806.476008-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.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=unavailable 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-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé The tuxrun tests send a series of strings to the guest to login and then run commands. Since we have been unable to match on console output that isn't followed by a newline, the test used many time.sleep() statements to pretend to synchronize with the guest. This has proved to be unreliable for the aarch64be instance of the tuxrun tests, with the test often hanging. The hang is a very subtle timing problem, and it is suspected that some (otherwise apparently harmless) I/O error messages could be resulting in full FIFO buffers, stalling interaction with the guest. With the newly rewritten console interaction able to match strings that don't have a following newline, the tux run tests can now match directly on the login prompt, and/or shell PS1 prompt. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2689 Signed-off-by: Daniel P. Berrangé Message-Id: <20241121154218.1423005-17-berrange@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- tests/functional/qemu_test/tuxruntest.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/functional/qemu_test/tuxruntest.py b/tests/functional/qemu_test/tuxruntest.py index ed2b238c92..ab3b27da43 100644 --- a/tests/functional/qemu_test/tuxruntest.py +++ b/tests/functional/qemu_test/tuxruntest.py @@ -124,16 +124,12 @@ def run_tuxtest_tests(self, haltmsg): then do a few things on the console. Trigger a shutdown and wait to exit cleanly. """ - self.wait_for_console_pattern("Welcome to TuxTest") - time.sleep(0.2) - exec_command(self, 'root') - time.sleep(0.2) - exec_command(self, 'cat /proc/interrupts') - time.sleep(0.1) - exec_command(self, 'cat /proc/self/maps') - time.sleep(0.1) - exec_command(self, 'uname -a') - time.sleep(0.1) + ps1='root@tuxtest:~#' + self.wait_for_console_pattern('tuxtest login:') + exec_command_and_wait_for_pattern(self, 'root', ps1) + exec_command_and_wait_for_pattern(self, 'cat /proc/interrupts', ps1) + exec_command_and_wait_for_pattern(self, 'cat /proc/self/maps', ps1) + exec_command_and_wait_for_pattern(self, 'uname -a', ps1) exec_command_and_wait_for_pattern(self, 'halt', haltmsg) # Wait for VM to shut down gracefully if it can