From: Aniket Sahu <asahu1x@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, peterx@redhat.com, farosas@suse.de,
npiggin@gmail.com, adityag@linux.ibm.com, milesg@linux.ibm.com,
harshpb@linux.ibm.com, rathc@linux.ibm.com,
anushree.mathur@linux.ibm.com, misanjum@linux.ibm.com,
gautam@linux.ibm.com, thuth@redhat.com, amachhiw@linux.ibm.com,
asahu1x@linux.ibm.com
Subject: [PATCH 3/5] tests/functional/ppc64: add kernel params and early panic detection
Date: Fri, 20 Nov 2026 15:28:56 +0530 [thread overview]
Message-ID: <20261120095854.35941-10-asahu1x@linux.ibm.com> (raw)
In-Reply-To: <20261120095854.35941-7-asahu1x@linux.ibm.com>
Add kernel command line parameters and improve error handling:
- Pass "console=hvc0 usbcore.nousb" on the L1 kernel command line
- Add early panic detection in do_test_kvm() with failure_message
- Retry apk update up to 5 times with 10 second delays
- Add debug logging at key steps (VM launch, login, apk update)
This allows the test to fail early if L2 panics instead of waiting
for the login prompt until timeout, and makes the Alpine setup more
robust against transient network issues.
Signed-off-by: Aniket Sahu <asahu1x@linux.ibm.com>
---
tests/functional/ppc64/test_hv.py | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/tests/functional/ppc64/test_hv.py b/tests/functional/ppc64/test_hv.py
index d977038271..d983e5229c 100755
--- a/tests/functional/ppc64/test_hv.py
+++ b/tests/functional/ppc64/test_hv.py
@@ -63,16 +63,20 @@ def setUp(self):
self.initramfs = self.extract_from_iso(self.iso_path, '/boot/initramfs-lts')
def do_start_alpine(self):
+ self.log.debug("do_start_alpine: launching L1 VM")
self.vm.set_console()
- self.vm.add_args("-kernel", self.vmlinuz)
- self.vm.add_args("-initrd", self.initramfs)
- self.vm.add_args("-smp", "4", "-m", "2g")
- self.vm.add_args("-drive", f"file={self.iso_path},format=raw,if=none,"
- "id=drive0,read-only=true")
-
+ self.vm.add_args(
+ "-kernel", self.vmlinuz,
+ "-initrd", self.initramfs,
+ "-smp", "4", "-m", "2g",
+ "-drive", f"file={self.iso_path},format=raw,if=none,id=drive0,read-only=true",
+ "-append", "console=hvc0 usbcore.nousb",
+ )
self.vm.launch()
+ self.log.debug("do_start_alpine: VM launched, waiting for login prompt")
ps1='localhost:~#'
wait_for_console_pattern(self, 'localhost login:')
+ self.log.debug("do_start_alpine: got login prompt, logging in as root")
exec_command_and_wait_for_pattern(self, 'root', ps1)
self.log.debug("do_start_alpine: logged in, setting system clock")
# If the time is wrong, SSL certificates can fail.
@@ -80,8 +84,11 @@ def do_start_alpine(self):
exec_command_and_wait_for_pattern(self, cmd, ps1)
ps1='alpine:~#'
exec_command_and_wait_for_pattern(self, 'setup-alpine -qe', ps1)
- exec_command_and_wait_for_pattern(self, 'setup-apkrepos -c1', ps1)
- exec_command_and_wait_for_pattern(self, 'apk update', ps1)
+ exec_command_and_wait_for_pattern(
+ self,
+ 'for i in 1 2 3 4 5; do apk update && break; sleep 10; done',
+ ps1)
+ self.log.debug("do_start_alpine: apk update complete, Alpine L1 is ready")
# Could upgrade here but it usually should not be necessary
# exec_command_and_wait_for_pattern(self, 'apk upgrade --available', ps1)
@@ -114,9 +121,12 @@ def do_test_kvm(self, hpt=False):
'-kernel /media/nvme0n1/boot/vmlinuz-lts '
'-append \'usbcore.nousb ' + append + '\'')
# Alpine 3.21 kernel seems to crash in XHCI USB driver.
- ps1='localhost:~#'
- wait_for_console_pattern(self, 'localhost login:')
+ ps1 = 'localhost:~#'
+ wait_for_console_pattern(self, 'localhost login:',
+ failure_message=self.panic_message)
+ self.log.debug("do_test_kvm: L2 login prompt seen, logging in")
exec_command_and_wait_for_pattern(self, 'root', ps1)
+ self.log.debug("do_test_kvm: logged into L2, issuing poweroff")
exec_command(self, 'poweroff')
wait_for_console_pattern(self, 'reboot: Power down')
# Now wait for the host's prompt to come back
--
2.52.0
next prev parent reply other threads:[~2026-11-20 10:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 9:58 [PATCH 0/5] tests/functional/ppc64: Fixes and improvements for hypervisor tests Aniket Sahu
2026-11-20 9:58 ` [PATCH 1/5] tests/functional/ppc64: replace deprecated datetime.utcnow() Aniket Sahu
2026-11-20 9:58 ` [PATCH 2/5] tests/functional/ppc64: pin machine types for hypervisor tests Aniket Sahu
2026-11-20 10:06 ` Daniel P. Berrangé
2026-11-20 10:29 ` Aniket Sahu
2026-11-20 9:58 ` Aniket Sahu [this message]
2026-11-20 9:58 ` [PATCH 4/5] tests/functional/ppc64: dynamically resolve NVMe device path Aniket Sahu
2026-11-20 9:58 ` [PATCH 5/5] tests/functional/ppc64: increase timeout for hypervisor tests Aniket Sahu
2026-11-20 16:06 ` [PATCH 0/5] tests/functional/ppc64: Fixes and improvements " Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120095854.35941-10-asahu1x@linux.ibm.com \
--to=asahu1x@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=amachhiw@linux.ibm.com \
--cc=anushree.mathur@linux.ibm.com \
--cc=farosas@suse.de \
--cc=gautam@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=milesg@linux.ibm.com \
--cc=misanjum@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rathc@linux.ibm.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.