Project

General

Profile

action #62480

Updated by SLindoMansilla over 1 year ago

At the moment, moment the TTY numbers tty number are assigned to consoles when they are added at the moment of addition (https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/susedistribution.pm#L454)

```perl
$self->add_console('install-shell', 'tty-console', {tty => 2});
$self->add_console('installation', 'tty-console', {tty => check_var('VIDEOMODE', 'text') ? 1 : 7});
$self->add_console('install-shell2', 'tty-console', {tty => 9});
# On SLE15 X is running on tty2 see bsc#1054782
$self->add_console('root-console', 'tty-console', {tty => get_root_console_tty});
$self->add_console('user-console', 'tty-console', {tty => 4});
$self->add_console('log-console', 'tty-console', {tty => 5});
$self->add_console('displaymanager', 'tty-console', {tty => 7});
$self->add_console('x11', 'tty-console', {tty => get_x11_console_tty});
$self->add_console('tunnel-console', 'tty-console', {tty => 3}) if get_var('TUNNELED');
```

In order to check if the selected tty correspond to the expected use case, the number of the console needs to be available at any later point. Following the example of the existing function (https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/f3d70b10a8daf0e36ecc325699fba17352661081/lib/utils.pm#L1091)

```perl
sub get_root_console_tty {
return (!is_sle('<15') && !is_caasp && !check_var('VIRSH_VMM_TYPE', 'linux')) ? 6 : 2;
}
```

Back