Project

General

Profile

Actions

action #122935

closed

openqa: fix virtio console for user (user-virtio-terminal)

Added by pvorel over 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Enhancement to existing tests
Target version:
QE Kernel - QE Kernel Done
Start date:
2023-01-10
Due date:
% Done:

0%

Estimated time:
Difficulty:
medium

Description

virtio console for user (user-virtio-terminal) was added in https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/14967 (#88193) and then used in various HPC tests: https://openqa.suse.de/tests/10220175 (sle-15-SP5-Online-x86_64-Build64.1-hpc_BETA_mpich_mpi_supportserver@64bit).

But it lack some functionality, thus workarounds needs to be used:

  • user cannot switch from root-virtio-terminal (select_serial_terminal() which calls select_console('root-virtio-terminal')) to user-virtio-terminal (select_user_serial_terminal() which calls select_serial_terminal(0) which calls select_console('user-virtio-terminal')). Workaround: kill sshd from 'root-console':
    type_string('pkill -u root');                                       
    select_serial_terminal(0); 

Used on various places:

Issue long time ago reported reported by Jozef Pupava.

    # We need to change the 'serial_term_prompt' value for 'wait_serial'
    my $serial_term_prompt = "$sapadmin> ";
    enter_cmd(qq/PS1="$serial_term_prompt"/);
    wait_serial(qr/PS1="$serial_term_prompt"/) if testapi::is_serial_terminal;
    $testapi::distri->{serial_term_prompt} = "$serial_term_prompt";

https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/9f84f058d22425bae123734c06a28fa988d5ba06/lib/sles4sap.pm#L238-L239

    # Reset 'serial_term_prompt' value for 'wait_serial'
    $testapi::distri->{serial_term_prompt} = '# ';
  • output log for extra root console (activated by VIRTIO_CONSOLE_NUM=2) saved output in "Logs & Assets" to virtio_console1.log. It was renamed to serial_terminal_user.txt (unify with serial_terminal.txt), also any *.log file which is saved will be renamed to *.txt

CODE

I prepared PR in all 3 git repositories:

Although I prepared code for live console also show the output of virtio_console_user.log, it does not work.

Testing

What needs special attention:

which run also on o3: https://openqa.opensuse.org/tests/3029126 https://openqa.opensuse.org/tests/3029329

  • mru-install-minimal-with-addons
    reason: system_prepare.pm uses prepare_serial_console(), which adds one serial console for user-virtio-terminal (this should work quite well), this also check installer

  • Sanity check for any LTP test (uses serial terminal)

  • Tested on image created by mru-install-minimal-with-addons with virtio tests:
    TEST=virtio VIRTIO_CONSOLE=1 VIRTIO_CONSOLE_TEST=1 INSTALL_LTP= LTP_COMMAND_FILE= YAML_SCHEDULE= LTP_EXTRA_CONF_FLAGS= INCIDENT_ID= INCIDENT_REPO= PUBLISH_HDD_1= PUBLISH_PFLASH_VARS=
    http://quasar.suse.cz/tests/1742#downloads

  • The same problem might be for svirt, which is used for root-serial-ssh and user-serial-ssh (on both: s390x zkvm == qemu, which is on osd) and s390x z/VM, which is on o3), but that will be another effort, now it just needs to be tested if svirt works unaffected now.

Deployment

It works altogether, but not sure how to deploy it. Maybe https://github.com/os-autoinst/openQA/pull/4973 can be merged separately and deployed. Need to verify if https://github.com/os-autoinst/os-autoinst/pull/2240 can be deployed without https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190.


Related issues 1 (0 open1 closed)

Related to openQA Project - action #88193: [qe-core] virtio-terminal is missing for non root usersResolvedybonatakis2021-01-25

Actions
Actions

Also available in: Atom PDF