From 55c6d153a67042360428bb9270d77cabade555b3 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 12 Mar 2026 12:32:12 +0800 Subject: [PATCH] Ensure correct value from/to SERIALCONSOLE 1.For OSD workers, some machines use ttyS0 and some others use ttyS1 or even ttyS2 which is assigned to setting SERIALDEV. But SERIALDEV is not safe enough to be used everywhere, because it becomes sshserial during test run, here is an example: https://openqa.suse.de/tests/21287146/file/vars.json. 2.Merge request https://gitlab.suse.de/openqa/salt-pillars-openqa/-/merge_requests/1225 introduces setting SERIALCONSOLE which is already being widely used in automation code. This can avoid incorrect SERIALCONSOLE leading to test run failure, for exmaple: https://openqa.suse.de/tests/21287262#step/prepare_transactional_server/74. 3.Current subroutine save_serial_console resets SERIALCONSOLE, if it has no value, to default value obtained from SERIALDEV which may become sshserial. So it is necessary to check and assign more meaningful default value ttyS1 to SERIALCONSOLE. And ttyS1 is also the most widely used serial console. --- lib/Utils/Backends.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Utils/Backends.pm b/lib/Utils/Backends.pm index f88dd660caac..e39f0aead846 100644 --- a/lib/Utils/Backends.pm +++ b/lib/Utils/Backends.pm @@ -64,6 +64,10 @@ sub save_serial_console { my $serialconsole = get_var('SERIALCONSOLE', ''); return if ($serialconsole ne ''); $serialconsole = get_var('SERIALDEV', 'ttyS1'); + if ($serialconsole eq 'sshserial') { + record_info('Reset SERIALCONSOLE to ttyS1', 'Because SERIALCONSOLE has no value and SERIALDEV is sshserial'); + $serialconsole = 'ttyS1'; + } set_var('SERIALCONSOLE', $serialconsole); bmwqemu::save_vars(); }