Check/Test/soa_master_in_ns.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 48 CC 5 SCAR 24.8
CC
5
Cov
0%
test
20.0
new
6.0
BEGIN
2.0
CRAP 12.0
1 package Net::DNS::Check::Test::soa_master_in_ns;
2  
3 use strict;
4 use vars qw(@ISA $VERSION);
5  
6 @ISA = qw(Net::DNS::Check::Test);
7  
8  
9 sub new {
10 my ($class) = shift;
11  
12 my ($self) = bless {}, $class;
13  
14 if ( @_ ) {
15 $self->_process_args(@_);
16 }
17  
18 $self->test();
19  
20 return $self;
21 }
22  
23  
24 sub test()
25 {
26 my ($self) = shift;
27  
28 return unless ( $self->{nsauth} );
29  
30 my $test_status = 1;
31 my $test_detail = {};
32  
33 foreach my $nsquery ( @{$self->{nsquery}} ) {
34 my $found = 0;
35 my $ns_name = $nsquery->ns_name();
36 foreach my $ns ( $nsquery->ns_list() ) {
37 if ( $nsquery->soa_mname() eq $ns ) {
38 $found = 1;
39 last;
40 }
41 }
42  
43 $test_detail->{$ns_name}->{desc} = $nsquery->soa_mname() . " (NS " . join(' ', sort $nsquery->ns_list ) . ")";
44  
45 if ( $found ) {
46 $test_detail->{$ns_name}->{status} = 1;
47 } else {
48 $test_status = 0;
49 $test_detail->{$ns_name}->{status} = 0;
50 }
51 }
52  
53 $self->{test_status} = $test_status;
54 $self->{test_detail} = $test_detail;
55  
56 return $test_status;
57 }
58  
59 1;
60  
61 __END__