Bug 15021 - inconsistent usage of qemu.run and qemu.run_serial
Summary: inconsistent usage of qemu.run and qemu.run_serial
Status: IN PROGRESS REVIEW
Alias: None
Product: Test Plans/Suite
Classification: QA/Testing
Component: test-plans/suite (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 6.2
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2023-01-27 15:18 UTC by Louis Rannou
Modified: 2026-08-20 15:09 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Rannou 2023-01-27 15:18:00 UTC
qemu.run_serial returns 1 on success and 0 on failure while the ssh qemu.run command returns 0 and -N on failure

In tests, both are used the same way:
status, output = qemu.run(cmd)
status, output = qemu.run_serial(cmd) 

This is confusing, maybe both functions should have a similar return.

For information, the ssh runner uses the python module subprocess https://docs.python.org/3/library/subprocess.html

run_serial should be changed to match the subprocess usage:
- return 0 in case of success
- return N in case of failure
- add an option check. if true raise an error

Note that the ssh command allow much more setting (stdin, stderr, stdout...)
Comment 1 Randy MacLeod 2023-02-02 15:35:57 UTC
Louis can you send a patch?
Comment 2 Louis Rannou 2023-02-03 11:57:03 UTC
It is possible for me to work on the subject. Perhaps I was waiting from an external point of view.

Changing the behaviour of the method run_serial and will break actual usages.

Then, should we create a distinct method (serial_run for example) and deprecate this one ? Or should we change run_serial and patch its usage in oe-core ?
Comment 3 Randy MacLeod 2023-02-09 22:19:50 UTC
Louis, 
The best approach is to make a change and send the patch to the email list for review or if you really want feedback on the approach, just send an email describing the problem, pointing to this bug and suggest the approach you plan to take. 
Thanks,
../Randy
Comment 4 Randy MacLeod 2023-04-21 18:45:44 UTC
Moved en masse from 4.2 to 4.3 by Randy.
Comment 6 Randy MacLeod 2024-01-18 16:17:28 UTC
There is a patch but it needs some additional work.
Louis if you can continue, please assign this bug to back to yourself. 
Thanks.
Comment 7 Randy MacLeod 2024-04-25 01:13:52 UTC
Bulk move of 5.0 medium importance issues to 5.99.
Move to 5.1 if you want to actively work on an issue.
Comment 8 Randy MacLeod 2024-04-25 01:23:13 UTC
Move to 5.99 since no one is actively working on this issue.
Move to 5.x if you start on a task, please.