diff mbox series

[meta-zephyr] zephyrtargetcontrol: fix unexpected ignore_ssh_fails

Message ID 20261028021722.326062-1-chee.yang.lee@intel.com
State New
Headers show
Series [meta-zephyr] zephyrtargetcontrol: fix unexpected ignore_ssh_fails | expand

Commit Message

Lee, Chee Yang Oct. 28, 2026, 2:17 a.m. UTC
From: Lee Chee Yang <chee.yang.lee@intel.com>

fix unexpected keyword argument for QemuTargetZephyr

File: '/data/blacksail/openembedded-core/meta/lib/oeqa/utils/postactions.py', lineno: 88, function: run_coredumpctl_info
     0084:    # message ID for coredumps, so it shows all of the coredumps that are in the
     0085:    # journal.
     0086:    output_file = d.expand("${localstatedir}/log/coredumps.txt")
     0087:    cmd = f"coredumpctl info MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1 | tee {output_file}"
 *** 0088:    tc.target.run(cmd, ignore_ssh_fails=True)
     0089:
     0090:
     0091:##################################################################
     0092:# General post actions runner
Exception: TypeError: OETarget.run() got an unexpected keyword argument 'ignore_ssh_fails'

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
---
 .../lib/oeqa/controllers/zephyrtargetcontrol.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-zephyr-core/lib/oeqa/controllers/zephyrtargetcontrol.py b/meta-zephyr-core/lib/oeqa/controllers/zephyrtargetcontrol.py
index e9bc6bb..a557a5c 100644
--- a/meta-zephyr-core/lib/oeqa/controllers/zephyrtargetcontrol.py
+++ b/meta-zephyr-core/lib/oeqa/controllers/zephyrtargetcontrol.py
@@ -15,7 +15,8 @@  class QemuTargetZephyr(OETarget):
             machine='', rootfs='', tmpdir ='',dir_image ='',display=None,
             kernel='',boottime=60,bootlog='',kvm=False,slirp=False,
             dump_dir='',serial_ports=0,ovmf=None,tmpfsdir='' ,target_modules_path='',powercontrol_cmd='',powercontrol_extra_args='',
-            serialcontrol_cmd=None,serialcontrol_extra_args='',testimage_dump_target='',testimage_dump_monitor='',native_sysroot=None):
+            serialcontrol_cmd=None,serialcontrol_extra_args='',testimage_dump_target='',testimage_dump_monitor='',native_sysroot=None,
+            ignore_ssh_fails=True):
 
         timeout =  300
         user = 'root'
@@ -60,3 +61,17 @@  class QemuTargetZephyr(OETarget):
 
     def serial_readline(self):
         return self.runner.serial_readline()
+
+    def run(self, cmd, timeout=None, ignore_status=True, raw=False, ignore_ssh_fails=False):
+        """
+        QemuTargetZephyr has no SSH (or other remote shell) support, only
+        a serial console. Treat every call as an SSH failure (status 255),
+        matching OESSHTarget's convention, so that callers written for
+        SSH-capable targets (e.g. testimage's post-failure actions) degrade
+        gracefully instead of raising a TypeError.
+        """
+        status, output = 255, "QemuTargetZephyr has no SSH support; only serial console access is available"
+        if not ignore_ssh_fails:
+            raise AssertionError(output)
+        return (status, output)
+