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

script_run: base serial buffer size on command length #2429

Merged
merged 1 commit into from Jan 13, 2024

Conversation

AdamWill
Copy link
Contributor

@AdamWill AdamWill commented Jan 9, 2024

If you use script_run at a serial console to run a command more than 4096 characters long, the wait_serial that waits until the whole command has made it across the serial connection will fail, because it uses the default buffer size (4096), so it will never see the full command. This means there'll be a 90 second timeout before the command is actually run, and a red frame in the results.

This solves the problem by always sizing the buffer to the length of the command, plus 128 extra bytes (for the marker string, and some more for safety).

Issue: https://progress.opensuse.org/issues/153304

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0a4fcbf) 95.12% compared to head (2542836) 95.19%.
Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2429      +/-   ##
==========================================
+ Coverage   95.12%   95.19%   +0.07%     
==========================================
  Files         155      156       +1     
  Lines       15474    15701     +227     
==========================================
+ Hits        14719    14946     +227     
  Misses        755      755              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

distribution.pm Outdated Show resolved Hide resolved
okurz added a commit to okurz/os-autoinst that referenced this pull request Jan 11, 2024
@AdamWill
Copy link
Contributor Author

I don't think the failures have anything to do with the PR (okurz's other PR is failing on the same things).

If you use script_run at a serial console to run a command more
than 4096 characters long, the wait_serial that waits until the
whole command has made it across the serial connection will
fail, because it uses the default buffer size (4096), so it
will never see the full command. This means there'll be a 90
second timeout before the command is actually run, and a red
frame in the results.

This solves the problem by always sizing the buffer to the length
of the command, plus 128 extra bytes (for the marker string, and
some more for safety).

Issue: https://progress.opensuse.org/issues/153304

Signed-off-by: Adam Williamson <awilliam@redhat.com>
@AdamWill AdamWill changed the title script_run: use bigger buffer for very long serial commands script_run: base serial buffer size on command length Jan 11, 2024
okurz added a commit to okurz/os-autoinst that referenced this pull request Jan 12, 2024
@okurz
Copy link
Member

okurz commented Jan 12, 2024

I don't think the failures have anything to do with the PR (okurz's other PR is failing on the same things).

Yes, sorry about that. @b10n1k was experimenting with more CI checks. I have reverted the according commits for now and will rebase here

@Mergifyio rebase

@okurz okurz merged commit b65c28f into os-autoinst:master Jan 13, 2024
22 of 24 checks passed
okurz added a commit to okurz/os-autoinst that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants