action #122935
closedopenqa: fix virtio console for user (user-virtio-terminal)
0%
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:
- https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/9f84f058d22425bae123734c06a28fa988d5ba06/tests/hpc/mpi_master.pm#L39-L40
- https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/9f84f058d22425bae123734c06a28fa988d5ba06/tests/hpc/mpi_master.pm#L62-L63
- https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/9f84f058d22425bae123734c06a28fa988d5ba06/lib/hpcbase.pm#L354-L355
Issue long time ago reported reported by Jozef Pupava.
- serial prompt change handling is not encapsulated in library https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/9f84f058d22425bae123734c06a28fa988d5ba06/lib/sles4sap.pm#L218-L222
# 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";
# 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:
- https://github.com/os-autoinst/openQA/pull/4973
- https://github.com/os-autoinst/os-autoinst/pull/2240
- https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16190
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:
HPC tests
reason: use user-virtio-terminal, require tap worker (I don't have), maintainer: Ioannis Bonatakis
e.g. sle-15-SP5-Online-x86_64-Build64.1-hpc_BETA_mpich_mpi_supportserver@64bit
https://openqa.suse.de/tests/10220175wicked tests
reason: use VIRTIO_CONSOLE_NUM=2 - the output was renamed from virtio_console1.log to serial_terminal_user.txt, require tap worker (I don't have), maintainer: asmorodskyi@suse.de, cfamullaconrad@suse.de, jalausuch@suse.com
e.g. wicked_ipv6_sut@64bit https://openqa.suse.de/tests/10219403
wicked_ipv6_ref@64bit https://openqa.suse.de/tests/10219400
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 installerSanity 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#downloadsThe 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.
Updated by pvorel almost 2 years ago
- Category set to Enhancement to existing tests
- Status changed from New to In Progress
- Assignee set to pvorel
- Difficulty set to medium
Updated by pvorel almost 2 years ago
- Related to action #88193: [qe-core] virtio-terminal is missing for non root users added
Updated by pvorel almost 2 years 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:
- https://openqa.suse.de/tests/overview?build=virtio-console-user
- https://openqa.opensuse.org/tests/overview?build=virtio-console-user
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
Updated by pvorel almost 2 years 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.
Updated by pvorel almost 2 years 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.
Updated by pvorel almost 2 years 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.
Updated by pvorel almost 2 years ago
- Status changed from In Progress to Feedback
Also https://github.com/os-autoinst/os-autoinst/pull/2240 merged, waiting to be deployed.
Updated by pvorel almost 2 years 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?
Updated by pvorel almost 2 years ago
PR: which should fix it - use module only on QEMU
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16305
Updated by pvorel over 1 year 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.
Updated by pvorel over 1 year ago
- Target version changed from 640 to QE Kernel Done