Skip to content

Commit

Permalink
Fix refreshment issue for iscsi_client
Browse files Browse the repository at this point in the history
  • Loading branch information
hjluo committed Jan 4, 2024
1 parent 1f2fcbb commit 0194fa0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
31 changes: 1 addition & 30 deletions lib/YaST/workarounds.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use Config::Tiny;
our @EXPORT = qw(
apply_workaround_poo124652
apply_workaround_bsc1206132
workaround_poo124652_for_send_key_until
);

=head1 Workarounds for known issues
Expand Down Expand Up @@ -46,6 +45,7 @@ sub apply_workaround_poo124652 {
check_screen('style-sheet-selection-popup', 10);
send_key('esc', wait_screen_change => 1);
# in some verification tests this didn't work, so let's check
wait_still_screen(2);
if (!check_screen($mustmatch)) {
record_info('Retry', "shift-f3 workaround did not solve the problem");
send_key('alt-f10', wait_screen_change => 1);
Expand Down Expand Up @@ -78,33 +78,4 @@ sub apply_workaround_bsc1206132 {
systemctl('daemon-reload');
}

=head2 workaround_poo124652_for_send_key_until ():
Workaround screen refresh issue for the send_key_until_needle_match
Records a soft failure with a reference to bsc#1206132
This is the wrapper for send_key_until_needle_match for applying
apply_workaround_bsc1206132.
=cut

sub workaround_poo124652_for_send_key_until {
my ($tag, $key, $counter, $timeout) = @_;

$counter //= 20;
$timeout //= 1;

my $real_timeout = 0;
while (!check_screen($tag, $real_timeout)) {
wait_screen_change {
send_key $key;
};
if (--$counter <= 0) {
apply_workaround_bsc1206132 $tag;
}
$real_timeout = $timeout;
}
}

1;
2 changes: 1 addition & 1 deletion lib/yast2_widget_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sub change_service_configuration_step {

send_key $shortcut;
send_key 'end';
workaround_poo124652_for_send_key_until $needle_selection, 'up', 6, 1;
send_key_until_needlematch $needle_selection, 'up', 6, 1;
if (check_var_array('EXTRATEST', 'y2uitest_ncurses')) {
send_key 'ret';
apply_workaround_poo124652($needle_check) if (is_sle('>=15-SP4'));
Expand Down
3 changes: 3 additions & 0 deletions tests/iscsi/iscsi_client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use Utils::Logging 'save_and_upload_log';
my $test_data = get_test_suite_data();

sub initiator_service_tab {
apply_workaround_poo124652('iscsi-client-service') if (is_sle('>=15-SP4'));
unless (is_sle('<15') || is_leap('<15.1')) {
if (is_sle('=15')) {
change_service_configuration(
Expand Down Expand Up @@ -70,6 +71,8 @@ sub initiator_discovered_targets_tab {
# next and press connect button
send_key "alt-n";
assert_and_click 'iscsi-initiator-connect-button';
wait_still_screen(2);
apply_workaround_poo124652('iscsi-initiator-discovery-startup') if (is_sle('>=15-SP4'));
send_key_until_needlematch 'iscsi-initiator-connect-automatic', 'down';
send_key 'alt-o';
assert_screen 'iscsi-initiator-discovery-enable-login-auth';
Expand Down

0 comments on commit 0194fa0

Please sign in to comment.