os-autoinst-distri-fedora/tests/_boot_to_anaconda.pm

104 lines
3.3 KiB
Perl
Raw Normal View History

use base "anacondatest";
2015-01-26 14:58:07 +00:00
use strict;
use testapi;
# get_kernel_line switches to menu edit screen and sets the cursor to the end of kernel line
sub get_kernel_line {
if( get_var("UEFI")){
send_key "e";
send_key "down";
send_key "down";
send_key "end";
} else {
send_key "tab";
}
}
2015-01-26 14:58:07 +00:00
sub run {
# Wait for bootloader to appear
if( get_var("UEFI")){
assert_screen "bootloader_uefi", 30;
} else {
assert_screen "bootloader", 30;
}
2015-01-26 14:58:07 +00:00
# Make sure we skip media check if it's selected by default. Standard
# 'boot installer' menu entry is always first.
send_key "up";
send_key "up";
2015-01-26 14:58:07 +00:00
# if variable GRUB is set, add its value into kernel line in grub
2015-02-04 13:05:20 +00:00
if( get_var("GRUB")){
get_kernel_line;
2015-02-04 13:05:20 +00:00
type_string " ".get_var("GRUB");
2015-02-04 13:45:37 +00:00
}
# if GRUBADD is set, add that to kernel line too. this is for doing
# stuff like running the tests with an updates.img to test some
# anaconda change
if (get_var("GRUBADD")) {
# unless GRUB was also set, we need to get to the kernel line now
get_kernel_line unless (get_var("GRUB"));
type_string " ".get_var("GRUBADD");
}
# if variable REPOSITORY_VARIATION is set, construct inst.repo url and add it to kernel line
2015-02-04 13:45:37 +00:00
if (get_var("REPOSITORY_VARIATION")){
unless (get_var("GRUB") || get_var("GRUBADD")) {
get_kernel_line;
2015-02-04 13:45:37 +00:00
}
my $repourl = "";
# REPOSITORY_VARIATION should be set to repository URL without version and architecture
# appended (it will be appended automatically)
$repourl = get_var("REPOSITORY_VARIATION")."/".lc(get_var("VERSION"))."/Everything/".get_var("ARCH")."/os";
2015-02-04 13:45:37 +00:00
type_string " inst.repo=".$repourl;
2015-01-27 12:35:27 +00:00
}
# now we are on the correct "boot" menu item
# hit Ctrl+x for the case when the uefi kernel line was edited
send_key "ctrl-x";
# Return starts boot in all other cases
2015-02-04 13:05:20 +00:00
send_key "ret";
unless (get_var("KICKSTART"))
{
# on lives, we have to explicitly launch anaconda
if (get_var('LIVE')) {
assert_and_click "live_start_anaconda_icon", '', 300;
}
add a french (encrypted) test Summary: this handles Non-English European Language Install. Basically it's a bunch of new screenshots for existing tag names, plus a bit of configurability in _boot_to_anaconda and tweaking some existing needles to do non-text matches. The weird 'half-the- icon' needles are for cases where there may or may not be a warning triangle but we want to click it either way (saves duplicating the needle). This also sets up a convention for tagging what languages a needle is appropriate for. If it's specifically appropriate for one or more languages, a tag ENV-LANGUAGE-(LANGUAGE) should be applied for each language, where (LANGUAGE) is the install language in upper-case ('LANGUAGE' variable, which should also be the string that will be typed into the language selection screen). If the needle ought to be used for *all* languages - i.e. it's not a text match, or any text in the match is known not to be translated - the tag ENV-INSTLANG-ALL should be applied. To back this, main.pm now unregisters all needles that are not tagged with either ENV-LANGUAGE-ALL or the tag for the language actually being used (if the LANGUAGE var is not set, we assume english). The point of this is to check the install is actually translated; if we allow all needles to match, the test would pass even if no translations appeared at all. Test Plan: Run all tests and make sure you get the expected results. You can schedule a run against 23 Beta TC1 to see the French test fails 'correctly' when translations are missing. Reviewers: jskladan, garretraziel Reviewed By: garretraziel Subscribers: tflink Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D577
2015-09-15 01:08:58 +00:00
my $language = get_var('LANGUAGE') || 'english';
# wait for anaconda to appear
assert_screen "anaconda_select_install_lang", 300;
2015-01-27 12:35:27 +00:00
# Select install language
2015-02-20 09:30:23 +00:00
assert_and_click "anaconda_select_install_lang_input";
add a french (encrypted) test Summary: this handles Non-English European Language Install. Basically it's a bunch of new screenshots for existing tag names, plus a bit of configurability in _boot_to_anaconda and tweaking some existing needles to do non-text matches. The weird 'half-the- icon' needles are for cases where there may or may not be a warning triangle but we want to click it either way (saves duplicating the needle). This also sets up a convention for tagging what languages a needle is appropriate for. If it's specifically appropriate for one or more languages, a tag ENV-LANGUAGE-(LANGUAGE) should be applied for each language, where (LANGUAGE) is the install language in upper-case ('LANGUAGE' variable, which should also be the string that will be typed into the language selection screen). If the needle ought to be used for *all* languages - i.e. it's not a text match, or any text in the match is known not to be translated - the tag ENV-INSTLANG-ALL should be applied. To back this, main.pm now unregisters all needles that are not tagged with either ENV-LANGUAGE-ALL or the tag for the language actually being used (if the LANGUAGE var is not set, we assume english). The point of this is to check the install is actually translated; if we allow all needles to match, the test would pass even if no translations appeared at all. Test Plan: Run all tests and make sure you get the expected results. You can schedule a run against 23 Beta TC1 to see the French test fails 'correctly' when translations are missing. Reviewers: jskladan, garretraziel Reviewed By: garretraziel Subscribers: tflink Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D577
2015-09-15 01:08:58 +00:00
type_string "${language}";
# Needle filtering in main.pm ensures we will only look for the
# appropriate language, here
assert_and_click "anaconda_select_install_lang_filtered";
assert_screen "anaconda_select_install_lang_selected", 3;
2015-01-27 12:35:27 +00:00
assert_and_click "anaconda_select_install_lang_continue";
if ( check_screen "anaconda_rawhide_accept_fate" ) {
assert_and_click "anaconda_rawhide_accept_fate";
}
2015-01-30 09:35:13 +00:00
# wait for Anaconda hub to appear
2015-02-25 17:20:41 +00:00
assert_screen "anaconda_main_hub", 900; #
2015-01-27 12:35:27 +00:00
}
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 };
2015-01-26 14:58:07 +00:00
}
1;
# vim: set sw=4 et: