1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-01 05:54:22 +00:00
os-autoinst-distri-fedora/tests/_console_wait_login.pm
Adam Williamson f752b4c00a Don't snapshot after wait_login tests (usually)
We currently snapshot after every run of _console_wait_login or
_graphical_wait_login, which means we snapshot *twice* on most
update tests as those modules get run twice. However, we almost
never use those snapshots. Snapshotting takes quite some time,
and hits the disk pretty hard, so we should avoid it unless it
is really needed.

We only have a few modules that are not fatal (and so might use
the snapshots), and most of those don't run after one of these
tests, or run after a later module that's also a milestone. Best
I can tell, only two test suites really need to use a snapshot
from a login test: server_cockpit_updates and modularity_tests.
To handle these and potential future cases, we'll add a new
module that does nothing, but is marked 'milestone', so it will
take a snapshot, and load that test after the login test if the
var LOGIN_SNAPSHOT is set, and set that var for those two suites.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-12-08 09:59:23 -08:00

46 lines
1.3 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
# If UPGRADE is set, we have to wait for the entire upgrade
my $wait_time = 300;
$wait_time = 6000 if (get_var("UPGRADE"));
# handle bootloader, if requested
if (get_var("GRUB_POSTINSTALL")) {
do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL"), timeout => $wait_time);
$wait_time = 240;
}
# handle initial-setup, if we're expecting it (ARM disk image)
if (get_var("INSTALL_NO_USER")) {
console_initial_setup;
}
# Wait for the text login
boot_to_login_screen(timeout => $wait_time);
# do user login unless USER_LOGIN is set to string 'false'
unless (get_var("USER_LOGIN") eq "false") {
# this avoids us waiting 90 seconds for a # to show up
my $origprompt = $testapi::distri->{serial_term_prompt};
$testapi::distri->{serial_term_prompt} = '$ ';
console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword"));
$testapi::distri->{serial_term_prompt} = $origprompt;
}
if (get_var("ROOT_PASSWORD")) {
console_login(user => "root", password => get_var("ROOT_PASSWORD"));
}
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: