Skip to content
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

avocado/utils/ssh.py: add timeout functionality #5775

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

clebergnu
Copy link
Contributor

This uses the remote side "timeout" command to implement a timeout for the actual command the user intends to run. The arguments given are the simplest possible to be made compatible with "timeout" implementations such as the ones given by busybox.

While it's not possible to have a functional test at this point (because the test would need a second and properly configured machine), the example API script should serve as a proof that this implementation behaves correctly:

$ python3 examples/apis/utils/ssh_timeout.py
10.571667929994874
1.4050129299866967


This is a follow up to #5654

@mr-avocado
Copy link

mr-avocado bot commented Oct 5, 2023

Dear contributor,
Avocado is currently under sprint #103, which is due to release an LTS (Long Term Stability) release.
Please avoid merging changes that do not fall into these categories:

  • Bug fixes
  • Usability Improvements
  • Documentation updates

As for the Avocado utility modules (“avocado.utils”) it is OK to introduce new functionality,
but changes to the existing APIs (including interface and behavior) should be avoided.
These kind of changes should wait until sprint #104.

This uses the remote side "timeout" command to implement a timeout for
the actual command the user intends to run.  The arguments given are
the simplest possible to be made compatible with "timeout"
implementations such as the ones given by busybox.

While it's not possible to have a functional test at this
point (because the test would need a second and properly configured
machine), the example API script should serve as a proof that this
implementation behaves correctly:

  $ python3 examples/apis/utils/ssh_timeout.py
  10.571667929994874
  1.4050129299866967

Signed-off-by: zuohanxu <[email protected]>
Signed-off-by: Cleber Rosa <[email protected]>
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@richtja richtja merged commit e26c382 into avocado-framework:master Oct 9, 2023
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants