Branch Coverage

blib/lib/Zonemaster/Engine/Test/Nameserver.pm
Criterion Covered Total %
branch 96 168 57.1


line true false branch
25 1 3 if ('Zonemaster::Engine'->config->should_run('nameserver01'))
28 1 3 if ('Zonemaster::Engine'->config->should_run('nameserver02'))
31 2 2 if ('Zonemaster::Engine'->config->should_run('nameserver03'))
34 2 2 if ('Zonemaster::Engine'->config->should_run('nameserver04'))
37 2 2 if ('Zonemaster::Engine'->config->should_run('nameserver05'))
40 1 3 if ('Zonemaster::Engine'->config->should_run('nameserver06'))
43 1 3 if ('Zonemaster::Engine'->config->should_run('nameserver07'))
46 1 3 if ('Zonemaster::Engine'->config->should_run('nameserver08'))
49 0 3 if ('Zonemaster::Engine'->config->should_run('nameserver09'))
193 0 172 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
195 0 172 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
197 72 100 if $ips{$local_ns->address->short}
201 100 0 if ($p)
202 26 74 if ($p->rcode eq 'REFUSED') { }
0 74 elsif ($p->rcode eq 'SERVFAIL') { }
0 74 elsif ($p->rcode eq 'NXDOMAIN' and not $p->aa) { }
0 74 elsif ($p->is_redirect and not $p->aa) { }
0 148 elsif (not $p->is_redirect || $p->aa || $p->answer and $p->rcode eq 'NOERROR') { }
232 3 4 if ($ips_string and $ips_string eq $is_not_recursor_string) { }
4 0 elsif (not grep({$_->tag eq 'IS_A_RECURSOR';} @results)) { }
243 0 16 if $tld eq $zone->name
250 0 264 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
252 0 264 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
254 94 170 if $ips{$local_ns->address->short}
256 0 170 if $is_not_recursor{$local_ns->address->short}
260 170 0 if ($p)
261 0 170 if ($p->rcode eq 'REFUSED') { }
0 170 elsif ($p->rcode eq 'SERVFAIL') { }
0 170 elsif ($p->rcode eq 'NXDOMAIN' and not $p->aa) { }
58 112 elsif ($p->is_redirect and not $p->aa) { }
0 224 elsif (not $p->is_redirect || $p->aa || $p->answer and $p->rcode eq 'NOERROR') { }
290 2 14 if ($ips_string and $ips_string eq $is_not_recursor_string)
300 0 14 if (grep {$_->tag eq 'IS_A_RECURSOR';} @results)
305 2 2 unless (grep {$_->tag eq 'IS_A_RECURSOR';} @results or grep {$_->tag eq 'NO_RECURSOR';} @results)
325 0 20 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
327 0 20 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
329 10 10 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
332 10 0 if ($p)
333 0 10 if ($p->rcode eq 'FORMERR') { }
343 1 9 unless ($p->has_edns)
358 2 1 if (scalar keys %nsnames_and_ip and not scalar @results)
379 0 32 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
381 0 32 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
383 16 16 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
389 16 0 unless (eval { do { $local_ns->axfr($zone->name, sub { ($first_rr) = @_; return 0; } ); 1 } })
399 0 16 if ($first_rr and $first_rr->type eq 'SOA')
424 0 36 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
426 0 36 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
428 18 18 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
431 18 0 if ($p)
432 0 18 if ($p->answerfrom and $local_ns->address->short ne 'Zonemaster::Engine::Net::IP'->new($p->answerfrom)->short)
446 3 0 if (scalar keys %nsnames_and_ip and not scalar @results)
468 18 18 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
470 0 18 if (not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6)
482 0 18 if (not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4)
498 0 18 unless ($p)
509 0 18 if not scalar $p->answer and $p->rcode eq 'NOERROR'
511 0 18 if ($p->rcode eq 'FORMERR' or $p->rcode eq 'SERVFAIL' or $p->rcode eq 'NXDOMAIN' or $p->rcode eq 'NOTIMPL')
529 3 0 if (scalar keys %nsnames_and_ip and &none(sub { $_->tag eq 'ANSWER_BAD_RCODE'; } , @results))
555 1 3 if (scalar @all_nsnames_without_ip and scalar @all_nsnames_with_ip) { }
1 2 elsif (not scalar @all_nsnames_with_ip) { }
584 2 1 if ($zone->name eq '.') { }
591 0 12 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
593 0 12 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
595 6 6 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
598 6 0 if ($p)
601 0 6 if (@ns)
615 1 0 if (scalar keys %nsnames_and_ip and not scalar @results)
644 0 1 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
646 0 1 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
648 0 1 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
652 0 0 if ($p and my($qrr) = $p->question)
655 0 0 if ($qrr_name eq $randomized_uc_name) { }
705 0 0 if not 'Zonemaster::Engine'->config->ipv6_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_6
707 0 0 if not 'Zonemaster::Engine'->config->ipv4_ok and $local_ns->address->version == $Zonemaster::Engine::Test::Nameserver::IP_VERSION_4
709 0 0 if $nsnames_and_ip{$local_ns->name->string . '/' . $local_ns->address->short}
717 0 0 if ($p1 and scalar $p1->answer) { }
0 0 elsif ($p1 and $p2) { }
0 0 elsif ($p1 or $p2) { }
722 0 0 if ($p2 and scalar $p2->answer)
728 0 0 if ($answer1_string eq $answer2_string) { }
757 0 0 if ($p1->rcode eq $p2->rcode) { }
789 0 0 $p1 ? :
803 0 0 if ($all_results_match) { }