Skip to contentSkip to conversation

Change the serial runner usage

PATCH Superseded Louis Rannou 2 participants 4 messages Mar 3, 2023 – Mar 31, 2023

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Change the serial runner usage

The actual serial runner has a different usage compare to the ssh runner. The return status is different and failure are not raised as exceptions.

Initially, I wanted to create a new run_serial_socket and modify the old run_serial to use the former. And there was a second patch that changed every call to run_serial to run_serial_socket. But that is not easy as each test can have a different manner to handle the exception.

Therefore, this patch only suggest a new runner and add a comment to deprecate the former runner.

Louis Rannou (1):
oeqa/utils/qemurunner: change the serial runner usage

 meta/lib/oeqa/targetcontrol.py    |  3 ++
 meta/lib/oeqa/utils/qemurunner.py | 57 +++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

base-commit: 76db0baba26a5da5382f7cc44c64eb705e24e638

Signature · 1 line
2.39.2
#1 lore raw

PATCH v2 1/1 oeqa/utils/qemurunner: change the serial runner

[YOCTO #15021]

Create a new runner run_serial_socket which usage matches the traditional ssh runner. Its return status is 0 when the command succeeded or 0 when it failed. If an error is encountered, it raises an Exception.

The previous serial runner is maintained and marked as deprecated.

---
 meta/lib/oeqa/targetcontrol.py    |  3 ++
 meta/lib/oeqa/utils/qemurunner.py | 57 +++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)
meta/lib/oeqa/targetcontrol.py +3 -0
index 1fdff82889..99fbcb5879 100644
@@ -210,6 +210,9 @@ class QemuTarget(BaseTarget):
     def run_serial(self, command, timeout=60):
         return self.runner.run_serial(command, timeout=timeout)
 
+    def run_serial_socket(self, command, timeout=60):
+        return self.runner.run_serial_socket(command, timeout=timeout)
+
 
 class SimpleRemoteTarget(BaseTarget):
 
meta/lib/oeqa/utils/qemurunner.py +57 -0

69 lines not on this page · raw message

Signature · 1 line
2.39.2
#2 lore raw
In reply to Louis Rannou
Quoted 11 lines · Louis Rannou

The actual serial runner has a different usage compare to the ssh runner. The return status is different and failure are not raised as exceptions.

Initially, I wanted to create a new run_serial_socket and modify the old run_serial to use the former. And there was a second patch that changed every call to run_serial to run_serial_socket. But that is not easy as each test can have a different manner to handle the exception.

Therefore, this patch only suggest a new runner and add a comment to deprecate the former runner.

Quoted 6 lines

Louis Rannou (1):
oeqa/utils/qemurunner: change the serial runner usage

 meta/lib/oeqa/targetcontrol.py    |  3 ++
 meta/lib/oeqa/utils/qemurunner.py | 57 +++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

Sorry about the late reply to this. I think the idea of the new runner is great and we should improve and clean this up.

As the patch stands, it creates a largely duplicate function with no users. Experience shows this tends to bitrot quickly.

For that reason I'm reluctant to take just this change without converting at least some of the existing users to use the new API.

Ideally we'd convert everything but at the very least the new function should be usable by a decent chunk of the existing code, even if we have to adjust it to make that work.

Cheers,

Richard

#3 lore raw
Quoted 25 lines · Richard Purdie
Quoted 11 lines · Louis Rannou

The actual serial runner has a different usage compare to the ssh runner. The return status is different and failure are not raised as exceptions.

Initially, I wanted to create a new run_serial_socket and modify the old run_serial to use the former. And there was a second patch that changed every call to run_serial to run_serial_socket. But that is not easy as each test can have a different manner to handle the exception.

Therefore, this patch only suggest a new runner and add a comment to deprecate the former runner.

Quoted 6 lines

Louis Rannou (1):
oeqa/utils/qemurunner: change the serial runner usage

  meta/lib/oeqa/targetcontrol.py    |  3 ++
  meta/lib/oeqa/utils/qemurunner.py | 57 +++++++++++++++++++++++++++++++
  2 files changed, 60 insertions(+)

Sorry about the late reply to this. I think the idea of the new runner is great and we should improve and clean this up.

As the patch stands, it creates a largely duplicate function with no users. Experience shows this tends to bitrot quickly.

Quoted 6 lines

For that reason I'm reluctant to take just this change without converting at least some of the existing users to use the new API.

Ideally we'd convert everything but at the very least the new function should be usable by a decent chunk of the existing code, even if we have to adjust it to make that work.

Hello,
You're right. I'll send a v3 changing some tests using that serial runner.

Thanks,
Louis