Project

General

Profile

Actions

action #122935

closed

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

Added by pvorel over 1 year ago. Updated 10 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 #1

Updated by pvorel over 1 year ago

  • Category set to Enhancement to existing tests
  • Status changed from New to In Progress
  • Assignee set to pvorel
  • Difficulty set to medium
Actions #2

Updated by pvorel over 1 year ago

  • Description updated (diff)
Actions #3

Updated by pvorel over 1 year ago

  • Description updated (diff)
Actions #4

Updated by pvorel over 1 year ago

  • Related to action #88193: [qe-core] virtio-terminal is missing for non root users added
Actions #5

Updated by pvorel over 1 year ago

  • Description updated (diff)
Actions #6

Updated by pvorel over 1 year ago

  • Target version set to 640
Actions #7

Updated by pvorel over 1 year ago

Verification runs

I did testing of https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190 alone (without https://github.com/os-autoinst/openQA/pull/4973 and https://github.com/os-autoinst/os-autoinst/pull/2240 and it works):

Tested on Tumbleweed and SLES15-SP5
LTP, wicked_basic_sut & wicked_basic_ref and hpc_BETA_mpich_mpi_* (SLES only) + jobs which are needed for creating qcow these job uses (it adds new getty): create_hdd_minimal_base+sdk, create_hdd_hpc_textmode, create_hdd_autoyast_wicked, create_hdd_textmode:

These jobs are also tested locally on my openQA worker (all 3 git repositories), verification runs are updated at:
https://github.com/os-autoinst/openQA/pull/4973.

Merge and deployment

The only rule is that https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190 must be deployed before https://github.com/os-autoinst/os-autoinst/pull/2240

https://github.com/os-autoinst/openQA/pull/4973 should not affect anything, can be merged any time.

As a result I suggest:
1) Merge https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190 and https://github.com/os-autoinst/openQA/pull/4973
2) After https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190 is deployed, merge https://github.com/os-autoinst/os-autoinst/pull/2240.
3) Deploy built rpms

Actions #8

Updated by pvorel over 1 year ago

NOTE: live console does not show virtio_console_user.log :(
(problem in https://github.com/os-autoinst/openQA/pull/4973), but this can be fixed as a separate effort.

Actions #9

Updated by pvorel over 1 year ago

Fixed live console code, so that it now shows virtio_console_user.log :). Therefore https://github.com/os-autoinst/openQA/pull/4973 merged. The other 2 PRs should be merged soon.

Actions #10

Updated by pvorel over 1 year ago

https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190 was merged, it's now autodeployed.

https://github.com/os-autoinst/openQA/pull/4973 looks to be already deployed on both osd and o3.

Waiting for https://github.com/os-autoinst/os-autoinst/pull/2240 to be merged and deployed.

Actions #11

Updated by pvorel over 1 year ago

  • Status changed from In Progress to Feedback

Also https://github.com/os-autoinst/os-autoinst/pull/2240 merged, waiting to be deployed.

Actions #12

Updated by pvorel over 1 year ago

OK, problems has come: https://github.com/os-autoinst/os-autoinst-distri-opensuse/commit/4a89bfb0f44e961b9c5a9b9f5d152391c0bb40d3#r98153902

It looks like problem on sle-15-SP4-JeOS-for-kvm-and-xen-Updates-x86_64-Build20230125-1-jeos-main@svirt-xen-hvm could b solved by removing module from it, but there is also problem on opensuse-Tumbleweed-JeOS-for-RPi-aarch64-Build20230123-jeos@RPi4.

Maybe there should be a check in the beginning of prepare_serial_console() whether job is being run on BACKEND=qemu or BACKEND=svirt (svirt is used on s390x KVM based tests on osd)? Or are there other backends which need this function?

Actions #13

Updated by pvorel over 1 year ago

PR: which should fix it - use module only on QEMU
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16305

Actions #15

Updated by pvorel 10 months ago

  • Tags changed from qemu to qemu, virtio, console
  • Status changed from Feedback to Resolved

Everything is working well now, used in HPC and wicked tests.

Actions #17

Updated by pvorel 10 months ago

  • Target version changed from 640 to QE Kernel Done
Actions

Also available in: Atom PDF