1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-16 19:53:09 +00:00
os-autoinst-distri-fedora/tests/_console_login.pm
Adam Williamson 5f702b0be8 Run update repo setup steps from a serial console
This is a surprisingly large change as we want to go back to
the console we were previously on after doing it. To do that we
need to know what console we were on, and to know *that*, we need
to port everything that currently uses (ctrl-)alt-fX to switch
consoles to use select_console instead.

This is primarily intended to make running setup_repos.py faster
when it has to download a lot of packages (as typing in hundreds
of package names is quite slow). But it actually makes the whole
thing faster, even when only downloading one or two packages.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-01-11 12:09:59 -08:00

25 lines
778 B
Perl

use base "basetest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
select_console "tty3-console";
# do user login unless USER_LOGIN is set to string 'false'
# Since there is no console support for arabic, so we cannot let the user log in
# with a password that requires Arabic support.
# Such attempt to log in would always fail.
if (get_var("LANGUAGE") ne "arabic" && get_var("USER_LOGIN") ne "false") {
console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword"));
}
if (get_var("ROOT_PASSWORD")) {
console_login(user => "root", password => get_var("ROOT_PASSWORD"));
}
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et: