Branch Coverage

blib/lib/Device/PaloAlto/Firewall/Test.pm
Criterion Covered Total %
branch 0 148 0.0


line true false branch
77 0 0 unless defined $sysinfo
85 0 0 unless %{$sysinfo;}
89 0 0 unless (is_lax($args{'version'}))
94 0 0 unless (is_lax($sysinfo->{'sw-version'}))
99 0 0 if 'version'->parse($args{'version'}) > 'version'->parse($sysinfo->{'sw-version'})
121 0 0 unless defined $environ
124 0 0 unless (%{$environ;})
131 0 0 if &any(sub { lc $_->{'alarm'} ne 'false'; } , @{$slot;})
151 0 0 unless defined $licenses
153 0 0 unless @{$licenses;}
156 0 0 if $license->{'expired'} ne 'no'
188 0 0 unless (@{$args{'interfaces'};})
195 0 0 unless defined $fw_interfaces
198 0 0 if lc $_->{'name'} eq lc $test_interface
0 0 unless &any(sub { $_->{'state'} eq 'up' if lc $_->{'name'} eq lc $test_interface; } , @{$$fw_interfaces{'hw'}{'entry'};})
228 0 0 unless (@{$args{'interfaces'};})
235 0 0 unless defined $fw_interfaces
238 0 0 unless &any(sub { _half_duplex_search($test_interface, $_); } , @{$$fw_interfaces{'hw'}{'entry'};})
260 0 0 if lc $test_interface ne lc $fw_interface->{'name'}
262 0 0 if $fw_interface->{'state'} ne 'up'
264 0 0 if ($fw_interface->{'duplex'} eq 'auto')
269 0 0 if $fw_interface->{'duplex'} eq 'full'
304 0 0 if $_[0] > 0
312 0 0 unless defined $interface_counters
314 0 0 unless @{$interface_counters;}
320 0 0 if $interface->{'ipackets'} == 0 or $interface->{'opackets'} == 0
327 0 0 if $percent[0] >= $args{'percent'} or $percent[1] >= $args{'percent'}
361 0 0 unless (@{$args{'routes'};})
371 0 0 unless (grep {$route eq $_->{'destination'};} @{$routing_table;})
416 0 0 unless (grep {$peer_search eq (split(/:/u, $_->{'peer-address'}, 0))[0];} @up_peers)
457 0 0 unless $bgp_prefixes
459 0 0 unless @{$bgp_prefixes;}
463 0 0 unless &any(sub { $test_prefix eq $_->{'prefix'}; } , @{$bgp_prefixes;})
501 0 0 if $test_ospf_nbr eq $_->{'neighbor-address'}
502 0 0 unless &any(sub { lc $_->{'status'} eq 'full' if $test_ospf_nbr eq $_->{'neighbor-address'}; } , @{$ospf_neighbours;})
540 0 0 unless defined $pim_neighbours
542 0 0 unless @{$pim_neighbours;}
545 0 0 unless &any(sub { $test_pim_neighbour eq $_->{'Address'}; } , @{$pim_neighbours;})
583 0 0 unless $bfd_peers
585 0 0 unless @{$bfd_peers;}
590 0 0 if (defined $args{'interfaces'}) { }
594 0 0 unless $bfd_peer_ref
604 0 0 if grep {lc $_->{'state-local'} ne 'up';} @relevant_bfd_peers
623 0 0 if not defined $ntp_response->{'synched'} or $ntp_response->{'synched'} eq 'LOCAL'
643 0 0 unless defined $ntp_response->{'synched'}
647 0 0 unless keys %{$ntp_response;}
649 0 0 if &any(sub { $ntp_response->{$_}{'reachable'} ne 'yes'; } , keys %{$ntp_response;})
667 0 0 unless $panorama_status_ref
669 0 0 unless @{$panorama_status_ref;}
671 0 0 if &any(sub { lc $_->{'connected'} ne 'yes'; } , @{$panorama_status_ref;})
721 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
723 0 0 if lc $args{'state'} eq lc $ha_response->{'group'}{'local-info'}{'state'}
745 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
747 0 0 if &any(sub { lc $_ ne 'match'; } , @{$$ha_response{'group'}{'local-info'};}{@version_match_keys})
770 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
775 0 0 if lc $peer_info->{'conn-status'} ne 'up' and &any(sub { lc $_->{'conn-status'} ne 'up'; } , @{$peer_info;}{@ha_interface_keys})
794 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
796 0 0 if lc $ha_response->{'group'}{'running-sync-enabled'} ne 'yes' and lc $ha_response->{'group'}{'running-sync'} ne 'synchronized'
809 0 0 unless defined $enabled
810 0 0 if $enabled ne 'yes'
846 0 0 unless defined $mappings
851 0 0 if (defined $args{'domain'})
857 0 0 unless (defined $args{'users'})
858 0 0 unless grep {lc $_->{'type'} ne 'unknown';} @user_mappings
863 0 0 unless grep {$user eq $_->{'user'};} @user_mappings
894 0 0 unless defined $server_monitor
897 0 0 unless @{$server_monitor;}
900 0 0 unless (defined $args{'servers'})
901 0 0 if &any(sub { lc $_->{'connected'} ne 'connected'; } , @{$server_monitor;})
906 0 0 if not $server_state or lc $server_state->{'connected'} ne 'connected'
938 0 0 unless defined $vpn_tunnels
941 0 0 unless @{$vpn_tunnels;}
944 0 0 if $_->{'peerip'} eq $peer_ip
0 0 unless &any(sub { lc $_->{'state'} eq 'active' if $_->{'peerip'} eq $peer_ip; } , @{$vpn_tunnels;})