Check/Test/ns_vs_delegated.pm untested

filter: Statementstmt 0.0% 0 / 33 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 / 47 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::ns_vs_delegated;
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 if ( $self->{nsauth} ) {
34 my $nsauth = lc(join('|', sort @{$self->{nsauth} }));
35  
36 foreach my $nsquery ( @{$self->{nsquery}} ) {
37 my $nslist = lc(join('|', sort $nsquery->ns_list ));
38 my $ns_name = $nsquery->ns_name();
39
40 $test_detail->{$ns_name}->{desc} = "NS " . join(' ', sort $nsquery->ns_list );
41 if ($nsauth ne $nslist) {
42 $test_status = 0;
43 $test_detail->{$ns_name}->{status} = 0;
44 }
45 else {
46 $test_detail->{$ns_name}->{status} = 1;
47 }
48 }
49 } else {
50 # Error
51 }
52  
53  
54 $self->{test_status} = $test_status;
55 $self->{test_detail} = $test_detail;
56  
57 return $test_status;
58 }
59  
60 1;
61  
62 __END__