From 48b6c9d3e911d354a68587221a223c0f0486ac4b Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 20 Nov 2019 08:39:28 -0800 Subject: [PATCH] Change name we use for virtio serial consoles There is nothing inherently 'root'-y about these so it makes no sense to prefix their names with 'root-'. And why change from 'console' to 'terminal' compared to the naming used in the actual qemu command and the log files? It's just confusing. Let's be consistent (except for using - instead of _ here... but - is easier to type!) Signed-off-by: Adam Williamson --- lib/anacondatest.pm | 2 +- lib/fedoradistribution.pm | 8 +++++--- lib/installedtest.pm | 2 +- tests/_boot_to_anaconda.pm | 14 +++++++------- tests/install_text.pm | 4 ++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index f07ee0d3..366ce7e1 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -123,7 +123,7 @@ sub root_console { elsif (get_var("SERIAL_CONSOLE")) { # select first virtio terminal, we rely on anaconda having run # a root shell on it for us - select_console("root-virtio-terminal"); + select_console("virtio-console"); # as we don't have any live image serial install tests, we # know we don't need to login return; diff --git a/lib/fedoradistribution.pm b/lib/fedoradistribution.pm index 773601d2..0ddd7009 100644 --- a/lib/fedoradistribution.pm +++ b/lib/fedoradistribution.pm @@ -22,11 +22,13 @@ sub init() { my ($self) = @_; $self->SUPER::init(); - # This initiates the serial console as "root-virtio-terminal". + # Initialize the first virtio serial console as "virtio-console" if (check_var('BACKEND', 'qemu')) { - $self->add_console('root-virtio-terminal', 'virtio-terminal', {}); + $self->add_console('virtio-console', 'virtio-console', {}); 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}); + # initialize second virtio serial console as + # "virtio-console1", third as "virtio-console2" etc. + $self->add_console('virtio-console' . $num, 'virtio-console', {socked_path => cwd() . '/virtio_console' . $num}); } } } diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 940797b4..09277208 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -18,7 +18,7 @@ sub root_console { if (get_var("SERIAL_CONSOLE")) { # select the first virtio terminal, for now we assume we can # always use that (we may have to make this smarter in future) - select_console("root-virtio-terminal"); + select_console("virtio-console"); } else { # For normal terminal emulation, use key combo to reach a tty diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 8afaedb1..8bf8fc03 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -47,13 +47,13 @@ sub run { # displaying information but does not accept key strokes. Therefore, # let us use a real virtio console here. if (get_var("SERIAL_CONSOLE")) { - # this is icky. on ppc64 (OFW), virtio-terminal is hvc1 and - # virtio-terminal1 is hvc2, because the 'standard' serial + # this is icky. on ppc64 (OFW), virtio-console is hvc1 and + # virtio-console1 is hvc2, because the 'standard' serial # terminal is hvc0 (the firmware does this or something). # On other arches, the 'standard' serial terminal is ttyS0, - # so virtio-terminal becomes hvc0 and virtio-terminal1 is + # so virtio-console becomes hvc0 and virtio-console1 is # hvc1. We want anaconda to wind up on the console that is - # virtio-terminal1 in both cases + # virtio-console1 in both cases if (get_var("OFW")) { $params .= "console=hvc2 "; } @@ -96,9 +96,9 @@ sub run { if (get_var("ANACONDA_TEXT")) { # select that we don't want to start VNC; we want to run in text mode if (get_var("SERIAL_CONSOLE")) { - # we direct the installer to virtio-terminal1, and use - # virtio-terminal as a root console - select_console('root-virtio-terminal1'); + # we direct the installer to virtio-console1, and use + # virtio-console as a root console + select_console('virtio-console1'); 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 972875e5..f25f0ec8 100644 --- a/tests/install_text.pm +++ b/tests/install_text.pm @@ -25,7 +25,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('root-virtio-terminal1'); + select_console('virtio-console1'); unless (testapi::is_serial_terminal) { die "The test does not run on a serial console when it should."; } @@ -135,7 +135,7 @@ sub run { assert_script_run 'chroot /mnt/sysimage systemctl enable serial-getty@hvc1'; assert_script_run 'chroot /mnt/sysimage systemctl enable serial-getty@hvc2'; # back to anaconda ui - select_console("root-virtio-terminal1"); + select_console("virtio-console1"); } } else {