2015-08-05 06:23:59 +00:00
|
|
|
use base "anacondatest";
|
2015-01-22 12:38:16 +00:00
|
|
|
use strict;
|
|
|
|
use testapi;
|
2016-09-12 17:24:30 +00:00
|
|
|
use main_common;
|
|
|
|
|
|
|
|
sub type_user_password {
|
|
|
|
my $self = shift;
|
|
|
|
my $user_password = get_var("USER_PASSWORD") || "weakpassword";
|
|
|
|
if (get_var("SWITCHED_LAYOUT")) {
|
|
|
|
# we double the password, the second time using the native
|
|
|
|
# layout, so the password has both US and native characters
|
|
|
|
$self->switch_layout("us");
|
|
|
|
type_very_safely $user_password;
|
|
|
|
$self->switch_layout("native");
|
|
|
|
type_very_safely $user_password;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
type_very_safely $user_password;
|
|
|
|
}
|
|
|
|
}
|
2015-01-22 12:38:16 +00:00
|
|
|
|
|
|
|
sub run {
|
2016-05-20 14:52:55 +00:00
|
|
|
my $self = shift;
|
2015-01-22 12:38:16 +00:00
|
|
|
# Anaconda hub
|
2015-01-26 14:58:07 +00:00
|
|
|
assert_screen "anaconda_main_hub", 300; #
|
2015-01-22 12:38:16 +00:00
|
|
|
|
|
|
|
# Begin installation
|
2015-07-22 18:26:10 +00:00
|
|
|
# Sometimes, the 'slide in from the top' animation messes with
|
|
|
|
# this - by the time we click the button isn't where it was any
|
|
|
|
# more. So wait a sec just in case.
|
|
|
|
sleep 1;
|
2015-01-22 12:38:16 +00:00
|
|
|
assert_and_click "anaconda_main_hub_begin_installation";
|
2015-01-26 14:58:07 +00:00
|
|
|
|
2015-01-22 12:38:16 +00:00
|
|
|
# Set root password
|
2015-02-13 15:36:35 +00:00
|
|
|
my $root_password = get_var("ROOT_PASSWORD") || "weakpassword";
|
2015-01-22 12:38:16 +00:00
|
|
|
assert_and_click "anaconda_install_root_password";
|
2015-04-03 08:27:31 +00:00
|
|
|
assert_screen "anaconda_install_root_password_screen";
|
2016-09-12 17:24:30 +00:00
|
|
|
# wait out animation
|
|
|
|
wait_still_screen 2;
|
2016-05-20 14:52:55 +00:00
|
|
|
$self->switch_layout("us") if (get_var("SWITCHED_LAYOUT"));
|
2016-09-12 17:24:30 +00:00
|
|
|
# these screens seems insanely subject to typing errors, so let's
|
|
|
|
# type super safely. Note this doesn't really slow the test down
|
|
|
|
# as we still get done before the install process is complete.
|
|
|
|
type_very_safely $root_password;
|
|
|
|
wait_screen_change { send_key "tab"; };
|
|
|
|
type_very_safely $root_password;
|
2015-01-22 12:38:16 +00:00
|
|
|
assert_and_click "anaconda_spoke_done";
|
|
|
|
|
|
|
|
# Set user details
|
2016-09-12 17:24:30 +00:00
|
|
|
# wait out animation
|
|
|
|
sleep 3;
|
2015-02-13 15:36:35 +00:00
|
|
|
my $user_login = get_var("USER_LOGIN") || "test";
|
2015-01-22 12:38:16 +00:00
|
|
|
assert_and_click "anaconda_install_user_creation";
|
2015-04-03 08:27:31 +00:00
|
|
|
assert_screen "anaconda_install_user_creation_screen";
|
2016-09-12 17:24:30 +00:00
|
|
|
# wait out animation
|
|
|
|
wait_still_screen 2;
|
|
|
|
type_very_safely $user_login;
|
|
|
|
type_very_safely "\t\t\t\t";
|
|
|
|
$self->type_user_password();
|
|
|
|
wait_screen_change { send_key "tab"; };
|
|
|
|
wait_still_screen 2;
|
|
|
|
$self->type_user_password();
|
|
|
|
# even with all our slow typing this still *sometimes* seems to
|
|
|
|
# miss a character, so let's try again if we have a warning bar
|
|
|
|
if (check_screen "anaconda_warning_bar", 3) {
|
|
|
|
wait_screen_change { send_key "shift-tab"; };
|
|
|
|
wait_still_screen 2;
|
|
|
|
$self->type_user_password();
|
|
|
|
wait_screen_change { send_key "tab"; };
|
|
|
|
wait_still_screen 2;
|
|
|
|
$self->type_user_password();
|
2016-05-20 14:52:55 +00:00
|
|
|
}
|
2015-01-22 12:38:16 +00:00
|
|
|
assert_and_click "anaconda_install_user_creation_make_admin";
|
|
|
|
assert_and_click "anaconda_spoke_done";
|
|
|
|
|
2015-09-29 22:52:50 +00:00
|
|
|
# Check username (and hence keyboard layout) if non-English
|
|
|
|
if (get_var('LANGUAGE')) {
|
|
|
|
assert_screen "anaconda_install_user_created";
|
|
|
|
}
|
|
|
|
|
2016-09-12 17:24:30 +00:00
|
|
|
# With the slow typing - especially with SWITCHED_LAYOUT - we
|
|
|
|
# may not complete user creation until anaconda reaches post-install,
|
|
|
|
# which causes a 'Finish configuration' button
|
|
|
|
if (check_screen "anaconda_install_finish_configuration", 5) {
|
|
|
|
assert_and_click "anaconda_install_finish_configuration";
|
|
|
|
}
|
|
|
|
|
2015-11-11 16:48:46 +00:00
|
|
|
# Wait for install to end. Give Rawhide a bit longer, in case
|
|
|
|
# we're on a debug kernel, debug kernel installs are really slow.
|
|
|
|
my $timeout = 1800;
|
|
|
|
if (lc(get_var('VERSION')) eq "rawhide") {
|
|
|
|
$timeout = 2400;
|
|
|
|
}
|
2016-05-06 23:16:28 +00:00
|
|
|
assert_screen "anaconda_install_done", $timeout;
|
2016-05-06 20:15:13 +00:00
|
|
|
# wait for transition to complete so we don't click in the sidebar
|
|
|
|
wait_still_screen 3;
|
|
|
|
assert_and_click "anaconda_install_done";
|
2015-03-18 21:28:03 +00:00
|
|
|
if (get_var('LIVE')) {
|
2016-09-12 17:24:30 +00:00
|
|
|
# reboot from a console, it's more reliable than the desktop
|
|
|
|
# runners
|
|
|
|
$self->root_console;
|
|
|
|
type_string "reboot\n";
|
2015-03-18 21:28:03 +00:00
|
|
|
}
|
2015-01-22 12:38:16 +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 };
|
2015-01-22 12:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|