mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-11-16 10:11:26 +00:00
84a14cdb67
This requires adding products, flavors and needles and test cases, and tweaking some existing ones to handle the slightly different behaviour of live images in shared tests. To handle the different main hub screens in live and non-live, a less stringent needle is added which is unregistered for non-live tests, so they don't match on it before they've finished updating repository metadata. There are a few small bugfix tweaks in this too, like some delays in user creation to try and avoid intermittent failures there. A new root_logged_in needle is also included, to handle a new console font in Rawhide - that has nothing strictly to do with live testing, it just happened to come up while working on this.
58 lines
1.5 KiB
Perl
58 lines
1.5 KiB
Perl
use base "basetest";
|
|
use strict;
|
|
use testapi;
|
|
|
|
sub run {
|
|
|
|
# If KICKSTART is set, then the wait_time needs to
|
|
# consider the install time
|
|
my $wait_time = get_var("KICKSTART") ? 1800 : 300;
|
|
|
|
# Reboot and wait for the text login
|
|
assert_screen "text_console_login", $wait_time;
|
|
|
|
if ((get_var("USER_LOGIN") && get_var("USER_PASSWORD")) || get_var("ROOT_PASSWORD"))
|
|
{
|
|
my $user_logged_in = 0;
|
|
if (get_var("USER_LOGIN"))
|
|
{
|
|
type_string get_var("USER_LOGIN");
|
|
send_key "ret";
|
|
type_string get_var("USER_PASSWORD");
|
|
send_key "ret";
|
|
assert_screen "user_logged_in", 10;
|
|
$user_logged_in = 1;
|
|
}
|
|
if (get_var("ROOT_PASSWORD"))
|
|
{
|
|
if ($user_logged_in == 1)
|
|
{
|
|
type_string "su -";
|
|
send_key "ret";
|
|
assert_screen "console_password_required", 10;
|
|
}
|
|
else
|
|
{
|
|
type_string "root";
|
|
send_key "ret";
|
|
}
|
|
type_string get_var("ROOT_PASSWORD");
|
|
send_key "ret";
|
|
assert_screen "root_logged_in", 10;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
sub test_flags {
|
|
# without anything - rollback to 'lastgood' snapshot if failed
|
|
# 'fatal' - whole test suite is in danger if this fails
|
|
# 'milestone' - after this test succeeds, update 'lastgood'
|
|
# 'important' - if this fails, set the overall state to 'fail'
|
|
return { fatal => 1, milestone => 1 };
|
|
}
|
|
|
|
1;
|
|
|
|
# vim: set sw=4 et:
|