1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-17 20:13:08 +00:00
os-autoinst-distri-fedora/tests/_wait_for_login_screen.pm

63 lines
1.8 KiB
Perl
Raw Normal View History

2015-01-26 14:58:07 +00:00
use base "basetest";
use strict;
use testapi;
sub run {
2015-01-27 12:35:27 +00:00
# If KICKSTART is set, then the wait_time needs to
# consider the install time
2015-02-03 12:59:31 +00:00
my $wait_time = get_var("KICKSTART") ? 1800 : 300;
2015-01-27 12:35:27 +00:00
2015-01-26 14:58:07 +00:00
# Reboot and wait for the text login
2015-01-27 12:35:27 +00:00
assert_screen "clean_install_login", $wait_time;
2015-02-04 13:05:20 +00:00
if ((get_var("USER_LOGIN") && get_var("USER_PASSWORD")) || get_var("ROOT_PASSWORD"))
2015-01-27 12:35:27 +00:00
{
if (get_var("FLAVOR") eq "server")
{
2015-01-27 15:24:12 +00:00
my $user_logged_in = 0;
if (get_var("USER_LOGIN"))
2015-01-27 12:35:27 +00:00
{
2015-01-27 15:24:12 +00:00
type_string get_var("USER_LOGIN");
send_key "ret";
2015-03-11 15:35:54 +00:00
assert_screen "password_required", 10;
2015-01-27 15:24:12 +00:00
type_string get_var("USER_PASSWORD");
2015-01-27 12:35:27 +00:00
send_key "ret";
2015-01-27 15:24:12 +00:00
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";
}
2015-03-11 15:35:54 +00:00
assert_screen "password_required", 10;
2015-01-27 12:35:27 +00:00
type_string get_var("ROOT_PASSWORD");
send_key "ret";
assert_screen "root_logged_in", 10;
}
}
}
2015-01-26 14:58:07 +00:00
}
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'
2015-01-28 12:42:34 +00:00
return { fatal => 1, milestone => 1 };
2015-01-26 14:58:07 +00:00
}
1;
# vim: set sw=4 et: