Skip to content

Commit

Permalink
Remove unused $self from launch_yast2_module_x11
Browse files Browse the repository at this point in the history
The function expected to accept $self as a first parameter, though it
was not used anywhere inside the function and not needed as this
function does not share any data with the package which the function
belongs to.

The commit removes this $self and changes all the usage occurrences in
the project to also not use $self while calling the function.
  • Loading branch information
Oleksandr Orlov committed Mar 15, 2021
1 parent 88faea8 commit 7a646cd
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lib/y2_module_guitest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ C<$maximize_window> option allows to maximize application window using shortcut.
=cut
sub launch_yast2_module_x11 {
my ($self, $module, %args) = @_;
my ($module, %args) = @_;
$module //= '';
$args{target_match} //= $module ? "yast2-$module-ui" : 'yast2-ui';
my @tags = ['root-auth-dialog', ref $args{target_match} eq 'ARRAY' ? @{$args{target_match}} : $args{target_match}];
Expand Down
2 changes: 1 addition & 1 deletion tests/installation/addon_products_via_SCC_yast2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sub run {
my ($self) = @_;

test_setup;
$self->launch_yast2_module_x11('scc', target_match => [qw(scc-registration packagekit-warning)], maximize_window => 1);
launch_yast2_module_x11('scc', target_match => [qw(scc-registration packagekit-warning)], maximize_window => 1);
if (match_has_tag 'packagekit-warning') {
send_key 'alt-y';
assert_screen 'scc-registration';
Expand Down
2 changes: 1 addition & 1 deletion tests/installation/addon_products_yast2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sub run {
my ($addon, $uc_addon);
my $perform_reboot;
test_setup;
$self->launch_yast2_module_x11('add-on', target_match => [qw(addon-products packagekit-warning)]);
launch_yast2_module_x11('add-on', target_match => [qw(addon-products packagekit-warning)]);
if (match_has_tag 'packagekit-warning') {
send_key 'alt-y';
assert_screen 'addon-products';
Expand Down
2 changes: 1 addition & 1 deletion tests/iscsi/iscsi_client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ sub run {
prepare_xterm_and_setup_static_network(ip => $test_data->{initiator_conf}->{ip}, message => 'Configure MM network - client');
mutex_wait('iscsi_target_ready', undef, 'Target configuration in progress!');
record_info 'Target Ready!', 'iSCSI target is configured, start initiator configuration';
my $module_name = $self->launch_yast2_module_x11('iscsi-client', target_match => 'iscsi-client');
my $module_name = launch_yast2_module_x11('iscsi-client', target_match => 'iscsi-client');
initiator_service_tab;
initiator_discovered_targets_tab;
initiator_connected_targets_tab;
Expand Down
2 changes: 1 addition & 1 deletion tests/iscsi/iscsi_server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ sub run {
display_targets(expected => qq('no open sessions'));
# start yast2 wizard
record_info 'iSCSI target', 'Start target configuration';
my $module_name = $self->launch_yast2_module_x11('iscsi-lio-server', target_match => 'iscsi-lio-server');
my $module_name = launch_yast2_module_x11('iscsi-lio-server', target_match => 'iscsi-lio-server');
target_service_tab;
target_backstore_tab;
wait_serial("$module_name-0", 180) || die "'yast2 iscsi-lio-server' didn't finish or exited with non-zero code";
Expand Down
2 changes: 1 addition & 1 deletion tests/security/apparmor_profile/usr_sbin_smbd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub samba_server_setup {
systemctl("restart smb");

select_console 'x11';
y2_module_guitest::launch_yast2_module_x11(module => "samba-server", target_match => "samba-server-installation", match_timeout => 200);
launch_yast2_module_x11(module => "samba-server", target_match => "samba-server-installation", match_timeout => 200);

send_key "alt-w";
send_key "ctrl-a";
Expand Down
2 changes: 1 addition & 1 deletion tests/virtualization/yast_virtualization.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sub run {
record_soft_failure 'bsc#1083398 - YaST2-virtualization provides wrong components for SLED';
zypper_call 'in yast2-vm';
}
$self->launch_yast2_module_x11('virtualization');
launch_yast2_module_x11('virtualization');
# select everything
if (check_var('ARCH', 'x86_64')) {
send_key 'alt-x'; # XEN Server, only available on x86_64: bsc#1088175
Expand Down
2 changes: 1 addition & 1 deletion tests/x11/network/yast2_network_use_nm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sub run {

sub configure_system {
# we have to change the networkmanager form wicked to NetworkManager
y2_module_guitest::launch_yast2_module_x11 module => 'lan';
launch_yast2_module_x11 module => 'lan';
assert_screen 'yast2_control-center_network-opened';

# switch to 'Global options'
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_bootloader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use utils 'type_string_slow_extended';
sub run {
my $self = shift;
select_console 'x11';
$self->launch_yast2_module_x11('bootloader', match_timeout => 120);
launch_yast2_module_x11('bootloader', match_timeout => 120);

# boot code options
assert_and_click 'yast2-bootloader_grub2';
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_control_center.pm
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ sub run {
record_soft_failure('bsc#1182241', "yast2-vpn is not pre-installed on TW");
ensure_installed('yast2-vpn yast2-sudo yast2-tune yast2-kdump');
}
$self->launch_yast2_module_x11('', target_match => 'yast2-control-center-ui', match_timeout => 180);
launch_yast2_module_x11('', target_match => 'yast2-control-center-ui', match_timeout => 180);

start_addon_products;
start_media_check;
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_datetime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use testapi;
sub run {
my $self = shift;
select_console 'x11';
$self->launch_yast2_module_x11('timezone', target_match => [qw(yast2-datetime-ui yast2-datetime_ntp-conf require_install_chrony)], match_timeout => 90);
launch_yast2_module_x11('timezone', target_match => [qw(yast2-datetime-ui yast2-datetime_ntp-conf require_install_chrony)], match_timeout => 90);
if (match_has_tag 'yast2-datetime_ntp-conf') {
send_key 'alt-d';
send_key 'alt-o';
Expand Down
8 changes: 4 additions & 4 deletions tests/yast2_gui/yast2_firewall.pm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sub verify_service_stopped {

record_info('Start-Up', "Managing the firewalld service: Stop");
select_console 'x11', await_console => 0;
$self->launch_yast2_module_x11('firewall', target_match => 'firewall-start-page');
launch_yast2_module_x11('firewall', target_match => 'firewall-start-page');
assert_screen 'yast2_firewall_start-up';
change_service_configuration(after_writing => {stop => 'alt-t'});
wait_screen_change { send_key $cmd{accept} };
Expand All @@ -93,7 +93,7 @@ sub verify_service_started {

record_info('Start-Up', "Managing the firewalld service: Start");
select_console 'x11', await_console => 0;
$self->launch_yast2_module_x11('firewall', target_match => 'firewall-start-page');
launch_yast2_module_x11('firewall', target_match => 'firewall-start-page');
assert_screen 'yast2_firewall_start-up';
change_service_configuration(after_writing => {start => 'alt-t'});
wait_screen_change { send_key $cmd{accept} };
Expand Down Expand Up @@ -165,7 +165,7 @@ sub configure_firewalld {
my $iface = iface;

select_console 'x11', await_console => 0;
$self->launch_yast2_module_x11('firewall', target_match => 'firewall-start-page');
launch_yast2_module_x11('firewall', target_match => 'firewall-start-page');

verify_interface(device => $iface, zone => 'default');
verify_zone(name => 'public', interfaces => $iface, default => 'default');
Expand Down Expand Up @@ -208,7 +208,7 @@ sub run {
select_console 'root-console';
zypper_call('in yast2-http-server apache2 apache2-prefork', timeout => 1200);
select_console 'x11', await_console => 0;
$self->launch_yast2_module_x11('firewall', match_timeout => 60);
launch_yast2_module_x11('firewall', match_timeout => 60);
susefirewall2;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_hostnames.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sub run {
script_run "echo '80.92.65.53 n-tv.de ntv' >> /etc/hosts";
clear_console;
select_console 'x11';
$self->launch_yast2_module_x11($module, match_timeout => 90);
launch_yast2_module_x11($module, match_timeout => 90);
assert_and_click "yast2_hostnames_added";
send_key 'alt-i';
assert_screen 'yast2_hostnames_edit_popup';
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_instserver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ sub test_http_instserver {

sub start_yast2_instserver {
my $self = shift;
$self->launch_yast2_module_x11("instserver", match_timeout => 120);
launch_yast2_module_x11("instserver", match_timeout => 120);
wait_still_screen;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_keyboard.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sub run {
my $accept_keybind = is_sle("<=15-SP1") ? "alt-o" : "alt-a";

# 1. start yast2 keyboard
$self->launch_yast2_module_x11("keyboard", match_timeout => 120);
launch_yast2_module_x11("keyboard", match_timeout => 120);
send_key "alt-k";
wait_still_screen 1;
send_key "g";
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_lang.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use testapi;
sub run {
my $self = shift;
select_console 'x11';
$self->launch_yast2_module_x11('language', match_timeout => 240);
launch_yast2_module_x11('language', match_timeout => 240);

# check language details and change detailed locale setting
assert_and_click 'yast2-lang_details';
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_network_settings.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sub run {
$cmd{routing_tab} = 'alt-u';

select_console 'x11';
$self->launch_yast2_module_x11('lan', target_match => [qw(yast2-lan-ui yast2_still_susefirewall2 yast2-lan-warning-network-manager)], match_timeout => 120);
launch_yast2_module_x11('lan', target_match => [qw(yast2-lan-ui yast2_still_susefirewall2 yast2-lan-warning-network-manager)], match_timeout => 120);
if (match_has_tag 'yast2_still_susefirewall2') {
send_key $cmd{install};
wait_still_screen;
Expand Down
8 changes: 4 additions & 4 deletions tests/yast2_gui/yast2_security.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sub run {
select_console "x11";

# Password Settings
$self->launch_yast2_module_x11("security", match_timeout => 120);
launch_yast2_module_x11("security", match_timeout => 120);
assert_and_click "yast2_security-pwd-settings";
send_key "alt-m";
wait_still_screen 1;
Expand All @@ -42,7 +42,7 @@ sub run {
wait_screen_change { send_key "alt-o" };

# Check previously set values + Login Settings
$self->launch_yast2_module_x11("security", match_timeout => 120);
launch_yast2_module_x11("security", match_timeout => 120);
assert_and_click "yast2_security-pwd-settings";
assert_screen "yast2_security-check-min-pwd-len-and-exp-days";
assert_and_click "yast2_security-login-settings";
Expand All @@ -52,7 +52,7 @@ sub run {
wait_screen_change { send_key "alt-o" };

# Check previously set values + Miscellaneous Settings
$self->launch_yast2_module_x11("security", match_timeout => 120);
launch_yast2_module_x11("security", match_timeout => 120);
assert_and_click "yast2_security-login-settings";
assert_screen "yast2_security-login-attempts";
# set file permissions to 'secure'
Expand All @@ -62,7 +62,7 @@ sub run {
wait_screen_change { send_key "alt-o" };

# Check previously set values
$self->launch_yast2_module_x11("security", match_timeout => 120);
launch_yast2_module_x11("security", match_timeout => 120);
assert_and_click "yast2_security-misc-settings";
assert_screen "yast2_security-file-perms-secure";
wait_screen_change { send_key "alt-o" };
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_software_management.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use testapi;
sub run {
my $self = shift;
select_console 'x11';
$self->launch_yast2_module_x11('sw_single', match_timeout => 100);
launch_yast2_module_x11('sw_single', match_timeout => 100);
# Accept => Exit, or get to the installation report
send_key 'alt-a';
# Installation may take some time
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_storage_ng.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ sub select_vdb {

sub start_y2sn {
my $self = shift;
$self->launch_yast2_module_x11("storage", match_timeout => 120);
launch_yast2_module_x11("storage", match_timeout => 120);

wait_screen_change { send_key "alt-y" };
wait_still_screen 5;
Expand Down
2 changes: 1 addition & 1 deletion tests/yast2_gui/yast2_users.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use testapi;
sub run {
my $self = shift;
select_console 'x11';
$self->launch_yast2_module_x11('users', match_timeout => 100);
launch_yast2_module_x11('users', match_timeout => 100);
send_key "alt-o"; # OK => Exit
}

Expand Down

0 comments on commit 7a646cd

Please sign in to comment.