action #89011
closed[security][backlog] "script_run_interactive" didn't work fine if selecting serial terminal
100%
Description
If I use root console, I can pass the tests without any issue, however if I use serial terminal, I hit some issue with "script_run_interactive"
*# dsidm localhost user create --uid wilber --cn wilber --displayName 'Domain User' --uidNumber 1003 --gidNumber 1003 --homeDirectory /home/wilber; echo rw7ER-$?-
Successfully created wilber
rw7ER-0-
# (script -qe -a /dev/null -c '
> dsidm localhost account reset_password uid=wilber,ou=people,dc=example,dc=com
> '; echo EOS~~~$?) |& tee /dev/ttyS0
Enter new password for uid=wilber,ou=people,dc=example,dc=com : (hang here)
*
Observation¶
openQA test in scenario sle-15-SP3-Online-x86_64-security_389ds_server@64bit fails in
tls_389ds_server
Test suite description¶
The base test suite is used for job templates defined in YAML documents. It has no settings of its own.
Reproducible¶
Fails since (at least) Build 150.1
Expected result¶
Last good: 150.1 (or more recent)
Further details¶
Always latest result in this scenario: latest
Updated by okurz almost 4 years ago
- Project changed from openQA Project (public) to openQA Tests (public)
- Category set to Bugs in existing tests
The method is part of os-autoinst-distri-opensuse, not part of os-autoinst so you can take a look into the method definition within the "lib/" folder of the test distribution. I don't have experience with the method myself and I doubt anyone from SUSE QE Tools has experience
Updated by rfan1 almost 4 years ago
okurz wrote:
The method is part of os-autoinst-distri-opensuse, not part of os-autoinst so you can take a look into the method definition within the "lib/" folder of the test distribution. I don't have experience with the method myself and I doubt anyone from SUSE QE Tools has experience
Thanks Oliver!
Updated by Xiaojing_liu almost 4 years ago
Did some tests with @rfan1. Here are the results:
when
$self->select_serial_terminal
, the output will include command line, such asrw7ER-0- # (script -qe -a /dev/null -c ' > dsidm localhost account reset_password uid=wilber,ou=people,dc=example,dc=com > '; echo EOS~~~$?) |& tee /dev/ttyS0 Enter new password for uid=wilber,ou=people,dc=example,dc=com :
Then
script_run_interactive
die because the output matchesEOS~~~
.
See: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/utils.pm#L1612in the second step, the output does not match the regex because the regex we used is an array. Here is an example:
Output isYES \n Enter passphrase for /root/testfile:
,
And regex is["Are you sure.*", "Enter passphrase.*", "Verify passphrase.*", qr/EOS~~~(\d+)/ ]
In the serial terminal, we put the items in the array together and make a regex. See: https://github.com/os-autoinst/os-autoinst/blob/master/consoles/serial_screen.pm#L140
In the root console, there is no problem. Because we do the match one by one (in a for loop)
If the check should return success when the output matches any one item in an array, we need to modify the code in os-autoinst.We should use
EOS~~~(\d+)
to check if the command is done. Because the output will be cut according to the regex. If we useEOS~~~
, the result of$?
will be lost.
see: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/utils.pm#L1605
Updated by tjyrinki_suse almost 4 years ago
- Subject changed from "script_run_interactive" didn't work fine if selecting serial terminal to [security] "script_run_interactive" didn't work fine if selecting serial terminal
- Start date deleted (
2021-02-23)
Updated by rfan1 over 3 years ago
- Category changed from Bugs in existing tests to Enhancement to existing tests
- Status changed from New to Workable
- Priority changed from Normal to Low
- Estimated time set to 60.00 h
Updated by llzhao over 2 years ago
- Subject changed from [security] "script_run_interactive" didn't work fine if selecting serial terminal to [security][backlog] "script_run_interactive" didn't work fine if selecting serial terminal
Updated by rfan1 over 2 years ago
- Status changed from Workable to Rejected
- % Done changed from 0 to 100
Close this ticket due to test case can passed in vnc/ssh console