From patchwork Tue Dec 10 20:43:48 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: 848890 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp542341wrn; Tue, 10 Dec 2024 12:50:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWvVrjgUftOpmaIv71/8vmZWN8WaT8yDnYIIGe+JAP2pyURBa4NiCzr0LE5tEs2hAL7567YxA==@linaro.org X-Google-Smtp-Source: AGHT+IFNj+C0CARUZZ2J+ZHvYp6fsNnG6pVZjzNBu8h9O/5Li1uKMq80elhqmwtG/zvdGkKb9SW/ X-Received: by 2002:ad4:5fc8:0:b0:6d8:f0ba:ea92 with SMTP id 6a1803df08f44-6d934b1fb3fmr8364326d6.21.1733863856665; Tue, 10 Dec 2024 12:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733863856; cv=none; d=google.com; s=arc-20240605; b=fNnHR+/ELMXo8gtt9q4vdAw7TT00zM1xwT5bGl+WK/9OHKbKJojkeZTQvijGlLUBwQ FmD2KDedH668Jz3DgjaxvhFEuxsOk2i+xx+fpX+S98BfabA8kwtCYUUviHxHLer0PVn8 Rj0RJhxNan9WSxwPNIEK/5BWzWbeYTVywgLbeWAoG8idvAgPMr+jepZMCAaB1U4YXbXc U0dnbE815LHVyp0xW7KD5P1B4nJ9bPqmKbkBeBF9VV29KzoM4Hmp3OTHuhc3hg3n6kgr 19oPXRGbDimg537yoWaTlMofIlbBM33PT3vO06udsyWKw8qlaeqn7HFjVK0JuD1h4kwK o3cg== 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=wIJJpyZenpuZ0okojMHVhbmLsrOaWx+4kvfZ2g92/J4=; fh=FC288pp5j0mnGELUTZ0Lqjt/J7y8NvB/BPvTKfRC7hs=; b=bqniGleW+vXc5OIvUSW/afndUlv3UUyz9HEMy+MWLKdndBwFKlA1qmaT7+/Vl9EReh MmOBUZCYqluOzliT/GnO3TJeBujO7c0Tv5HYbATyAq4gDfIXXDB64bW/pZyXBs3Ht/Jh 09/T8b9utFHYIZ4Qix8ke49RdB7Egp14z6l/HYIEhCIbZ9usTSoqHceGCg3dUViRWdRk hAu+OPFWt2w9Y4M7uGtpoIvConCfa2h84PrkyvT8rJx9O0NQjopOCCSFyNwRKzcivTiq JOzZeO0Fr1ZtTOjXQVsOZq/yDtCSxIWpyPfOckEb3uikuecRViJtpYEF8wNcP43Iyx+R Le8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w240M4jW; 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 6a1803df08f44-6d8daa08adcsi144785336d6.230.2024.12.10.12.50.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 12:50:56 -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=w240M4jW; 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 1tL7Bu-00042Z-93; Tue, 10 Dec 2024 15:50:46 -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 1tL7Bo-0003iq-Fm for qemu-devel@nongnu.org; Tue, 10 Dec 2024 15:50:40 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL7Bl-00036Q-Tk for qemu-devel@nongnu.org; Tue, 10 Dec 2024 15:50:40 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361a50e337so5027825e9.0 for ; Tue, 10 Dec 2024 12:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733863836; x=1734468636; 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=wIJJpyZenpuZ0okojMHVhbmLsrOaWx+4kvfZ2g92/J4=; b=w240M4jWrF+GDrt2F89/V5e9qGtOM2KPH6OXlaxhVVt1vLy6t9z0VuTsaLAiglUNHQ uzUoe12N+0Y35rRZIxO/xElHq+VC+oExHlFpJiczUsmvAhGV6KyoDWKrsZQt16nhdH4K XaFuN097BttvJOc1nmM+NL98PM1pYUIQja/50ZB53jK93tgnxk73aSse4OgZw0lWdXBu /qeACpufDWMm4BwQw0qAxp9CA4VGW5dRj4wyxLyTLPLncc1IbsbetKVMDCELiV9PnQ1s M1Cu2X8Qfxmzkph0nt9+ulsReqVwPUKJev47W0an2nfpEOM4AVVbWZvWCOE4FQUBbmpx jfYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733863836; x=1734468636; 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=wIJJpyZenpuZ0okojMHVhbmLsrOaWx+4kvfZ2g92/J4=; b=cDPiJEHJyj5akvs3D1HtTfwE2xPuO1szsMXeFaVnF0vpJwz/KUvwQQm1jR1pohkedN B+TfPdbaXMCWjx6HI8sZQ9/M25Dd68PhweKiDeK75gsoSF/74DAiR0X9qudnKcs+g7cY aZ9CaFOQjP1uKgXSSA8qJhyDVer+xOZSsHET5tlbP3R4y3Ztm7JmXDtPbLd0Vw2YTofX dLnLnlM64J7ToSS3YZ6bIvAwMqZOwddeTML9GtxiTBgaepK7S3k2tsxCp10ehjxhRZ2F pAap7HQDG9A/ZLgfaXezhZGhSYDX+x9rE6zIadWRbs93cKlhxgqUcKxE6rw6zoPGXIeq Cc8w== X-Gm-Message-State: AOJu0Yy9zE8/Vj21YdKXMQqUxKrmsQfgnGZpXBmLHSgJ0cp3fEunTanO F+sQZ4v2dBQ4WUJSAOijbkW6PnxqcAwuBQ5JWas7yM9CDX9hGnGfHmRwpgkU7MQ= X-Gm-Gg: ASbGncuJRqK88Q5rME4Ju06P++ZlS8cEySuseZ86AyKFxtSYV9V9Ksf9aXis0aOHMhP Av97R075eW0qkr4pCqnged2RFktk3597Q9PnTiYtM4ZQtuUxVQF/Qjv8ZZPy4ytE23B4mnyPGgT NbYBKBpI42PkUN9RQnbZcXz18+uNDNOBMnlFaKxtxrPNzRKbL7xePA4cEgOOhwHv05kVL/rNvWF k5uaTfZYXNCeKCXwWzeJ/G9lrJpPFNBNTHvIVwH2fiOP0HdUL77 X-Received: by 2002:a05:600c:1c14:b0:434:ff9d:a3a1 with SMTP id 5b1f17b1804b1-4361c396c09mr1968785e9.2.1733863836294; Tue, 10 Dec 2024 12:50:36 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434da0d2303sm206325185e9.3.2024.12.10.12.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 12:50:34 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 036C060B9F; Tue, 10 Dec 2024 20:43:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , qemu-s390x@nongnu.org, Halil Pasic , Jiaxun Yang , Weiwei Li , Liu Zhiwei , Cleber Rosa , Palmer Dabbelt , Leif Lindholm , Eric Farman , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Aurelien Jarno , Paolo Bonzini , Joel Stanley , Bernhard Beschow , qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, Daniel Henrique Barboza , Thomas Huth , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Fabiano Rosas , Markus Armbruster , Bin Meng , Pavel Dovgalyuk , Marcel Apfelbaum , Richard Henderson , Marcin Juszkiewicz , Christian Borntraeger , Beraldo Leal , Peter Maydell , Radoslaw Biernacki , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Nicholas Piggin , Mark Cave-Ayland , "Michael S. Tsirkin" , Alistair Francis Subject: [PATCH 19/20] tests/functional: remove hacky sleep from the tests Date: Tue, 10 Dec 2024 20:43:48 +0000 Message-Id: <20241210204349.723590-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241210204349.723590-1-alex.bennee@linaro.org> References: <20241210204349.723590-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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 We have proper detection of prompts now so we don't need to guess with sleep() sprinkled through the test. The extra step of calling halt is just to flush the final bits of the log (although the last line is still missed). Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- tests/functional/test_aarch64_virt.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/functional/test_aarch64_virt.py b/tests/functional/test_aarch64_virt.py index c967da41b4..801300607c 100755 --- a/tests/functional/test_aarch64_virt.py +++ b/tests/functional/test_aarch64_virt.py @@ -107,18 +107,16 @@ def common_aarch64_virt(self, machine): 'virtio-blk-device,drive=scratch') self.vm.launch() - self.wait_for_console_pattern('Welcome to Buildroot') - time.sleep(0.1) - exec_command(self, 'root') - time.sleep(0.1) - exec_command(self, 'dd if=/dev/hwrng of=/dev/vda bs=512 count=4') - time.sleep(0.1) - exec_command(self, 'md5sum /dev/vda') - time.sleep(0.1) - exec_command(self, 'cat /proc/interrupts') - time.sleep(0.1) - exec_command(self, 'cat /proc/self/maps') - time.sleep(0.1) + + ps1='#' + self.wait_for_console_pattern('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, 'dd if=/dev/hwrng of=/dev/vda bs=512 count=4', ps1) + exec_command_and_wait_for_pattern(self, 'md5sum /dev/vda', ps1) + exec_command_and_wait_for_pattern(self, 'halt -n', 'reboot: System halted') def test_aarch64_virt_gicv3(self): self.common_aarch64_virt("virt,gic_version=3")