1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-11 17:34:23 +00:00

WIP WIP anaconda webUI support

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-08-21 15:32:08 -07:00
parent 14bd0b177e
commit 83edfb92b7
25 changed files with 278 additions and 32 deletions

View File

@ -715,6 +715,7 @@ sub gnome_initial_setup {
# mode (when user was created during install) # mode (when user was created during install)
my %args = ( my %args = (
prelogin => 0, prelogin => 0,
live => 0,
timeout => 120, timeout => 120,
@_ @_
); );
@ -729,18 +730,38 @@ sub gnome_initial_setup {
my @nexts = ('language', 'keyboard', 'privacy', 'timezone', 'software'); my @nexts = ('language', 'keyboard', 'privacy', 'timezone', 'software');
# now, we're going to figure out how many of them this test will # now, we're going to figure out how many of them this test will
# *actually* see... # *actually* see...
if ($args{live}) {
# this is the flow we see when booting an F39+ Workstation live
# we only get language and keyboard
@nexts = ('language', 'keyboard')
}
if ($args{prelogin}) { if ($args{prelogin}) {
# 'language', 'keyboard' and 'timezone' are skipped on F28+ in # 'language', 'keyboard' and 'timezone' were skipped between F28
# the 'new user' mode by # and F38 in the 'new user' mode by
# https://fedoraproject.org//wiki/Changes/ReduceInitialSetupRedundancy # https://fedoraproject.org//wiki/Changes/ReduceInitialSetupRedundancy
# https://bugzilla.redhat.com/show_bug.cgi?id=1474787 , # https://bugzilla.redhat.com/show_bug.cgi?id=1474787 ,
# except 'language' is never *really* skipped (see above) # except 'language' was never *really* skipped (see above)
# From gnome-initial-setup 45~beta-3 on, these screens aren't
# skipped in vendor.conf. They should be skipped for live
# installs because they were shown preinstall on the new webUI
# workflow, but this is broken till
# https://github.com/rhinstaller/anaconda/pull/5056 is merged.
# network installs and disk image deployments will show these
# screens (which is good for disk image deployments, but
# redundant for network installs)
# FIXME make this conditional version-based after the anaconda
# updates land and g-i-s is tagged again. modify it to drop
# the pages on F39+ live installs once the anaconda PR is
# merged or addressed some other way
my $advortask = get_var("ADVISORY_OR_TASK");
unless ($advortask eq "FEDORA-2023-80c0846ede" || $advortask eq "FEDORA-2023-3172dea90a") {
@nexts = grep { $_ ne 'keyboard' } @nexts; @nexts = grep { $_ ne 'keyboard' } @nexts;
@nexts = grep { $_ ne 'timezone' } @nexts; @nexts = grep { $_ ne 'timezone' } @nexts;
} }
}
else { else {
# 'timezone' and 'software' are suppressed for the 'existing user' # 'timezone' and 'software' are suppressed for the 'existing user'
# form of g-i-s # form of g-i-s (upstream, not in vendor.conf)
@nexts = grep { $_ ne 'software' } @nexts; @nexts = grep { $_ ne 'software' } @nexts;
@nexts = grep { $_ ne 'timezone' } @nexts; @nexts = grep { $_ ne 'timezone' } @nexts;
} }
@ -767,23 +788,35 @@ sub gnome_initial_setup {
} }
# GDM 3.24.1 dumps a cursor in the middle of the screen here... # GDM 3.24.1 dumps a cursor in the middle of the screen here...
mouse_hide if ($args{prelogin}); mouse_hide if ($args{prelogin});
for my $n (1 .. scalar(@nexts)) { foreach my $next (@nexts) {
# click 'Next' $nexts times, moving the mouse to avoid # click 'Next' $nexts times, moving the mouse to avoid
# highlight problems, sleeping to give it time to get # highlight problems, sleeping to give it time to get
# to the next screen between clicks # to the next screen between clicks
mouse_set(100, 100); mouse_set(100, 100);
if ($n == 1) { if ($next eq 'language') {
# only accept start_setup one time, to avoid matching # only accept start_setup one time, to avoid matching
# on it during transition to next screen. also accept # on it during transition to next screen. also accept
# next_button as in per-user mode, first screen has that # next_button as in per-user mode, first screen has that
# not start_setup # not start_setup
wait_screen_change { assert_and_click ["next_button", "start_setup"]; }; wait_screen_change { assert_and_click ["next_button", "start_setup"]; };
} }
elsif ($next eq 'timezone') {
assert_screen ["next_button", "next_button_inactive"];
if (match_has_tag "next_button_inactive") {
record_soft_failure "geolocation failed!";
send_key "tab";
wait_still_screen 3;
type_very_safely "washington-d";
send_key "down";
send_key "ret";
}
wait_screen_change { assert_and_click "next_button"; };
}
else { else {
wait_screen_change { assert_and_click "next_button"; }; wait_screen_change { assert_and_click "next_button"; };
} }
} }
unless (get_var("VNC_CLIENT")) { unless (get_var("VNC_CLIENT") || $args{live}) {
# We should be at the GOA screen, except on VNC_CLIENT case # We should be at the GOA screen, except on VNC_CLIENT case
# where network isn't working yet. click 'Skip' one time. If # where network isn't working yet. click 'Skip' one time. If
# it's not visible we may have hit # it's not visible we may have hit
@ -797,7 +830,10 @@ sub gnome_initial_setup {
record_soft_failure "GOA screen not seen! Likely RHBZ #1997310"; record_soft_failure "GOA screen not seen! Likely RHBZ #1997310";
} }
} }
# on the 'live' flow, this will launch the installer
send_key "ret"; send_key "ret";
# we don't want to do anything further on the 'live' flow
return if ($args{live});
if ($args{prelogin}) { if ($args{prelogin}) {
# create user # create user
my $user_login = get_var("USER_LOGIN") || "test"; my $user_login = get_var("USER_LOGIN") || "test";

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 177,
"height": 28,
"ypos": 92,
"type": "match",
"xpos": 14
}
],
"properties": [],
"tags": [
"version_39_ident"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,24 @@
{
"area": [
{
"type": "match",
"xpos": 483,
"width": 58,
"height": 58,
"ypos": 186
},
{
"xpos": 496,
"type": "match",
"height": 17,
"ypos": 378,
"width": 35
}
],
"properties": [],
"tags": [
"anaconda_install_done",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,24 @@
{
"area": [
{
"height": 58,
"ypos": 198,
"width": 58,
"xpos": 480,
"type": "match"
},
{
"xpos": 492,
"type": "match",
"width": 35,
"height": 17,
"ypos": 390
}
],
"properties": [],
"tags": [
"anaconda_install_done",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 280,
"ypos": 309,
"width": 30,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_install_destination_select_disk_1"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"height": 17,
"ypos": 727,
"width": 154,
"type": "match",
"xpos": 363
}
],
"properties": [],
"tags": [
"ENV-DISTRI-fedora",
"LANGUAGE-english",
"anaconda_webui_begin_installation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 270,
"ypos": 472,
"width": 154,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_confirm_installation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"type": "match",
"xpos": 266,
"ypos": 463,
"height": 17,
"width": 154
}
],
"properties": [],
"tags": [
"anaconda_webui_confirm_installation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 602,
"ypos": 258,
"width": 21,
"height": 37,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_disk_select"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 363,
"ypos": 724,
"width": 40,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_next"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 264,
"ypos": 158,
"width": 311,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_welcome"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -117,10 +117,17 @@ sub run {
send_key "ret"; send_key "ret";
} }
# on lives, we have to explicitly launch anaconda # on lives, we have to explicitly launch anaconda
my $launched = 0;
my $count = 5; my $count = 5;
while ($count > 0) { while ($count > 0) {
$count -= 1; $count -= 1;
assert_screen ["live_start_anaconda_icon", "apps_menu_button_active"], 300; assert_screen ["live_start_anaconda_icon", "apps_menu_button_active", "next_button"], 300;
if (match_has_tag "next_button") {
# we're on F39+ Workstation and looking at gnome-initial-setup
# completing g-i-s launches the installer
gnome_initial_setup(live => 1);
$launched = 1;
}
if (match_has_tag "apps_menu_button_active") { if (match_has_tag "apps_menu_button_active") {
# give GNOME some time to be sure it's done starting up # give GNOME some time to be sure it's done starting up
# and ready for input # and ready for input
@ -133,6 +140,8 @@ sub run {
last; last;
} }
} }
# if we hit the g-i-s flow we already launched
unless ($launched) {
# for KDE we need to double-click # for KDE we need to double-click
my $relnum = get_release_number; my $relnum = get_release_number;
my $dclick = 0; my $dclick = 0;
@ -144,9 +153,18 @@ sub run {
assert_and_click("live_start_anaconda_icon", dclick => $dclick, timeout => 300); assert_and_click("live_start_anaconda_icon", dclick => $dclick, timeout => 300);
} }
} }
}
# wait for anaconda to appear
assert_screen ["anaconda_select_install_lang", "anaconda_webui_welcome"], 300;
# on webUI path we are done now, also set a var so later
# tests know if we're on the webUI path
if (match_has_tag "anaconda_webui_welcome") {
set_var("_ANACONDA_WEBUI", 1);
return;
}
# we click to work around RHBZ #1566066 if it happens
click_lastmatch;
my $language = get_var('LANGUAGE') || 'english'; my $language = get_var('LANGUAGE') || 'english';
# wait for anaconda to appear; we click to work around
# RHBZ #1566066 if it happens
assert_and_click("anaconda_select_install_lang", timeout => 300); assert_and_click("anaconda_select_install_lang", timeout => 300);
# Select install language # Select install language

View File

@ -55,6 +55,7 @@ sub _do_root_and_user {
sub run { sub run {
my $self = shift; my $self = shift;
my $webui = 0;
# From F31 onwards (after Fedora-Rawhide-20190722.n.1), user and # From F31 onwards (after Fedora-Rawhide-20190722.n.1), user and
# root password spokes are moved to main hub, so we must do those # root password spokes are moved to main hub, so we must do those
# before we run the install. # before we run the install.
@ -63,9 +64,13 @@ sub run {
# Sometimes, the 'slide in from the top' animation messes with # Sometimes, the 'slide in from the top' animation messes with
# this - by the time we click the button isn't where it was any # this - by the time we click the button isn't where it was any
# more. So wait for screen to stop moving before we click. # more. So wait for screen to stop moving before we click.
assert_screen "anaconda_main_hub_begin_installation", 90; assert_screen ["anaconda_main_hub_begin_installation", "anaconda_webui_begin_installation"], 90;
wait_still_screen 5; wait_still_screen 5;
assert_and_click "anaconda_main_hub_begin_installation"; assert_and_click ["anaconda_main_hub_begin_installation", "anaconda_webui_begin_installation"];
if (match_has_tag "anaconda_webui_begin_installation") {
$webui = 1;
assert_and_click "anaconda_webui_confirm_installation";
}
# If we want to test identification we will do it # If we want to test identification we will do it
# on several places in this procedure, such as # on several places in this procedure, such as
@ -74,7 +79,7 @@ sub run {
my $identification = get_var('IDENTIFICATION'); my $identification = get_var('IDENTIFICATION');
my $branched = get_var('VERSION'); my $branched = get_var('VERSION');
if ($identification eq 'true' or ($branched ne "Rawhide" && $branched ne "ELN")) { if ($identification eq 'true' or ($branched ne "Rawhide" && $branched ne "ELN")) {
check_left_bar(); check_left_bar() unless ($webui);
check_prerelease(); check_prerelease();
check_version(); check_version();
} }
@ -105,7 +110,8 @@ sub run {
wait_still_screen 3; wait_still_screen 3;
# if this is a live install, let's go ahead and quit the installer # if this is a live install, let's go ahead and quit the installer
# in all cases, just to make sure quitting doesn't crash etc. # in all cases, just to make sure quitting doesn't crash etc.
assert_and_click "anaconda_install_done" if (get_var('LIVE')); # not on web UI, as it immediately reboots
assert_and_click "anaconda_install_done" if (get_var('LIVE') && !$webui);
# there are various things we might have to do at a console here # there are various things we might have to do at a console here
# before we actually reboot. let's figure them all out first... # before we actually reboot. let's figure them all out first...
my @actions; my @actions;
@ -120,9 +126,10 @@ sub run {
} }
} }
# memcheck test doesn't need to reboot at all. Rebooting from GUI # memcheck test doesn't need to reboot at all. Rebooting from GUI
# for lives is unreliable. And if we're already doing something # for no-webUI lives is unreliable (webUI lives reboot on "Quit"
# just like non-lives). And if we're already doing something
# else at a console, we may as well reboot from there too # else at a console, we may as well reboot from there too
push(@actions, 'reboot') if (!get_var("MEMCHECK") && (get_var("LIVE") || @actions)); push(@actions, 'reboot') if (!get_var("MEMCHECK") && ((get_var("LIVE") && !$webui) || @actions));
# our approach for taking all these actions doesn't work on VNC # our approach for taking all these actions doesn't work on VNC
# installs, fortunately we don't need any of them in that case # installs, fortunately we don't need any of them in that case
# yet, so for now let's just flush the list here if we're VNC # yet, so for now let's just flush the list here if we're VNC

View File

@ -4,8 +4,6 @@ use testapi;
sub run { sub run {
my $self = shift; my $self = shift;
# Anaconda hub
assert_screen "anaconda_main_hub", 300;
# Select package set. Minimal is the default, if 'default' is specified, skip selection, # Select package set. Minimal is the default, if 'default' is specified, skip selection,
# but verify correct default in some cases # but verify correct default in some cases

View File

@ -9,9 +9,26 @@ sub run {
# If we want to test graphics during installation, we need to # If we want to test graphics during installation, we need to
# call the test suite with an "IDENTIFICATION=true" variable. # call the test suite with an "IDENTIFICATION=true" variable.
my $identification = get_var('IDENTIFICATION'); my $identification = get_var('IDENTIFICATION');
# Anaconda hub assert_screen ["anaconda_main_hub", "anaconda_webui_welcome"];
if (match_has_tag "anaconda_webui_welcome") {
# long term we'll want two paths through select_disks or
# a webui_select_disks, but for now, just throw it in here
# as it's simple on this single path
assert_and_click "anaconda_webui_disk_select";
assert_and_click "anaconda_install_destination_select_disk_1";
# assume default selection is the appropriate one; if it
# isn't, we'll fail soon enough
wait_screen_change { assert_and_click "anaconda_webui_next"; };
wait_still_screen 3;
# click through the 'encrypt my data' screen
assert_and_click "anaconda_webui_next";
# for now, skip the self-identification checks
return;
}
else {
# Go to INSTALLATION DESTINATION and ensure one disk is selected. # Go to INSTALLATION DESTINATION and ensure one disk is selected.
select_disks(); select_disks();
}
# updates.img tests work by changing the appearance of the INSTALLATION # updates.img tests work by changing the appearance of the INSTALLATION
# DESTINATION screen, so check that if needed. # DESTINATION screen, so check that if needed.