Branch Coverage

blib/lib/Device/PaloAlto/Firewall/Test.pm
Criterion Covered Total %
branch 0 142 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'})
119 0 0 unless defined $environ
122 0 0 unless (%{$environ;})
129 0 0 if &any(sub { lc $_->{'alarm'} ne 'false'; } , @{$slot;})
165 0 0 unless (@{$args{'interfaces'};})
172 0 0 unless defined $fw_interfaces
175 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'};})
205 0 0 unless (@{$args{'interfaces'};})
212 0 0 unless defined $fw_interfaces
215 0 0 unless &any(sub { _half_duplex_search($test_interface, $_); } , @{$$fw_interfaces{'hw'}{'entry'};})
237 0 0 if lc $test_interface ne lc $fw_interface->{'name'}
239 0 0 if $fw_interface->{'state'} ne 'up'
241 0 0 if ($fw_interface->{'duplex'} eq 'auto')
246 0 0 if $fw_interface->{'duplex'} eq 'full'
281 0 0 if $_[0] > 0
289 0 0 unless defined $interface_counters
291 0 0 unless @{$interface_counters;}
297 0 0 if $interface->{'ipackets'} == 0 or $interface->{'opackets'} == 0
304 0 0 if $percent[0] >= $args{'percent'} or $percent[1] >= $args{'percent'}
338 0 0 unless (@{$args{'routes'};})
348 0 0 unless (grep {$route eq $_->{'destination'};} @{$routing_table;})
393 0 0 unless (grep {$peer_search eq (split(/:/u, $_->{'peer-address'}, 0))[0];} @up_peers)
434 0 0 unless $bgp_prefixes
436 0 0 unless @{$bgp_prefixes;}
440 0 0 unless &any(sub { $test_prefix eq $_->{'prefix'}; } , @{$bgp_prefixes;})
478 0 0 if $test_ospf_nbr eq $_->{'neighbor-address'}
479 0 0 unless &any(sub { lc $_->{'status'} eq 'full' if $test_ospf_nbr eq $_->{'neighbor-address'}; } , @{$ospf_neighbours;})
517 0 0 unless defined $pim_neighbours
519 0 0 unless @{$pim_neighbours;}
522 0 0 unless &any(sub { $test_pim_neighbour eq $_->{'Address'}; } , @{$pim_neighbours;})
560 0 0 unless $bfd_peers
562 0 0 unless @{$bfd_peers;}
567 0 0 if (defined $args{'interfaces'}) { }
571 0 0 unless $bfd_peer_ref
581 0 0 if grep {lc $_->{'state-local'} ne 'up';} @relevant_bfd_peers
600 0 0 if not defined $ntp_response->{'synched'} or $ntp_response->{'synched'} eq 'LOCAL'
620 0 0 unless defined $ntp_response->{'synched'}
624 0 0 unless keys %{$ntp_response;}
626 0 0 if &any(sub { $ntp_response->{$_}{'reachable'} ne 'yes'; } , keys %{$ntp_response;})
644 0 0 unless $panorama_status_ref
646 0 0 unless @{$panorama_status_ref;}
648 0 0 if &any(sub { lc $_->{'connected'} ne 'yes'; } , @{$panorama_status_ref;})
698 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
700 0 0 if lc $args{'state'} eq lc $ha_response->{'group'}{'local-info'}{'state'}
722 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
724 0 0 if &any(sub { lc $_ ne 'match'; } , @{$$ha_response{'group'}{'local-info'};}{@version_match_keys})
747 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
752 0 0 if lc $peer_info->{'conn-status'} ne 'up' and &any(sub { lc $_->{'conn-status'} ne 'up'; } , @{$peer_info;}{@ha_interface_keys})
771 0 0 unless $self->_check_ha_enabled($ha_response->{'enabled'})
773 0 0 if lc $ha_response->{'group'}{'running-sync-enabled'} ne 'yes' and lc $ha_response->{'group'}{'running-sync'} ne 'synchronized'
786 0 0 unless defined $enabled
787 0 0 if $enabled ne 'yes'
822 0 0 unless defined $mappings
827 0 0 if (defined $args{'domain'})
833 0 0 unless (defined $args{'users'})
834 0 0 unless grep {lc $_->{'type'} ne 'unknown';} @user_mappings
839 0 0 unless grep {$user eq $_->{'user'};} @user_mappings
870 0 0 unless defined $server_monitor
873 0 0 unless @{$server_monitor;}
876 0 0 unless (defined $args{'servers'})
877 0 0 if &any(sub { lc $_->{'connected'} ne 'connected'; } , @{$server_monitor;})
882 0 0 if not $server_state or lc $server_state->{'connected'} ne 'connected'
914 0 0 unless defined $vpn_tunnels
917 0 0 unless @{$vpn_tunnels;}
920 0 0 if $_->{'peerip'} eq $peer_ip
0 0 unless &any(sub { lc $_->{'state'} eq 'active' if $_->{'peerip'} eq $peer_ip; } , @{$vpn_tunnels;})