Skip to content

Commit

Permalink
Add new ServiceWidget to Leap
Browse files Browse the repository at this point in the history
  • Loading branch information
jknphy committed Aug 24, 2018
1 parent 1fb8d23 commit 8efb517
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
17 changes: 16 additions & 1 deletion lib/console_yasttest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,24 @@
package console_yasttest;
use base 'y2logsstep';
use strict;

use testapi;

sub assert_service_widget {
my ($self, %args) = @_;
my $after_writing_conf = $args{after_writing_conf} || 'alt-f';
my $after_reboot = $args{after_reboot} || 'alt-a';

assert_screen 'yast2_ncurses_service_start_widget';
send_key $after_writing_conf;
send_key_until_needlematch 'yast2_ncurses_service_start_widget_start_after_conf', 'up';
send_key 'ret';
assert_screen 'yast2_ncurses_service_start_widget_check_start_after_conf';
send_key $after_reboot;
send_key_until_needlematch 'yast2_ncurses_service_start_widget_start_on_boot', 'up';
send_key 'ret';
assert_screen 'yast2_ncurses_service_start_widget_check_start_on_boot';
}

sub post_fail_hook {
my $self = shift;

Expand Down
18 changes: 5 additions & 13 deletions tests/console/yast2_http.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use utils 'zypper_call';
use version_utils qw(is_sle is_leap);

sub run {
my $self = shift;

select_console 'root-console';
# install http server
Expand Down Expand Up @@ -102,25 +103,17 @@ sub run {
assert_screen 'http_vitual_host_page'; # check wizard page (4/5)
send_key 'alt-n'; # go to http server wizard (5/5) --summary
# make sure that apache2 server got started when booting
if ((is_sle '<15') || (is_leap)) {
if (is_sle('<15') || is_leap('<15.1')) {
assert_screen 'http_summary';
send_key 'alt-t';
assert_screen 'http_start_apache2';
}
else {
assert_screen 'yast2_ncurses_service_start_widget';
send_key 'alt-t';
send_key_until_needlematch 'yast2_ncurses_service_start_widget_start_after_conf', 'up';
send_key 'ret';
assert_screen 'yast2_ncurses_service_start_widget_check_start_after_conf';
send_key 'alt-a';
send_key_until_needlematch 'yast2_ncurses_service_start_widget_start_on_boot', 'up';
send_key 'ret';
assert_screen 'yast2_ncurses_service_start_widget_check_start_on_boot';
$self->assert_service_widget(after_writing_conf => 'alt-w', after_reboot => 'alt-e');
}
send_key 'alt-f'; # now finish the tests :)
send_key 'alt-f'; # now finish the tests :)
check_screen 'http_install_apache2_mods', 60;
send_key 'alt-i'; # confirm to install apache2_mod_perl, apache2_mod_php, apache2_mod_python
send_key 'alt-i'; # confirm to install apache2_mod_perl, apache2_mod_php, apache2_mod_python

# if popup, confirm to enable apache2 configuratuion
if (check_screen('http_enable_apache2', 10)) {
Expand All @@ -129,4 +122,3 @@ sub run {
wait_serial("yast2-http-server-status-0", 240) || die "'yast2 http-server' didn't finish";
}
1;

18 changes: 6 additions & 12 deletions tests/console/yast2_proxy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use testapi;
use utils;
use version_utils qw(is_sle is_leap);


my %sub_menu_needles = (
start_up => 'yast2_proxy_start-up',
http_ports => 'yast2_proxy_http_ports_selected',
Expand Down Expand Up @@ -60,6 +59,8 @@ sub post_fail_hook {
}

sub run {
my $self = shift;

select_console 'root-console';
if (is_sle '15+') {
zypper_call('in squid');
Expand All @@ -84,19 +85,11 @@ sub run {
}

# enable service start
if ((is_sle '<15') || (is_leap)) {
if (is_sle('<15') || is_leap('<15.1')) {
send_key_until_needlematch 'yast2_proxy_service_start', 'alt-b'; #Start service when booting
}
else {
assert_screen 'yast2_ncurses_service_start_widget';
send_key 'alt-f';
send_key_until_needlematch 'yast2_ncurses_service_start_widget_start_after_conf', 'up';
send_key 'ret';
assert_screen 'yast2_ncurses_service_start_widget_check_start_after_conf';
send_key 'alt-a';
send_key_until_needlematch 'yast2_ncurses_service_start_widget_start_on_boot', 'up';
send_key 'ret';
assert_screen 'yast2_ncurses_service_start_widget_check_start_on_boot';
$self->assert_service_widget;
}

# if firewall is enabled, then send_key alt-p, else move to page http ports
Expand Down Expand Up @@ -280,7 +273,7 @@ sub run {
assert_screen 'yast2_proxy_squid';
wait_still_screen 1;

if ((is_sle '<15') || (is_leap)) {
if (is_sle('<15') || is_leap('<15.1')) {
# now save settings and start squid server
send_key 'alt-s';
# check again before to close configuration
Expand All @@ -298,4 +291,5 @@ sub run {
script_run 'systemctl show -p ActiveState squid.service|grep ActiveState=active';
systemctl 'show -p SubState squid.service|grep SubState=running';
}

1;

0 comments on commit 8efb517

Please sign in to comment.