2015-08-05 06:23:59 +00:00
|
|
|
use base "anacondatest";
|
2015-01-22 12:38:16 +00:00
|
|
|
use strict;
|
|
|
|
use testapi;
|
2017-01-18 07:15:44 +00:00
|
|
|
use utils;
|
2016-09-12 17:24:30 +00:00
|
|
|
|
|
|
|
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
|
2016-12-21 16:41:00 +00:00
|
|
|
# layout, so the password has both ASCII and native characters
|
|
|
|
desktop_switch_layout "ascii", "anaconda";
|
2016-09-12 17:24:30 +00:00
|
|
|
type_very_safely $user_password;
|
2016-12-16 17:40:29 +00:00
|
|
|
desktop_switch_layout "native", "anaconda";
|
2016-09-12 17:24:30 +00:00
|
|
|
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-12-21 16:41:00 +00:00
|
|
|
desktop_switch_layout("ascii", "anaconda") if (get_var("SWITCHED_LAYOUT"));
|
type root password faster on ostree installs
Summary:
Since we started using `type_very_safely` for typing the root
password, we starting hitting a race issue. If we complete the
root password spoke so slowly that the software deployment
process completes in the meantime, anaconda will wait until we
complete the spoke then immediately flip to the 'post-install
configuration' step, at which point access to the USER CREATION
spoke is blocked.
We don't hit this case on regular RPM installs or live installs
as the deployment phase still takes a while for both of those,
but we are sometimes hitting it for the Atomic ostree install
image, as the software deployment phase is pretty fast there.
We *could* just not bother creating a user and testing we can
log in as a user for that test, but I don't like that approach,
we *should* be testing that user creation and login works OK
for ostree installs. So instead, let's just type the root
password a bit less safely for ostree installs; this will be
more vulnerable to typing errors but hopefully will avoid the
race problem.
Test Plan:
Run a few Atomic installs, see if they hit the race.
Might need to run other tests at the same time, and you may not
be able to hit it, this is obviously dependent on the I/O of
the worker host...
Reviewers: jskladan, garretraziel
Reviewed By: garretraziel
Subscribers: tflink
Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1022
2016-10-14 01:39:33 +00:00
|
|
|
if (get_var("IMAGETYPE") eq 'dvd-ostree') {
|
|
|
|
# we can't type SUPER safely for ostree installer tests, as
|
|
|
|
# the install completes quite fast and if we type too slow
|
|
|
|
# the USER CREATION spoke may be blocked
|
|
|
|
type_safely $root_password;
|
|
|
|
wait_screen_change { send_key "tab"; };
|
|
|
|
type_safely $root_password;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
# these screens seems insanely subject to typing errors, so
|
|
|
|
# type super safely. 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";
|
2017-03-29 22:09:25 +00:00
|
|
|
unless ($user_login eq 'false') {
|
Don't create user when USER_LOGIN is false, but for KDE install
Summary:
For some reason, we have `USER_LOGIN` set to 'false' for the KDE
package set install test. I really don't know / remember why
that would be; I'd think we should create a user and log in as
that user to make sure it works properly when installing KDE
from the traditional installer. It's not strictly part of the
package set test, true, but still, seems worth doing.
Also, when `USER_LOGIN` is set to 'false' and the installer runs,
we create a user called 'false'. This doesn't seem like what we
wanted, so let's not do that. I dunno if there are any other
cases besides the KDE one that this commit changes, but still.
Test Plan:
Run the full test suite and look for weirdness, check
KDE package set test works as intended (now creates a user called
'test' and logs in as that user).
Reviewers: jsedlak, jskladan
Reviewed By: jsedlak
Subscribers: tflink
Differential Revision: https://phab.qa.fedoraproject.org/D1182
2017-03-29 00:52:00 +00:00
|
|
|
assert_and_click "anaconda_install_user_creation";
|
|
|
|
assert_screen "anaconda_install_user_creation_screen";
|
|
|
|
# wait out animation
|
2016-09-12 17:24:30 +00:00
|
|
|
wait_still_screen 2;
|
Don't create user when USER_LOGIN is false, but for KDE install
Summary:
For some reason, we have `USER_LOGIN` set to 'false' for the KDE
package set install test. I really don't know / remember why
that would be; I'd think we should create a user and log in as
that user to make sure it works properly when installing KDE
from the traditional installer. It's not strictly part of the
package set test, true, but still, seems worth doing.
Also, when `USER_LOGIN` is set to 'false' and the installer runs,
we create a user called 'false'. This doesn't seem like what we
wanted, so let's not do that. I dunno if there are any other
cases besides the KDE one that this commit changes, but still.
Test Plan:
Run the full test suite and look for weirdness, check
KDE package set test works as intended (now creates a user called
'test' and logs in as that user).
Reviewers: jsedlak, jskladan
Reviewed By: jsedlak
Subscribers: tflink
Differential Revision: https://phab.qa.fedoraproject.org/D1182
2017-03-29 00:52:00 +00:00
|
|
|
type_very_safely $user_login;
|
|
|
|
type_very_safely "\t\t\t\t";
|
2016-09-12 17:24:30 +00:00
|
|
|
$self->type_user_password();
|
|
|
|
wait_screen_change { send_key "tab"; };
|
|
|
|
wait_still_screen 2;
|
|
|
|
$self->type_user_password();
|
Don't create user when USER_LOGIN is false, but for KDE install
Summary:
For some reason, we have `USER_LOGIN` set to 'false' for the KDE
package set install test. I really don't know / remember why
that would be; I'd think we should create a user and log in as
that user to make sure it works properly when installing KDE
from the traditional installer. It's not strictly part of the
package set test, true, but still, seems worth doing.
Also, when `USER_LOGIN` is set to 'false' and the installer runs,
we create a user called 'false'. This doesn't seem like what we
wanted, so let's not do that. I dunno if there are any other
cases besides the KDE one that this commit changes, but still.
Test Plan:
Run the full test suite and look for weirdness, check
KDE package set test works as intended (now creates a user called
'test' and logs in as that user).
Reviewers: jsedlak, jskladan
Reviewed By: jsedlak
Subscribers: tflink
Differential Revision: https://phab.qa.fedoraproject.org/D1182
2017-03-29 00:52:00 +00:00
|
|
|
# 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.
|
|
|
|
# But not if we're installing with a switched layout, as those
|
|
|
|
# will *always* result in a warning bar at this point (see below)
|
|
|
|
if (!get_var("SWITCHED_LAYOUT") && 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();
|
|
|
|
}
|
|
|
|
assert_and_click "anaconda_install_user_creation_make_admin";
|
Handle 'non-ASCII in password' warning for Russian installs
Summary:
Since 26.17, anaconda shows a warning when the user password
contains non-ASCII characters, and requires a second Done click
to confirm. This change should handle that.
On the 'catch cases where password typing went wrong and re-try'
bit: to keep that, but not re-type the password *every single
time* on the Russian install test, we'd have to make the needle
match the text of the warning. This is problematic because then
that needle will be able to break without us easily noticing;
that's why I wanted to keep the 'warning bar' needle text-free.
Unfortunately, that means we have to skip the protection for
switched-layout installs.
Note the protection was actually not working for any non-English
install anyhow, because the needle had `LANGUAGE-english` as a
tag. We never noticed that. Failed password typing is pretty
rare now, so we can live without the protection - it's just nice
to have it for the English install tests because there's so many
of them.
Test Plan:
Run the Russian install with a recent Rawhide image,
check it clicks 'Done' twice. Note, it will still fail, because
of RHBZ #1413813.
Reviewers: jskladan, garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames
Reviewed By: garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames
Subscribers: tflink
Differential Revision: https://phab.qa.fedoraproject.org/D1084
2017-01-18 07:13:47 +00:00
|
|
|
assert_and_click "anaconda_spoke_done";
|
Don't create user when USER_LOGIN is false, but for KDE install
Summary:
For some reason, we have `USER_LOGIN` set to 'false' for the KDE
package set install test. I really don't know / remember why
that would be; I'd think we should create a user and log in as
that user to make sure it works properly when installing KDE
from the traditional installer. It's not strictly part of the
package set test, true, but still, seems worth doing.
Also, when `USER_LOGIN` is set to 'false' and the installer runs,
we create a user called 'false'. This doesn't seem like what we
wanted, so let's not do that. I dunno if there are any other
cases besides the KDE one that this commit changes, but still.
Test Plan:
Run the full test suite and look for weirdness, check
KDE package set test works as intended (now creates a user called
'test' and logs in as that user).
Reviewers: jsedlak, jskladan
Reviewed By: jsedlak
Subscribers: tflink
Differential Revision: https://phab.qa.fedoraproject.org/D1182
2017-03-29 00:52:00 +00:00
|
|
|
# since 20170105, we will get a warning here when the password
|
|
|
|
# contains non-ASCII characters. Assume only switched layouts
|
|
|
|
# produce non-ASCII characters, though this isn't strictly true
|
|
|
|
if (get_var('SWITCHED_LAYOUT') && check_screen "anaconda_warning_bar", 3) {
|
|
|
|
wait_still_screen 1;
|
|
|
|
assert_and_click "anaconda_spoke_done";
|
|
|
|
}
|
Handle 'non-ASCII in password' warning for Russian installs
Summary:
Since 26.17, anaconda shows a warning when the user password
contains non-ASCII characters, and requires a second Done click
to confirm. This change should handle that.
On the 'catch cases where password typing went wrong and re-try'
bit: to keep that, but not re-type the password *every single
time* on the Russian install test, we'd have to make the needle
match the text of the warning. This is problematic because then
that needle will be able to break without us easily noticing;
that's why I wanted to keep the 'warning bar' needle text-free.
Unfortunately, that means we have to skip the protection for
switched-layout installs.
Note the protection was actually not working for any non-English
install anyhow, because the needle had `LANGUAGE-english` as a
tag. We never noticed that. Failed password typing is pretty
rare now, so we can live without the protection - it's just nice
to have it for the English install tests because there's so many
of them.
Test Plan:
Run the Russian install with a recent Rawhide image,
check it clicks 'Done' twice. Note, it will still fail, because
of RHBZ #1413813.
Reviewers: jskladan, garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames
Reviewed By: garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames
Subscribers: tflink
Differential Revision: https://phab.qa.fedoraproject.org/D1084
2017-01-18 07:13:47 +00:00
|
|
|
}
|
2015-01-22 12:38:16 +00:00
|
|
|
|
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;
|
2017-01-16 17:30:14 +00:00
|
|
|
# for the memory check test, we *don't* want to leave
|
|
|
|
unless (get_var("MEMCHECK")) {
|
|
|
|
assert_and_click "anaconda_install_done";
|
|
|
|
if (get_var('LIVE')) {
|
|
|
|
# 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:
|