-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyterm: add native support #20172
pyterm: add native support #20172
Conversation
f9c46db
to
801f944
Compare
Setting the |
There is an issue with riotctrl. I assume it is because the native process now becomes a child process of pyterm when called via |
IIRC that is only for hardware based tests, all |
d95fcdf
to
13e5387
Compare
Okay to squash and remove the WIP label? |
Yepp, Murdock will take a while anyways, but |
I realized that this change breaks when passing arguments to native (like when using |
Mh... maybe, instead of passing parameter by parameter just have a “native parameters” parameter, to which you pass all parameters required for native. This way you can keep the old |
Of course that makes |
Well, |
102ac75
to
f2fc233
Compare
f2fc233
to
dd18461
Compare
Anything left to be addressed? |
What about #20172 (comment) and #20172 (comment)? |
Seemed to be unnecessary and would probably complicate the configuration. |
Mh, but the comment says why socat was used: To not have extra characters in the stream. I can imagine that the tests depend on that. If you insist on |
Just for that I set |
I'm under the impression that this comment is obsolete.
But as far as I understand the tests are executed using the The tests run successful on my PC and in the CI. From the test code I also see no reason why the tests should fail with pyterm. |
Since Murdock does not seem to have a problem with that either, I am fine with that explanation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soft ACK from my side. @benpicco, since this touches also ZEP dispatch, can you please have another look too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes native
so much nicer 😃
I also don't see how the tests would depend on pyterm
- they use their own python based testing harness (e.g. RIOTCtrl).
examples/gnrc_border_router
on native
also still works as expected.
Uh looks like |
Turns out I was wrong - or rather they depend on the absence of Now for some reason CI did not catch this, but an unrelated PR manages to shake them out. |
arg this also broke |
Contribution description
I always found it annoying that native is lacking the convenience features of
pyterm
(e.g., history, concatenating of commands, logging etc). Of course, one could pipe stdin/stdout into something like socat and use pyterm's feature to connect to a TCP server (e.g.,socat EXEC:${NATIVEBIN},end-close,stderr,pty TCP-LISTEN:4711,reuseaddr,fork & pyterm -ts 4711
) but that's somewhat tedious and not well-aligned with the typical usage.Hence, this PR will modify the
term
make target for native so that pyterm is called instead of calling the native binary directly. In turn, pyterm now has a new option which will spawn RIOT native processes as a subprocess (i.e., child process) and communicate to it via pipes.Testing procedure
Call
BOARD=native make term
for arbitrary RIOT applications.Caution: this is not well tested so far - expect the unexpected.