action #122935

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

Added by pvorel 3 months ago. Updated about 2 months ago.

Enhancement to existing tests
Target version:
QE Kernel - QE Kernel Current
Start date:
Due date:
% Done:


Estimated time:


virtio console for user (user-virtio-terminal) was added in (#88193) and then used in various HPC tests: (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');                                       

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> ";
    wait_serial(qr/PS1="$serial_term_prompt"/) if testapi::is_serial_terminal;
    $testapi::distri->{serial_term_prompt} = "$serial_term_prompt";

    # 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


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.


What needs special attention:

which run also on o3:

  • mru-install-minimal-with-addons
    reason: 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:

  • 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.


It works altogether, but not sure how to deploy it. Maybe can be merged separately and deployed. Need to verify if can be deployed without

Related issues

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


#1 Updated by pvorel 3 months ago

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

#2 Updated by pvorel 3 months ago

  • Description updated (diff)

#3 Updated by pvorel 3 months ago

  • Description updated (diff)

#4 Updated by pvorel 3 months ago

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

#5 Updated by pvorel 3 months ago

  • Description updated (diff)

#6 Updated by pvorel 3 months ago

  • Target version set to QE Kernel Current

#7 Updated by pvorel 2 months ago

Verification runs

I did testing of alone (without and 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:

Merge and deployment

The only rule is that must be deployed before should not affect anything, can be merged any time.

As a result I suggest:
1) Merge and
2) After is deployed, merge
3) Deploy built rpms

#8 Updated by pvorel 2 months ago

NOTE: live console does not show virtio_console_user.log :(
(problem in, but this can be fixed as a separate effort.

#9 Updated by pvorel 2 months ago

Fixed live console code, so that it now shows virtio_console_user.log :). Therefore merged. The other 2 PRs should be merged soon.

#10 Updated by pvorel 2 months ago was merged, it's now autodeployed. looks to be already deployed on both osd and o3.

Waiting for to be merged and deployed.

#11 Updated by pvorel 2 months ago

  • Status changed from In Progress to Feedback

Also merged, waiting to be deployed.

#12 Updated by pvorel about 2 months ago

OK, problems has come:

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?

#13 Updated by pvorel about 2 months ago

PR: which should fix it - use module only on QEMU

Also available in: Atom PDF