From nobody Tue Dec 24 13:55:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734662860; cv=none; d=zohomail.com; s=zohoarc; b=bRIeXhtQNA1iLl2fV4ZtrhCJhCDUa3CZ34F9Tqj4+JoVdg9ZxBWxRt9D+CGTBI1tL36ntpzTwMRTaUQt2Gnp4RWhv3zMuvXM/UXBqTORIgBRVfmadjuC6JQylcnv+bsVEsPxd1+K2JaAEVytX6+8FZG6/mF1Idzv8MMcZB6lGV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734662860; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m/gqB0EFOflediWblib/x6PojT1X7ZGctVzz4h+o860=; b=ZRnLWlLbpB+sf5OZTrnCWTiR6dNlyKkVLj35exaQ4tQshJIiuGlkkf4kJKxXEROqm3OWr7BwS7KgspzDnrBx3x6KZYUBRcP0XE0vxwVDSce706RGuh2sFkwfFp2+b5omy4IDLOSkqSKFA+V2+wo+GXYodVoLjfOU1iwl3GDAieE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734662860188499.6926636955252; Thu, 19 Dec 2024 18:47:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOT2H-0001vD-Ue; Thu, 19 Dec 2024 21:46:42 -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 1tOT2G-0001tw-15; Thu, 19 Dec 2024 21:46:40 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOT2D-0000IA-2a; Thu, 19 Dec 2024 21:46:38 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-7292a83264eso1306481b3a.0; Thu, 19 Dec 2024 18:46:36 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8dba99sm2037830b3a.92.2024.12.19.18.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 18:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734662794; x=1735267594; 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=m/gqB0EFOflediWblib/x6PojT1X7ZGctVzz4h+o860=; b=i38KUUF6RVCIMLhgP4HvwMFrrsrn6xHtkZ+DPYr3AsTfixW4h18yQ5jJh8DkgD7vgp 1flleHwe8hfzlOh2eev8zdHTI+E4odZ8BHKnyjh+kThcYe/WPVPkMvTyqcH3TpPU4qfh TPYjFXU4T9IHLsYA9fvgtmSIhZl9S37VzH9I8J7FyothlxtcDKcfDpJDYWkShqEccFjS nnUaal6faJGs5+3fYbWLfdYm7tGw0/fzO3IJrm6HCg3HdkthfMsE/Cg+Jlldfwn3hrSy xElWuzTfarv66lqIJUOnx7bVQm2VOGuljbrHg7GAJ/NpCitycTgl/yse7DxgrQdp3mO3 ne1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734662794; x=1735267594; 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=m/gqB0EFOflediWblib/x6PojT1X7ZGctVzz4h+o860=; b=uyAzfbxr7WSWT5dml4YoqAvu633GdKcO3Z7oZXsFbUsZ/DD81QPSz3owRBQnKqvR09 n+X6USVGMubrFEA+gZit8nTLiNFYHAsVY6ZLrrKXKjg2ljz0nOitRU+KAwfKR7pf0zR5 UjVpGur65iN0Jg2qsHp20bohNQJdcWITRkMw65WwIXxbE7JeGWT14/4bxDbmHbCAWeez iKRDbfj0uj40MUJwBvg6ChXNFWBhru37ln2ncSznF2H2gA4UdOcBmoDAtQQS8xVXnQmn c69OJKogxFX4aiuaInf735FQvS9hdq/u1EWaHON2Bktv15k82VuR8PMWOWubCYdhu4np gI9A== X-Forwarded-Encrypted: i=1; AJvYcCW8FubsH2WFhMwhcKI3CRyYiyeBWgHZZdzgAVW4BYi9eVpJt/F/9NDvHuWUdrs17U7vBPGFELpweg==@nongnu.org X-Gm-Message-State: AOJu0Yz+rO3yHkJVauV4OnTaGs6iyX/pj64c5lKfJnjWNLIL/xZ6WwWa R5ZFuLS9bsNIJ23UbO5qWQKMkpwZvB3wnMZ3FJ5K6rkjOhbxkG4Ak66goQ== X-Gm-Gg: ASbGncsVGMts0OfYUeL3mE5RME1D5cJbKpW5GrpAxsJ1Y5n1H5LlTMm2p277jdOSZVs VMBP5VvdwAqR5iEhXd5H5czei2alyv2RZSM6lzK+LF1hulX+eMa4eSk+zGu3+5o24/vFUXI+8dx jvqPkR2R7/SFO/9ALBUf9k/V9dLAJWe4mApVxQ6Dr/l2FFxyrEp0DdjSoNb4OFIbmJ7Vy4pXE1N PtyVktATDyJ5lmvh9+Escueq6Uwh4u4OVjcDAwyDSgbydMMaPu5/rmEO5tYipAysODWKMZZv897 io6ISXnGpg== X-Google-Smtp-Source: AGHT+IFf9N30gN8QAQPjV3GJSValNAtE+UfHt2DeURUnnucrg+j8T4D0UEkQzyWc66bU042Hv5JVjw== X-Received: by 2002:a05:6a21:3994:b0:1db:d932:ddcc with SMTP id adf61e73a8af0-1e5e049f462mr2328172637.19.1734662794491; Thu, 19 Dec 2024 18:46:34 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , Harsh Prateek Bora , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-ppc@nongnu.org Subject: [PATCH 2/4] tests/functional/test_ppc64_hv: Simplify console handling Date: Fri, 20 Dec 2024 12:46:15 +1000 Message-ID: <20241220024617.1968556-3-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220024617.1968556-1-npiggin@gmail.com> References: <20241220024617.1968556-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=npiggin@gmail.com; helo=mail-pf1-x435.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, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1734662861627116600 Content-Type: text/plain; charset="utf-8" Since functional tests have character-based console output parsing, there is no need for strange hacks to work around old line-based. Signed-off-by: Nicholas Piggin --- tests/functional/test_ppc64_hv.py | 43 ++++++++++++++----------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/tests/functional/test_ppc64_hv.py b/tests/functional/test_ppc6= 4_hv.py index d97b62e364f..afc8b9a3106 100755 --- a/tests/functional/test_ppc64_hv.py +++ b/tests/functional/test_ppc64_hv.py @@ -12,6 +12,7 @@ from unittest import skipIf, skipUnless from qemu_test import QemuSystemTest, Asset from qemu_test import wait_for_console_pattern, exec_command +from qemu_test import exec_command_and_wait_for_pattern import os import time import subprocess @@ -102,31 +103,28 @@ def do_start_alpine(self): "id=3Ddrive0,read-only=3Dtrue") =20 self.vm.launch() - wait_for_console_pattern(self, 'Welcome to Alpine Linux 3.18') - exec_command(self, 'root') + ps1=3D'localhost:~#' wait_for_console_pattern(self, 'localhost login:') - wait_for_console_pattern(self, 'You may change this message by edi= ting /etc/motd.') + exec_command_and_wait_for_pattern(self, 'root', ps1) # If the time is wrong, SSL certificates can fail. - exec_command(self, 'date -s "' + datetime.utcnow().strftime('%Y-%m= -%d %H:%M:%S' + '"')) - exec_command(self, 'setup-alpine -qe') - wait_for_console_pattern(self, 'Updating repository indexes... don= e.') + exec_command_and_wait_for_pattern(self, 'date -s "' + datetime.utc= now().strftime('%Y-%m-%d %H:%M:%S' + '"'), ps1) + ps1=3D'alpine:~#' + exec_command_and_wait_for_pattern(self, 'setup-alpine -qe', ps1) =20 def do_stop_alpine(self): - exec_command(self, 'poweroff') + exec_command(self, 'echo "TEST ME"') wait_for_console_pattern(self, 'alpine:~#') + exec_command(self, 'poweroff') + wait_for_console_pattern(self, 'reboot: Power down') self.vm.wait() =20 def do_setup_kvm(self): - exec_command(self, 'echo http://dl-cdn.alpinelinux.org/alpine/v3.1= 8/main > /etc/apk/repositories') - wait_for_console_pattern(self, 'alpine:~#') - exec_command(self, 'echo http://dl-cdn.alpinelinux.org/alpine/v3.1= 8/community >> /etc/apk/repositories') - wait_for_console_pattern(self, 'alpine:~#') - exec_command(self, 'apk update') - wait_for_console_pattern(self, 'alpine:~#') - exec_command(self, 'apk add qemu-system-ppc64') - wait_for_console_pattern(self, 'alpine:~#') - exec_command(self, 'modprobe kvm-hv') - wait_for_console_pattern(self, 'alpine:~#') + ps1=3D'alpine:~#' + exec_command_and_wait_for_pattern(self, 'echo http://dl-cdn.alpine= linux.org/alpine/v3.18/main > /etc/apk/repositories', ps1) + exec_command_and_wait_for_pattern(self, 'echo http://dl-cdn.alpine= linux.org/alpine/v3.18/community >> /etc/apk/repositories', ps1) + exec_command_and_wait_for_pattern(self, 'apk update', ps1) + exec_command_and_wait_for_pattern(self, 'apk add qemu-system-ppc64= ', ps1) + exec_command_and_wait_for_pattern(self, 'modprobe kvm-hv', ps1) =20 # This uses the host's block device as the source file for guest block # device for install media. This is a bit hacky but allows reuse of the @@ -145,15 +143,12 @@ def do_test_kvm(self, hpt=3DFalse): '-kernel /media/nvme0n1/boot/vmlinuz-lts ' '-append \'usbcore.nousb ' + append + '\'') # Alpine 3.18 kernel seems to crash in XHCI USB driver. - wait_for_console_pattern(self, 'Welcome to Alpine Linux 3.18') - exec_command(self, 'root') + ps1=3D'localhost:~#' wait_for_console_pattern(self, 'localhost login:') - wait_for_console_pattern(self, 'You may change this message by edi= ting /etc/motd.') - exec_command(self, 'poweroff >& /dev/null') - wait_for_console_pattern(self, 'localhost:~#') + exec_command_and_wait_for_pattern(self, 'root', ps1) + exec_command(self, 'poweroff') wait_for_console_pattern(self, 'reboot: Power down') - time.sleep(1) - exec_command(self, '') + # Now wait for the host's prompt to come back wait_for_console_pattern(self, 'alpine:~#') =20 def test_hv_pseries(self): --=20 2.45.2