From e89ec3017af7cbe5a43552085073e8a3662e12df Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 1 May 2023 17:07:06 -0700 Subject: [PATCH] Update serial console handling for upstream changes Upstream https://github.com/os-autoinst/openQA/pull/4973 requires us to poke things here a bit. This only works with the newer os-autoinst and openQA (there may be a way to conditionalize it to work with both, but I can't be bothered figuring it out, let's just update). Signed-off-by: Adam Williamson --- lib/fedoradistribution.pm | 1 + tests/_boot_to_anaconda.pm | 2 +- tests/install_text.pm | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/fedoradistribution.pm b/lib/fedoradistribution.pm index a634e87b..a7a4fa20 100644 --- a/lib/fedoradistribution.pm +++ b/lib/fedoradistribution.pm @@ -42,6 +42,7 @@ sub init() { # Initialize the first virtio serial console as "virtio-console" if (check_var('BACKEND', 'qemu')) { $self->add_console('virtio-console', 'virtio_terminal', {}); + $self->add_console('user-virtio-console', 'virtio_terminal', {socked_path => cwd() . '/virtio_console_user'}); for (my $num = 1; $num < get_var('VIRTIO_CONSOLE_NUM', 1); $num++) { # initialize second virtio serial console as # "virtio-console1", third as "virtio-console2" etc. diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index fe3fdf41..6b1c8d9e 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -98,7 +98,7 @@ sub run { if (get_var("SERIAL_CONSOLE")) { # we direct the installer to virtio-console1, and use # virtio-console as a root console - select_console('virtio-console1'); + select_console('user-virtio-console'); unless (wait_serial "Use text mode", timeout => 120) { die "Anaconda has not started."; } type_string "2\n"; unless (wait_serial "Installation") { die "Text version of Anaconda has not started."; } diff --git a/tests/install_text.pm b/tests/install_text.pm index c1d297f5..40e1805d 100644 --- a/tests/install_text.pm +++ b/tests/install_text.pm @@ -26,7 +26,7 @@ sub run { # First, preset the environment according to the chosen console. This test # can run both on a VNC based console, or a serial console. if (get_var("SERIAL_CONSOLE")) { - select_console('virtio-console1'); + select_console('user-virtio-console'); unless (testapi::is_serial_terminal) { die "The test does not run on a serial console when it should."; } @@ -144,7 +144,7 @@ sub run { assert_script_run 'chroot /mnt/sysimage systemctl enable serial-getty@hvc2'; $testapi::distri->{serial_term_prompt} = $origprompt; # back to anaconda ui - select_console("virtio-console1"); + select_console("user-virtio-console"); } } else {