-
Notifications
You must be signed in to change notification settings - Fork 204
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
Expand the serial terminal console documentation #1586
Conversation
fyi @pevik @asmorodskyi |
LGTM. Thanks Richie to extend docs! |
docs/WritingTests.asciidoc
Outdated
instead of being interpreted by a terminal emulator which then renders the | ||
text. | ||
|
||
However the advantages of using the serial terminal usually outweigh the |
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.
Very discussable statement , would better remove it. It's up to openQA consumer to decide which way is better
docs/WritingTests.asciidoc
Outdated
|
||
[source,perl] | ||
-------------------------------------------------------------------------------- | ||
if (select_virtio_console()) { |
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.
it's a big question for me to document function which is in testing repository . From openQA perspective os-autoinst-distri-opensuse it is just another testing repository. How guys from Fedora would follow this ?
I am agree that select_virtio_console is needed function but to insert it to documentation need to move to os-autoinst
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.
Or at least you need to point where this function is declared and explain that it's only related to os-autoinst-distri-opensuse
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.
I prefer the latter because most distributions should have something similar and it is nice to have complete documentation in one place.
docs/WritingTests.asciidoc
Outdated
|
||
1) Wait for the terminal prompt to appear. | ||
2) Send your command | ||
3) Wait for your command text to be echoed by the shell (inf applicable) |
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.
typo 'inf'
docs/WritingTests.asciidoc
Outdated
|
||
if (is_serial_terminal) { | ||
script_run($klog_stamp); | ||
wait_serial(serial_term_prompt(), undef, 0, no_regex => 1); |
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.
can you elaborate more about serial_term_prompt() ?
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.
actually it make sense to explain other parameters in wait_serial and why you using them. It will give some insights about how serial terminal actually working
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.
but maybe I am asking too much for single PR ... feel free to ignore this one
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.
Agree :-). I mean it's great to have comments but on the other hand perfect is the enemy of good :-).
Thank you both for your care.
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.
I think it is perfectly valid criticism :-)
docs/WritingTests.asciidoc
Outdated
|
||
Then the test script enters our command with +type_string+ and waits for the | ||
command's text to be echoed back by the shell. Shell's usually echo the | ||
characters sent to them so that the user can see what they have typed. However |
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.
and when it is not the case and why ?
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 one is just like ongoing question not directly related to PR :)
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.
Ok, well I have explained a bit more anyway in the docs, but a full explanation would not be relevant because it is only likely to be turned off deliberately to simplify processing SUT output which I don't think is a good idea.
Another situation where it might be turned off is if your local terminal emulator displays your keypresses. In which case the remote TTY/PTY does not need to. Another is if you are using a very stupid terminal on an embedded device which does not echo the characters. Also if you are using a very slow serial connection, the echo might interfere with the characters you are trying to send, so it is best to turn it off. None of this is very likely when you are using a Linux capable device, but I think it is helpful knowledge for understanding how terminals work.
docs/WritingTests.asciidoc
Outdated
+script_run+. | ||
|
||
We choose to wait for the prompt just before sending a command, rather than | ||
after it, so that step 5 can be deferred to a later time. In theory this |
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.
you not provide numbering so it is hard to figure out what is step 5
978be65
to
7fffeec
Compare
7fffeec
to
2c98c7e
Compare
docs/WritingTests.asciidoc
Outdated
my $cmd_text = qq($test->{command}; echo "$fin_msg\$?"); | ||
my $klog_stamp = "echo 'OpenQA::run_ltp.pm: Starting $test->{name}' > /dev/$serialdev"; | ||
|
||
# More variables and other shit |
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.
could you please use more polite word here :)
LGTM . Well done @richiejp ! |
2c98c7e
to
205956a
Compare
Codecov Report
@@ Coverage Diff @@
## master #1586 +/- ##
=========================================
- Coverage 82.59% 58% -24.6%
=========================================
Files 121 106 -15
Lines 9037 8255 -782
=========================================
- Hits 7464 4788 -2676
- Misses 1573 3467 +1894
Continue to review full report at Codecov.
|
Thanks for review @asmorodskyi and @pevik |
I feel weird to critique a native speaker but shouldn't the commit/PR say "extend" rather than "expand"? |
"extend" is a synonym for "expand" in ordinary English (i.e. non-technical language). "elaborate" is probably more correct than both of them. However I'm not a grammar expert. |
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.
Thanks for the documentation!
usually output to. | ||
|
||
When switching to a virtio based serial terminal, +wait_serial+ will then read | ||
from the virtio serial port instead. However the emulated serial port still |
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.
As spoken. Perhaps you can find better names to identify each port. ;)
|
||
# More variables and other stuff | ||
|
||
if (is_serial_terminal) { |
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.
Here a reminder about our conversation about the differences between how a session is initiated using virtio and using VNC not. (if I understood well)
wait_serial($cmd_text, undef, 0, no_regex => 1); #Step 3 | ||
type_string("\n"); #Step 4 | ||
} else { | ||
# The slow path |
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.
Reminder to improve this block so it is easier to understand what is meant by slow path. Like your suggestion about putting the "slow commands".
I'll merge this as first round - improvements can go into a second |
https://progress.opensuse.org/issues/31777