Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce nested limit checks #7519

Merged
merged 1 commit into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .perlcriticrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ severity = 5

[Perl::Critic::Policy::ConsistentQuoteLikeWords]
severity = 5

[ControlStructures::ProhibitDeepNests]
severity = 4
add_themes = freenode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch here, according to documentation, add_themes makes more sense than set_themes even we could see same output.

max_nests = 4
30 changes: 17 additions & 13 deletions lib/registration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ sub verify_preselected_modules {
die 'Scroll reached to bottom not finding individual needles for each module.' if @needles;
}

sub _yast_scc_addons_handler {
if (match_has_tag('yast_scc-license-dialog')) {
send_key 'alt-a';
next;
}
# yast may pop up dependencies or reboot prompt window
if (match_has_tag('yast_scc-automatic-changes') or match_has_tag('unsupported-packages') or match_has_tag('yast_scc-prompt-reboot')) {
wait_screen_change { send_key "alt-o" };
next;
}
if (match_has_tag('yast_scc-installation-summary')) {
send_key 'alt-f';
last;
}
}

sub process_scc_register_addons {
# The value of SCC_ADDONS is a list of abbreviation of addons/modules
# Following are abbreviations defined for modules and some addons
Expand Down Expand Up @@ -353,19 +369,7 @@ sub process_scc_register_addons {
['yast_scc-license-dialog', 'yast_scc-automatic-changes', 'yast_scc-prompt-reboot', 'yast_scc-installation-summary'], 1800
))
{
if (match_has_tag('yast_scc-license-dialog')) {
send_key 'alt-a';
next;
}
# yast may pop up dependencies or reboot prompt window
if (match_has_tag('yast_scc-automatic-changes') or match_has_tag('unsupported-packages') or match_has_tag('yast_scc-prompt-reboot')) {
wait_screen_change { send_key "alt-o" };
next;
}
if (match_has_tag('yast_scc-installation-summary')) {
send_key 'alt-f';
last;
}
_yast_scc_addons_handler();
}
last;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/migration/sle12_online_migration/yast2_migration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ sub run {
last if match_has_tag 'addon-yast2-patterns';
if (match_has_tag 'package-conflict-resolution') {
wait_screen_change { send_key 'alt-1' };
if (!check_screen 'radio-button-selected', 0) {
if (!check_screen 'radio-button-selected', 0) { ## no critic (ProhibitDeepNests)
wait_screen_change { send_key 'spc' };
}
wait_screen_change { send_key 'alt-o' };
Expand Down
2 changes: 1 addition & 1 deletion tests/slenkins/slenkins_control.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sub run {
for my $network (split /\s*,\s*/, $networks) {
if ($net_conf->{$network}->{dhcp}) {
for my $ip (@{$dhcp_leases{lc($node)}}) {
if (check_ip_in_subnet($net_conf->{$network}, $ip)) {
if (check_ip_in_subnet($net_conf->{$network}, $ip)) { ## no critic (ProhibitDeepNests)
push @external_ip, $ip;
push @internal_ip, $ip;
last;
Expand Down