Project

General

Profile

action #89011

[security][backlog] "script_run_interactive" didn't work fine if selecting serial terminal

Added by rfan1 over 1 year ago. Updated about 1 month ago.

Status:
Rejected
Priority:
Low
Assignee:
Category:
Enhancement to existing tests
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
60.00 h
Difficulty:

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

History

#1 Updated by okurz over 1 year ago

  • Project changed from openQA Project to openQA Tests
  • 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

#2 Updated by rfan1 over 1 year 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!

#3 Updated by cdywan over 1 year ago

  • Description updated (diff)

#4 Updated by Xiaojing_liu over 1 year ago

Did some tests with @rfan1. Here are the results:

  1. when $self->select_serial_terminal, the output will include command line, such as

    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 :
    

    Then script_run_interactive die because the output matches EOS~~~.
    See: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/utils.pm#L1612

  2. in the second step, the output does not match the regex because the regex we used is an array. Here is an example:
    Output is YES \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.

  3. We should use EOS~~~(\d+) to check if the command is done. Because the output will be cut according to the regex. If we use EOS~~~, the result of $? will be lost.
    see: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/utils.pm#L1605

#5 Updated by tjyrinki_suse over 1 year 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)

#6 Updated by llzhao over 1 year ago

  • Assignee set to rfan1

#7 Updated by rfan1 over 1 year 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

#8 Updated by llzhao 3 months 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

#9 Updated by rfan1 about 1 month 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

Also available in: Atom PDF