Skip to content

Commit

Permalink
Bump $count in calls to send_key_until_needlematch
Browse files Browse the repository at this point in the history
The function send_key_until_needlematch() had an off-by-one error.
This error has been fixed recently, so we need to increment +1 the
$count argument (3rd) in all test suite calling it.
  • Loading branch information
ilmanzo committed Aug 29, 2022
1 parent 26e2c4d commit 5bda96c
Show file tree
Hide file tree
Showing 104 changed files with 227 additions and 230 deletions.
4 changes: 2 additions & 2 deletions lib/Installation/Partitioner/FormattingOptionsPage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sub select_partition_id {
}
# poo#35134 Sporadic synchronization failure resulted in incorrect choice of partition type
# add partition screen was not refreshing fast enough
send_key_until_needlematch($partition_id_needle, 'up', 20, 5);
send_key_until_needlematch($partition_id_needle, 'up', 21, 5);
}

sub select_filesystem {
Expand All @@ -88,7 +88,7 @@ sub select_filesystem {
assert_screen(FORMATTING_OPTIONS_PAGE);
send_key($self->{filesystem_shortcut});
send_key 'end', wait_screen_change => 1;
send_key_until_needlematch((sprintf FILESYSTEM_TYPE, $filesystem), 'up', 20, 5);
send_key_until_needlematch((sprintf FILESYSTEM_TYPE, $filesystem), 'up', 21, 5);
}

# Mounting Options
Expand Down
2 changes: 1 addition & 1 deletion lib/YaST/NetworkSettings/NetworkCardSetup/BondSlavesTab.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sub select_tab {
sub select_bond_slave_in_list {
assert_screen(BOND_SLAVES_TAB);
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(BOND_SLAVE_DEVICE_CHECKBOX_UNCHECKED, 'alt-f10', 9, 2);
send_key_until_needlematch(BOND_SLAVE_DEVICE_CHECKBOX_UNCHECKED, 'alt-f10', 10, 2);
assert_and_click(BOND_SLAVE_DEVICE_CHECKBOX_UNCHECKED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sub select_tab {
sub select_bridged_device_in_list {
assert_screen(BRIDGED_DEVICES_TAB);
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(BRIDGED_DEVICE_CHECKBOX_UNCHECKED, 'alt-f10', 9, 2);
send_key_until_needlematch(BRIDGED_DEVICE_CHECKBOX_UNCHECKED, 'alt-f10', 10, 2);
assert_and_click(BRIDGED_DEVICE_CHECKBOX_UNCHECKED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sub select_device_type {
vlan => 'alt-v'
};
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(DEVICE_TYPE_DIALOG, 'alt-f10', 9, 2);
send_key_until_needlematch(DEVICE_TYPE_DIALOG, 'alt-f10', 10, 2);
send_key $shortcut->{$device};
}

Expand Down
10 changes: 5 additions & 5 deletions lib/YaST/NetworkSettings/OverviewTab.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ sub new {

sub press_add {
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 9, 2);
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 10, 2);
send_key('alt-a');
}

sub press_edit {
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 9, 2);
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 10, 2);
send_key('alt-i');
}

sub press_delete {
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 9, 2);
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 10, 2);
send_key('alt-t');
}

Expand All @@ -64,12 +64,12 @@ sub select_device {
else {
die "\"$device\" device is not known.";
}
send_key_until_needlematch $device_needle, 'down', 5;
send_key_until_needlematch $device_needle, 'down', 6;
}

sub press_ok {
record_soft_failure('bsc#1191112 - Resizing window as workaround for YaST content not loading');
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 9, 2);
send_key_until_needlematch(OVERVIEW_TAB, 'alt-f10', 10, 2);
send_key('alt-o');
}

Expand Down
10 changes: 5 additions & 5 deletions lib/apparmortest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ sub adminer_setup {
check_screen([qw(adminer-login unresponsive-script)], timeout => 300); # nocheck: old code, should be updated
}
if (match_has_tag("unresponsive-script")) {
send_key_until_needlematch("adminer-login", 'ret', 5, 5);
send_key_until_needlematch("adminer-login", 'ret', 6, 5);
}
elsif (match_has_tag("adminer-login")) {
record_info("Firefox is loading adminer", "adminer login page shows up");
Expand All @@ -583,16 +583,16 @@ sub adminer_setup {
$ret = check_screen("quit-and-close-tabs", timeout => 30);
if (defined($ret)) {
# Click the "quit and close tabs" button
send_key_until_needlematch("close-button-selected", 'tab', 5, 5);
send_key_until_needlematch("close-button-selected", 'tab', 6, 5);
send_key "ret";
}
wait_still_screen(stilltime => 3, timeout => 30);
# Exit xterm
if (is_tumbleweed()) {
send_key_until_needlematch("generic-desktop", 'alt-f4', 5, 5);
send_key_until_needlematch("generic-desktop", 'alt-f4', 6, 5);
}
# Send "ret" key in case of any pop up message
send_key_until_needlematch("generic-desktop", 'ret', 5, 5);
send_key_until_needlematch("generic-desktop", 'ret', 6, 5);
select_console("root-console");
send_key "ctrl-c";
clear_console;
Expand Down Expand Up @@ -631,7 +631,7 @@ sub adminer_database_delete {
assert_and_click("adminer-click-database-test");
assert_and_click("adminer-click-drop-database-test");
# Confirm drop
send_key_until_needlematch("adminer-database-dropped", 'ret', 10, 1);
send_key_until_needlematch("adminer-database-dropped", 'ret', 11, 1);
# Exit x11 and turn to console
send_key "alt-f4";
# Handle exceptions when "Quit and close tabs" in Firefox, the warning FYI:
Expand Down
2 changes: 1 addition & 1 deletion lib/bootloader_pvm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ sub prepare_pvm_installation {
}
# try 3 times but wait a long time in between - if we're too eager
# we end with ccc in the prompt
send_key_until_needlematch('pvm-grub-command-line', 'c', 3, 5);
send_key_until_needlematch('pvm-grub-command-line', 'c', 4, 5);

# clear the prompt (and create an error) in case the above went wrong
send_key 'ret';
Expand Down
46 changes: 23 additions & 23 deletions lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -283,21 +283,21 @@ sub boot_local_disk {
}

sub boot_into_snapshot {
send_key_until_needlematch('boot-menu-snapshot', 'down', 10, 5);
send_key_until_needlematch('boot-menu-snapshot', 'down', 11, 5);
send_key 'ret';
# assert needle to make sure grub2 page show up
assert_screen('grub2-page', 60);
# assert needle to avoid send down key early in grub_test_snapshot.
if (get_var('OFW') || is_pvm || check_var('SLE_PRODUCT', 'hpc')) {
send_key_until_needlematch('snap-default', 'down', 60, 5);
send_key_until_needlematch('snap-default', 'down', 61, 5);
}
# in upgrade/migration scenario, we want to boot from snapshot 1 before migration.
if ((get_var('UPGRADE') && !get_var('ONLINE_MIGRATION', 0)) || get_var('ZDUP')) {
send_key_until_needlematch('snap-before-update', 'down', 60, 5);
send_key_until_needlematch('snap-before-update', 'down', 61, 5);
save_screenshot;
}
# in an online migration
send_key_until_needlematch('snap-before-migration', 'down', 60, 5) if (get_var('ONLINE_MIGRATION'));
send_key_until_needlematch('snap-before-migration', 'down', 61, 5) if (get_var('ONLINE_MIGRATION'));
save_screenshot;
send_key 'ret';
# avoid timeout for booting to HDD
Expand All @@ -322,17 +322,17 @@ sub select_bootmenu_option {

if (get_var('UPGRADE')) {
# OFW has contralily oriented menu behavior
send_key_until_needlematch 'inst-onupgrade', get_var('OFW') ? 'up' : 'down', 10, 5;
send_key_until_needlematch 'inst-onupgrade', get_var('OFW') ? 'up' : 'down', 11, 5;
}
else {
if (get_var('PROMO') || get_var('LIVETEST') || get_var('LIVE_INSTALLATION') || get_var('LIVE_UPGRADE')) {
send_key_until_needlematch 'boot-live-' . get_var('DESKTOP'), 'down', 10, 5;
send_key_until_needlematch 'boot-live-' . get_var('DESKTOP'), 'down', 11, 5;
}
elsif (get_var('OFW')) {
send_key_until_needlematch 'inst-oninstallation', 'up', 10, 5;
send_key_until_needlematch 'inst-oninstallation', 'up', 11, 5;
}
elsif (!get_var('JEOS')) {
send_key_until_needlematch 'inst-oninstallation', 'down', 10, 5;
send_key_until_needlematch 'inst-oninstallation', 'down', 11, 5;
}
}
return 0;
Expand All @@ -359,9 +359,9 @@ sub get_bootmenu_console_params {
sub uefi_bootmenu_params {
# assume bios+grub+anim already waited in start.sh
# in grub2 it's tricky to set the screen resolution
#send_key_until_needlematch('grub2-enter-edit-mode', 'e', 5, 0.5);
#send_key_until_needlematch('grub2-enter-edit-mode', 'e', 6, 0.5);
(is_jeos)
? send_key_until_needlematch('grub2-enter-edit-mode', 'e', 5, 0.5)
? send_key_until_needlematch('grub2-enter-edit-mode', 'e', 6, 0.5)
: send_key 'e';
# Kiwi in TW uses grub2-mkconfig instead of the custom kiwi config
# Locate gfxpayload parameter and update it
Expand Down Expand Up @@ -634,10 +634,10 @@ sub select_bootmenu_more {

# after installation-images 14.210 added a submenu
if ($more && check_screen 'inst-submenu-more', 0) {
send_key_until_needlematch('inst-onmore', get_var('OFW') ? 'up' : 'down', 10, 5);
send_key_until_needlematch('inst-onmore', get_var('OFW') ? 'up' : 'down', 11, 5);
send_key "ret";
}
send_key_until_needlematch($tag, get_var('OFW') ? 'up' : 'down', 10, 3);
send_key_until_needlematch($tag, get_var('OFW') ? 'up' : 'down', 11, 3);
# Redirect linuxrc logs to console when booting from menu: "boot linux system"
push @params, get_linuxrc_boot_params if get_var('LINUXRC_BOOT');
# Make sure to use the correct repo for testing
Expand Down Expand Up @@ -823,7 +823,7 @@ sub remote_install_bootmenu_params {
sub select_bootmenu_video_mode {
if (check_var("VIDEOMODE", "text")) {
send_key "f3";
send_key_until_needlematch("inst-textselected", "up", 5);
send_key_until_needlematch("inst-textselected", "up", 6);
send_key "ret";
if (match_has_tag("inst-textselected-with_colormenu")) {
# The video mode menu was enhanced to support various color profiles
Expand Down Expand Up @@ -945,11 +945,11 @@ sub tianocore_disable_secureboot {
enter_cmd "exit";
assert_screen 'tianocore-mainmenu';
# Select 'Boot manager' entry
send_key_until_needlematch('tianocore-devicemanager', 'down', 5, 5);
send_key_until_needlematch('tianocore-devicemanager', 'down', 6, 5);
send_key 'ret';
send_key_until_needlematch('tianocore-devicemanager-sb-conf', 'down', 5, 5);
send_key_until_needlematch('tianocore-devicemanager-sb-conf', 'down', 6, 5);
send_key 'ret';
send_key_until_needlematch($neelle_sb_conf_attempt, 'down', 5, 5);
send_key_until_needlematch($neelle_sb_conf_attempt, 'down', 6, 5);
send_key 'spc';
assert_screen 'tianocore-devicemanager-sb-conf-changed';
send_key 'ret';
Expand Down Expand Up @@ -992,25 +992,25 @@ sub tianocore_select_bootloader {
tianocore_enter_menu;
tianocore_ensure_xga_resolution if check_var('QEMUVGA', 'qxl');
tianocore_enter_menu;
send_key_until_needlematch('tianocore-bootmanager', 'down', 5, 5);
send_key_until_needlematch('tianocore-bootmanager', 'down', 6, 5);
send_key 'ret';
}

sub tianocore_http_boot {
tianocore_enter_menu;
# Go to Device manager
send_key_until_needlematch('tianocore-devicemanager', 'down', 5, 5);
send_key_until_needlematch('tianocore-devicemanager', 'down', 6, 5);
send_key 'ret';
# In device manager, go to 'Network Device List'
send_key_until_needlematch('tianocore-devicemanager-networkdevicelist', 'up', 5, 5);
send_key_until_needlematch('tianocore-devicemanager-networkdevicelist', 'up', 6, 5);
send_key 'ret';
# In 'Network Device List', go to first MAC addr
send_key 'ret';
# Go to 'HTTP Boot Configuration'
send_key_until_needlematch('tianocore-devicemanager-networkdevicelist-mac-httpbootconfig', 'up', 5, 5);
send_key_until_needlematch('tianocore-devicemanager-networkdevicelist-mac-httpbootconfig', 'up', 6, 5);
send_key 'ret';
# Select 'Boot URI'
send_key_until_needlematch('tianocore-devicemanager-networkdevicelist-mac-httpbootconfig-booturi', 'up', 5, 5);
send_key_until_needlematch('tianocore-devicemanager-networkdevicelist-mac-httpbootconfig-booturi', 'up', 6, 5);
send_key 'ret';
# Enter URI (full URI to EFI file)
my $arch = get_var("ARCH");
Expand Down Expand Up @@ -1041,10 +1041,10 @@ sub tianocore_http_boot {
send_key 'esc';
send_key 'esc';
# Select 'Boot manager' entry
send_key_until_needlematch('tianocore-bootmanager', 'down', 5, 5);
send_key_until_needlematch('tianocore-bootmanager', 'down', 6, 5);
send_key 'ret';
# Select 'UEFI Http' entry
send_key_until_needlematch('tianocore-bootmanager-uefihttp', 'up', 5, 5);
send_key_until_needlematch('tianocore-bootmanager-uefihttp', 'up', 6, 5);
send_key 'ret';
}

Expand Down
4 changes: 2 additions & 2 deletions lib/grub_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sub grub_test {
assert_screen('grub2', $timeout);
stop_grub_timeout;
boot_into_snapshot if get_var("BOOT_TO_SNAPSHOT");
send_key_until_needlematch("bootmenu-xen-kernel", 'down', 10, 5) if get_var('XEN');
send_key_until_needlematch("bootmenu-xen-kernel", 'down', 11, 5) if get_var('XEN');
if ((is_aarch64 && is_sle && get_var('PLYMOUTH_DEBUG'))
|| get_var('GRUB_KERNEL_OPTION_APPEND'))
{
Expand Down Expand Up @@ -78,7 +78,7 @@ sub bug_workaround_bsc1005313 {
record_soft_failure "Running with plymouth:debug to catch bsc#1005313" if get_var('PLYMOUTH_DEBUG');
send_key 'e';
# Move to end of kernel boot parameters line
send_key_until_needlematch "linux-line-selected", "down", 25;
send_key_until_needlematch "linux-line-selected", "down", 26;
send_key "end";

assert_screen "linux-line-matched";
Expand Down
2 changes: 1 addition & 1 deletion lib/microos.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sub microos_login {
# FreeRDP is not sending 'Ctrl' as part of 'Ctrl-Alt-Fx', 'Alt-Fx' is fine though.
my $key = check_var('VIRSH_VMM_FAMILY', 'hyperv') ? 'alt-f2' : 'ctrl-alt-f2';
# First attempts to select tty2 are ignored - bsc#1035968
send_key_until_needlematch 'tty2-selected', $key, 10, 30;
send_key_until_needlematch 'tty2-selected', $key, 11, 30;
}

select_console 'root-console';
Expand Down
6 changes: 3 additions & 3 deletions lib/opensusebasetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ sub handle_uefi_boot_disk_workaround {
my ($self) = @_;
record_info 'workaround', 'Manually selecting boot entry, see bsc#1022064 for details';
tianocore_enter_menu;
send_key_until_needlematch 'tianocore-boot_maintenance_manager', 'down', 5, 5;
send_key_until_needlematch 'tianocore-boot_maintenance_manager', 'down', 6, 5;
wait_screen_change { send_key 'ret' };
send_key_until_needlematch 'tianocore-boot_from_file', 'down';
wait_screen_change { send_key 'ret' };
Expand Down Expand Up @@ -764,7 +764,7 @@ sub wait_grub {
elsif (get_var("LIVETEST")) {
# prevent if one day booting livesystem is not the first entry of the boot list
if (!match_has_tag("boot-live-" . get_var("DESKTOP"))) {
send_key_until_needlematch("boot-live-" . get_var("DESKTOP"), 'down', 10, 5);
send_key_until_needlematch("boot-live-" . get_var("DESKTOP"), 'down', 11, 5);
}
}
elsif (match_has_tag('inst-bootmenu')) {
Expand Down Expand Up @@ -802,7 +802,7 @@ sub wait_grub_to_boot_on_local_disk {
type_string "exit";
wait_screen_change { send_key 'ret' };
tianocore_select_bootloader;
send_key_until_needlematch("ovmf-boot-HDD", 'down', 5, 1);
send_key_until_needlematch("ovmf-boot-HDD", 'down', 6, 1);
send_key "ret";
return;
}
Expand Down
12 changes: 6 additions & 6 deletions lib/partition_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ sub resize_partition {
if (is_storage_ng_newui) {
send_key 'alt-m';
# start with preconfigured partitions
send_key_until_needlematch 'modify-partition-resize', 'down', 5, 3;
send_key_until_needlematch 'modify-partition-resize', 'down', 6, 3;
send_key 'ret';
}
else {
Expand Down Expand Up @@ -268,7 +268,7 @@ sub addpart {
send_key((is_storage_ng) ? 'alt-f' : 'alt-s');
wait_screen_change { send_key 'home' }; # start from the top of the list
assert_screen(((is_storage_ng) ? 'partition-selected-ext2-type' : 'partition-selected-btrfs-type'), timeout => 10);
send_key_until_needlematch "partition-selected-$args{format}-type", 'down', 10, 5;
send_key_until_needlematch "partition-selected-$args{format}-type", 'down', 11, 5;
}
}
# Enable snapshots option works only with btrfs
Expand All @@ -284,7 +284,7 @@ sub addpart {
record_soft_failure('bsc#1079399 - Combobox is writable');
for (1 .. 10) { send_key 'up'; }
}
send_key_until_needlematch "partition-selected-$args{fsid}-type", 'down', 10, 5;
send_key_until_needlematch "partition-selected-$args{fsid}-type", 'down', 11, 5;
}

mount_device $args{mount} if $args{mount};
Expand Down Expand Up @@ -546,15 +546,15 @@ sub take_first_disk_storage_ng {
send_key 'tab';
}
save_screenshot;
send_key_until_needlematch 'after-partitioning', $cmd{next}, 10, 3;
send_key_until_needlematch 'after-partitioning', $cmd{next}, 11, 3;
return;
}

send_key $cmd{next};
assert_screen 'partition-scheme';
}
elsif (is_ipmi) {
send_key_until_needlematch 'after-partitioning', $cmd{next}, 10, 3;
send_key_until_needlematch 'after-partitioning', $cmd{next}, 11, 3;
return;
}

Expand All @@ -564,7 +564,7 @@ sub take_first_disk_storage_ng {
if (check_var('VIDEOMODE', 'text')) {
assert_screen 'select-root-filesystem';
send_key 'alt-f';
send_key_until_needlematch 'filesystem-btrfs', 'down', 10, 3;
send_key_until_needlematch 'filesystem-btrfs', 'down', 11, 3;
send_key 'ret';
}
else {
Expand Down
2 changes: 1 addition & 1 deletion lib/power_action_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ sub reboot_x11 {
assert_and_click('reboot-power-menu');
assert_and_click('reboot-click-restart');
} else {
send_key_until_needlematch 'logoutdialog', 'ctrl-alt-delete', 7, 10; # reboot
send_key_until_needlematch 'logoutdialog', 'ctrl-alt-delete', 8, 10; # reboot
}
my $repetitions = assert_and_click_until_screen_change 'logoutdialog-reboot-highlighted';
record_soft_failure 'poo#19082' if ($repetitions > 0);
Expand Down
2 changes: 1 addition & 1 deletion lib/qam.pm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ sub advance_installer_window {
}
unless (check_screen "$screenName", 60) {
my $key = check_screen('cannot-access-installation-media') ? "alt-y" : "$cmd{next}";
send_key_until_needlematch $screenName, $key, 5, 60;
send_key_until_needlematch $screenName, $key, 6, 60;
record_soft_failure 'Retry most probably due to network problems poo#52319 or failed next click';
}
}
Expand Down
Loading

0 comments on commit 5bda96c

Please sign in to comment.