public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v2 03/11] CI: Fix errors reporting during startvm
Date: Mon, 29 Jun 2026 12:46:16 +0300	[thread overview]
Message-ID: <20260629094624.855927-4-amikan@ilbers.de> (raw)
In-Reply-To: <20260629094624.855927-1-amikan@ilbers.de>

Test case failure should be triggered by self.fail() API.
It helps to prepare much more correct log output.
So rebuild error handling of startvm related functions.

This also fixes KFAIL coverage for startvm test cases.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 testsuite/cibuilder.py | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index f9cca0c7..fca2f2ed 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -602,7 +602,7 @@ class CIBuilder(Test):
             stderr=subprocess.PIPE,
             universal_newlines=True,
         )
-        self.log.info("Started VM with pid %s" % (p1.pid))
+        self.log.info("Starting VM with pid %s" % (p1.pid))
 
         return p1, cmdline, boot_log, need_sb_cleanup
 
@@ -634,8 +634,10 @@ class CIBuilder(Test):
             if p1.poll() is not None:
                 break
 
-        self.log.error("Didn't get login prompt")
-        return 1
+        rc = 1
+        if time.time() > timeout:
+            rc = 2
+        return rc
 
     def vm_parse_output(self, boot_log, multiconfig, skip_modulecheck):
         # the printk of recipes-kernel/example-module
@@ -665,13 +667,10 @@ class CIBuilder(Test):
                 if module_output in data or skip_modulecheck:
                     if resize_output and resize_output not in data:
                         rc = 1
-                        self.log.error("No resize output while expected")
                 else:
                     rc = 2
-                    self.log.error("No example module output while expected")
                 if ordering_cycle in data:
                     rc = 3
-                    self.log.error("Systemd services ordering cycle detected")
         return rc
 
     def vm_dump_dict(self, vm):
@@ -680,16 +679,19 @@ class CIBuilder(Test):
         f.close()
 
     def vm_turn_off(self, vm):
-        pid = self.vm_dict[vm][0]
-        os.kill(pid, signal.SIGKILL)
+        try:
+            pid = self.vm_dict[vm][0]
+            os.kill(pid, signal.SIGKILL)
 
-        if self.vm_dict[vm][3]:
-            start_vm.sb_cleanup()
+            if self.vm_dict[vm][3]:
+                start_vm.sb_cleanup()
 
-        del self.vm_dict[vm]
-        self.vm_dump_dict(vm)
+            del self.vm_dict[vm]
+            self.vm_dump_dict(vm)
 
-        self.log.info("Stopped VM with pid %s" % (pid))
+            self.log.info("Stopped VM with pid %s" % (pid))
+        except ProcessLookupError:
+            self.log.error("Can't stop VM %s" % vm)
 
     def vm_start(
         self,
@@ -758,7 +760,10 @@ class CIBuilder(Test):
             rc = self.vm_wait_boot(p1, timeout)
             if rc != 0:
                 self.vm_turn_off(vm)
-                self.fail("Failed to boot qemu machine")
+                if rc == 2:
+                    self.fail("Didn't get login prompt")
+                else:
+                    self.fail("Failed to boot qemu machine")
 
         if cmd is not None or script is not None:
             self.ssh_user = 'ci'
@@ -794,7 +799,12 @@ class CIBuilder(Test):
             if rc != 0:
                 if not keep:
                     self.vm_turn_off(vm)
-                self.fail("Failed to parse output")
+                if rc == 1:
+                    self.fail("No resize output while expected")
+                elif rc == 2:
+                    self.fail("No example module output while expected")
+                else:
+                    self.fail("Failed to parse output")
 
         if not keep:
             self.vm_turn_off(vm)
-- 
2.34.1

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260629094624.855927-4-amikan%40ilbers.de.

  parent reply	other threads:[~2026-06-29  9:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  9:46 [PATCH v2 00/11] Add new targets and required fixes Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 01/11] grub: Remove obsolete efi_uga module for new distros Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 02/11] CI: Freeze setuptools package version for avocado compatibility Anton Mikanovich
2026-06-29  9:46 ` Anton Mikanovich [this message]
2026-06-29  9:46 ` [PATCH v2 04/11] meta: Add base distro overrides Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 05/11] linux-kernel: Reverse linux-libc-dev package arch selection logic Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 06/11] trixie: Split missing drivers hook recipes Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 07/11] CI: Move trixie targets to generic test cases Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 08/11] CI: Run startvm for all qemu targets Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 09/11] meta: Add Ubuntu 26.04 (Resolute Raccoon) support Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 10/11] testsuite: Cover Debian Trixie RISCV64 QEMU target with CI Anton Mikanovich
2026-06-29  9:46 ` [PATCH v2 11/11] testsuite: Cover Debian Forky " Anton Mikanovich

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=20260629094624.855927-4-amikan@ilbers.de \
    --to=amikan@ilbers.de \
    --cc=isar-users@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox