-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use libyu api for yast2 lan dhcp hostname setting
The commit rewrites yast2_lan_hostname tests to use libyui-rest-api. Also the test cases are separated for the cases when 'no', 'yes: any' and 'yes: eth0' are set for hostname via DHCP. Related ticket: https://progress.opensuse.org/issues/89209
- Loading branch information
Oleksandr Orlov
committed
Mar 12, 2021
1 parent
cddbcb0
commit cd23eb0
Showing
21 changed files
with
539 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2021 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: The class introduces methods that are common for all YaST modules. | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package YaST::Module; | ||
use strict; | ||
use warnings; | ||
use testapi; | ||
use YuiRestClient; | ||
use y2_module_guitest qw(launch_yast2_module_x11); | ||
use y2_module_consoletest qw(yast2_console_exec); | ||
|
||
sub open { | ||
my ($args) = @_; | ||
my $module = $args->{module}; | ||
my $ui = $args->{ui}; | ||
die 'No module name specified.' unless defined $module; | ||
die 'No user interface specified.' unless defined $ui; | ||
if (lc($ui) eq 'ncurses') { | ||
y2_module_consoletest::yast2_console_exec( | ||
yast2_module => $module, | ||
yast2_opts => '--ncurses', | ||
extra_vars => get_var('YUI_PARAMS') | ||
); | ||
} | ||
elsif (lc($ui) eq 'qt') { | ||
launch_yast2_module_x11('', $module, extra_vars => get_var('YUI_PARAMS')); | ||
} | ||
else { | ||
die "Unknown user interface: $ui"; | ||
} | ||
YuiRestClient::connect_to_app_running_system(); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2021 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: The class introduces all accessing methods cction buttons in yast2 lan YaST module. | ||
# The buttons in the bottom of the screen that are available across all the pages (e.g. "Next", "Cancel"); | ||
# This is a part of a screen and it has to be included in Network Settings Controller. | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package YaST::NetworkSettings::ActionButtons; | ||
use strict; | ||
use warnings; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless { | ||
app => $args->{app} | ||
}, $class; | ||
return $self->init(); | ||
} | ||
|
||
sub init { | ||
my $self = shift; | ||
$self->{btn_ok} = $self->{app}->button({id => 'next'}); | ||
return $self; | ||
} | ||
|
||
sub press_ok { | ||
my ($self) = @_; | ||
$self->{btn_ok}->click(); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2021 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: The class introduces all accessing methods for Hostname/DNS Tab in YaST2 | ||
# lan module dialog. | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package YaST::NetworkSettings::HostnameDNSTab; | ||
use strict; | ||
use warnings; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless { | ||
app => $args->{app} | ||
}, $class; | ||
return $self->init(); | ||
} | ||
|
||
sub init { | ||
my $self = shift; | ||
$self->{cb_set_hostname_via_dhcp} = $self->{app}->combobox({id => '"DHCP_HOSTNAME"'}); | ||
return $self; | ||
} | ||
|
||
sub select_option_in_hostname_via_dhcp { | ||
my ($self, $option) = @_; | ||
$self->{cb_set_hostname_via_dhcp}->select($option); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2021 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: The class introduces all accessing methods Top Navigation Bar in yast2 lan YaST module. | ||
# This is a part of a screen and it has to be included in Network Settings Controller. | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package YaST::NetworkSettings::TopNavigationBar; | ||
use strict; | ||
use warnings; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless { | ||
app => $args->{app} | ||
}, $class; | ||
return $self->init(); | ||
} | ||
|
||
sub init { | ||
my $self = shift; | ||
$self->{menu_bar} = $self->{app}->menucollection({id => '_cwm_tab'}); | ||
return $self; | ||
} | ||
|
||
sub select_hostname_dns_tab { | ||
my ($self) = @_; | ||
$self->{menu_bar}->select('Ho&stname/DNS'); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2021 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: The class introduces methods in Expert Partitioner to handle | ||
# a Warning Dialog. | ||
# Maintainer: QE YaST <qa-sle-yast@suse.de> | ||
|
||
package YaST::Warning::Notification; | ||
use strict; | ||
use warnings; | ||
|
||
sub new { | ||
my ($class, $args) = @_; | ||
my $self = bless { | ||
app => $args->{app} | ||
}, $class; | ||
return $self->init(); | ||
} | ||
|
||
sub init { | ||
my $self = shift; | ||
$self->{btn_ok} = $self->{app}->button({id => 'ok_msg'}); | ||
$self->{lbl_header} = $self->{app}->label({label => 'Warning'}); | ||
$self->{lbl_warning} = $self->{app}->label({type => 'YLabel'}); | ||
return $self; | ||
} | ||
|
||
sub confirm { | ||
my ($self) = @_; | ||
YuiRestClient::Wait::wait_until(object => sub { | ||
$self->is_shown(); | ||
}); | ||
$self->press_ok(); | ||
} | ||
|
||
sub press_ok { | ||
my ($self) = @_; | ||
$self->{btn_ok}->click(); | ||
} | ||
|
||
sub is_shown { | ||
my ($self) = @_; | ||
$self->{lbl_header}->exist(); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.