From 2d900c3061e1215b85cc41d6e0de8c196c4c85c2 Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Tue, 1 Jul 2025 10:33:54 +0300 Subject: [PATCH] oeqa/runtime: set self.runner and handle None Set default self.runner to None. qemu target sets the runner to qemu. Then handle self.runner None in run_network_serialdebug(). This way ssh runner and failing ping or ssh tests handle the error cases. (From OE-Core rev: 39f72147ef402bea54a66abf984315c1f93aa141) Signed-off-by: Mikko Rapeli Signed-off-by: Richard Purdie --- meta/lib/oeqa/core/target/__init__.py | 1 + meta/lib/oeqa/runtime/case.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/meta/lib/oeqa/core/target/__init__.py b/meta/lib/oeqa/core/target/__init__.py index 1382aa9b52..177f648fe3 100644 --- a/meta/lib/oeqa/core/target/__init__.py +++ b/meta/lib/oeqa/core/target/__init__.py @@ -10,6 +10,7 @@ class OETarget(object): def __init__(self, logger, *args, **kwargs): self.logger = logger + self.runner = None @abstractmethod def start(self): diff --git a/meta/lib/oeqa/runtime/case.py b/meta/lib/oeqa/runtime/case.py index 9515ca2f3d..2a47771a3d 100644 --- a/meta/lib/oeqa/runtime/case.py +++ b/meta/lib/oeqa/runtime/case.py @@ -23,6 +23,8 @@ class OERuntimeTestCase(OETestCase): uninstall_package(self) def run_network_serialdebug(runner): + if not runner: + return status, output = runner.run_serial("ip addr") print("ip addr on target: %s %s" % (output, status)) status, output = runner.run_serial("ping -c 1 %s" % self.target.server_ip)