Commit
This allows switching between root and non-root user. NOTE: passing socked_path is possible only to updated os-autoinst backend/qemu.pm (must have this path in virtio_console_names()) thus guarded with $OpenQA::Isotovideo::Interface::version ge 35 detection (changes in 20d0119b ("backend/qemu.pm: Add virtio_console_user fifo name")). Console names should be handled in library (why tests should care about the internals?), but for now at least properly document that. This also requires to add new getty (serial console) to system_prepare.pm (will be working with newly generated images) and shift numbers in wickedbase.pm. This will work also on older backend/qemu.pm, getty just won't be used. Signed-off-by: Petr Vorel <pvorel@suse.cz>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -59,20 +59,37 @@ sub add_serial_console { | |||||||||||||||
prepare_serial_console(); | ||||||||||||||||
Wrapper for add_serial_console. | ||||||||||||||||
Configure serial consoles for virtio support (root-virtio-terminal and | ||||||||||||||||
user-virtio-terminal). | ||||||||||||||||
NOTE: if test plans to use more consoles via VIRTIO_CONSOLE_NUM, it have to | ||||||||||||||||
call add_serial_console() with proper console name (beware different number | ||||||||||||||||
for ppc64le). | ||||||||||||||||
=cut | ||||||||||||||||
|
||||||||||||||||
sub prepare_serial_console { | ||||||||||||||||
# Configure serial consoles for virtio support | ||||||||||||||||
# poo#18860 Enable console on hvc0 on SLES < 12-SP2 | ||||||||||||||||
# poo#44699 Enable console on hvc1 to fix login issues on ppc64le | ||||||||||||||||
record_info('getty before', script_output('systemctl | grep serial-getty')); | ||||||||||||||||
|
||||||||||||||||
if (!check_var('VIRTIO_CONSOLE', 0)) { | ||||||||||||||||
my $console = 'hvc1'; | ||||||||||||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pevik
Author
Contributor
|
sub run { | |
my $self = shift; | |
my $bug_pattern = parse_bug_refs(); | |
select_serial_terminal; | |
my @journal_output = split(/\n/, script_output("journalctl --no-pager --quiet -p ${\get_var('JOURNAL_LOG_LEVEL', 'err')} -o short-precise")); |
For myself: 4a89bfb caused that.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
mloviska
Jan 26, 2023
Contributor
the module runs on all our hypervisors, even those that do not support virtio console yet. So in this particular case that function selects tty
.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
pevik
Jan 26, 2023
Author
Contributor
BTW it's working on JeOS on Tumbleweed: https://openqa.suse.de/tests/10371740#step/journal_check/9
Testing with disabled adding that console on SLES: https://openqa.suse.de/tests/10379176#details
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
ggardet
Jan 26, 2023
Collaborator
This breaks on RPi3/4 (generalhw backend) as well: https://openqa.opensuse.org/tests/3065106#step/system_prepare/8
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
pevik
Jan 26, 2023
•
edited
Author
Contributor
edited
@ggardet also thanks for a report. Obviously add_serial_console($console);
which adds user-virtio-terminal
must be guarded under some if
condition. But how to detect it? This code is intended for jobs which prepare qcow image for QEMU jobs which use it. Shouldn't there 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?
FYI also document the problems in https://progress.opensuse.org/issues/122935
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
ggardet
Jan 26, 2023
Collaborator
Not sure which if
guard to add, but this can be tested with some VR on RPi2/3/4 machines.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
pevik
Jan 27, 2023
Author
Contributor
@ggardet @mloviska FYI #16305
@mloviska This will fix https://openqa.suse.de/tests/10376352#step/journal_check/5, because it will skip unless qemu backend.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ use Utils::Backends; | |
use backend::svirt qw(SERIAL_TERMINAL_DEFAULT_DEVICE SERIAL_TERMINAL_DEFAULT_PORT); | ||
use Cwd; | ||
use autotest 'query_isotovideo'; | ||
use isotovideo; | ||
|
||
=head1 SUSEDISTRIBUTION | ||
|
@@ -428,7 +429,11 @@ sub init_consoles { | |
|
||
if (is_qemu) { | ||
$self->add_console('root-virtio-terminal', 'virtio-terminal', {}); | ||
$self->add_console('user-virtio-terminal', 'virtio-terminal', {}); | ||
|
||
$self->add_console('user-virtio-terminal', 'virtio-terminal', | ||
isotovideo::get_version() >= 35 ? | ||
{socked_path => cwd() . '/virtio_console_user'} : {}); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pevik
Author
Contributor
|
||
|
||
for (my $num = 1; $num < get_var('VIRTIO_CONSOLE_NUM', 1); $num++) { | ||
$self->add_console('root-virtio-terminal' . $num, 'virtio-terminal', {socked_path => cwd() . '/virtio_console' . $num}); | ||
} | ||
|
Hi Peto, this is causing failures in Xen tests.
https://openqa.suse.de/tests/10376352#step/journal_check/5