Check/Test/soa_serial_compare.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 40 CC 3 SCAR 15.4
CC
3
Cov
0%
new
6.0
test
6.0
BEGIN
2.0
CRAP 4.7
1 package Net::DNS::Check::Test::soa_serial_compare;
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 my ($self) = shift;
26  
27 # return unless ( $self->{config} );
28  
29 my $test_status = 1;
30 my %compare_hash;
31 my $test_detail = {};
32  
33 foreach my $nsquery ( @{$self->{nsquery}} ) {
34 my $soa_serial = $nsquery->soa_serial();
35 my $ns_name = $nsquery->ns_name();
36 $compare_hash{$soa_serial}++;
37 $test_detail->{$ns_name}->{desc} = $soa_serial;
38 }
39  
40
41 if ((scalar keys %compare_hash) > 1) {
42 $test_status = 0;
43 }
44  
45 $self->{test_status} = $test_status;
46 $self->{test_detail} = $test_detail;
47  
48 return $test_status;
49 }
50  
51 1;
52  
53 __END__