Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions lib/Zonemaster/Engine/Test/Address.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ use Zonemaster::Engine::Constants qw[:addresses :ip];
use Zonemaster::Engine::TestMethods;
use Zonemaster::Engine::Util;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Address' ); }

=head1 NAME

Zonemaster::Engine::Test::Address - Module implementing tests focused on IP addresses of name servers
Expand Down Expand Up @@ -194,11 +192,32 @@ sub version {
return "$Zonemaster::Engine::Test::Address::VERSION";
}

=head1 INTERNAL METHODS

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: specify that the entry is defined with the Address testcase value or something like that so that it is clear that this internal method is different in each module.


=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Address' ); }

=over

=item find_special_address()
=item _find_special_address()

my $hash_ref = find_special_address( $ip );
my $hash_ref = _find_special_address( $ip );

Verifies if an IP address is a special (private, reserved, ...) one.

Expand All @@ -210,7 +229,7 @@ Returns a reference to a hash if true (see L<Zonemaster::Engine::Constants/_extr

=cut

sub find_special_address {
sub _find_special_address {
my ( $class, $ip ) = @_;
my @special_addresses;

Expand Down Expand Up @@ -261,7 +280,7 @@ sub address01 {

next if $ips{ $local_ns->address->short };

my $ip_details_ref = $class->find_special_address( $local_ns->address );
my $ip_details_ref = $class->_find_special_address( $local_ns->address );

if ( $ip_details_ref ) {
push @results,
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Basic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Zonemaster::Engine::Test::Syntax;
use Zonemaster::Engine::TestMethods;
use Zonemaster::Engine::Util;

sub _emit_log { Zonemaster::Engine->logger->add( @_, 'Basic' ) }

=head1 NAME

Zonemaster::Engine::Test::Basic - Module implementing tests focused on basic zone functionality
Expand Down Expand Up @@ -372,6 +370,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Basic' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Connectivity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Zonemaster::Engine::Constants qw[:ip];
use Zonemaster::Engine::TestMethods;
use Zonemaster::Engine::Util;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Connectivity' ); }

=head1 NAME

Zonemaster::Engine::Test::Connectivity - Module implementing tests focused on name servers reachability
Expand Down Expand Up @@ -412,6 +410,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Connectivity' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Consistency.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Zonemaster::Engine::Test::Address;
use Zonemaster::Engine::Util;
use Zonemaster::Engine::TestMethods;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Consistency' ); }

=head1 NAME

Zonemaster::Engine::Test::Consistency - Module implementing tests focused on name servers responses consistency
Expand Down Expand Up @@ -353,6 +351,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Consistency' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/DNSSEC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Zonemaster::Engine::Constants qw[:algo :soa :ip];
use Zonemaster::Engine::Util;
use Zonemaster::Engine::TestMethods;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'DNSSEC' ); }

=head1 NAME

Zonemaster::Engine::Test::DNSSEC - Module implementing tests focused on DNSSEC
Expand Down Expand Up @@ -1469,6 +1467,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'DNSSEC' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Delegation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use Zonemaster::Engine::Util;
use Zonemaster::LDNS::Packet;
use Zonemaster::LDNS::RR;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Delegation' ); }

=head1 NAME

Zonemaster::Engine::Test::Delegation - Module implementing tests focused on zone delegation
Expand Down Expand Up @@ -420,6 +418,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Delegation' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Nameserver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Zonemaster::Engine::Test::Address;
use Zonemaster::Engine::Util;
use Zonemaster::Engine::TestMethods;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Nameserver' ); }

=head1 NAME

Zonemaster::Engine::Test::Nameserver - Module implementing tests focused on the properties of a name server
Expand Down Expand Up @@ -583,6 +581,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Nameserver' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Syntax.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ use Zonemaster::Engine::TestMethods;
use Zonemaster::Engine::Util;
use Zonemaster::LDNS;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Syntax' ); }

=head1 NAME

Zonemaster::Engine::Test::Syntax - Module implementing tests focused on validating the syntax of host names and other data
Expand Down Expand Up @@ -397,6 +395,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Syntax' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_array );
Expand Down
21 changes: 19 additions & 2 deletions lib/Zonemaster/Engine/Test/Zone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ use Zonemaster::Engine::Test::Address;
use Zonemaster::Engine::TestMethods;
use Zonemaster::Engine::Util;

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Zone' ); }

=head1 NAME

Zonemaster::Engine::Test::Zone - Module implementing tests focused on the DNS zone content, such as SOA and MX records
Expand Down Expand Up @@ -500,6 +498,25 @@ sub version {

=over

=item _emit_log()

my $log_entry = _emit_log( $message_tag_string, $hash_ref );

Adds a message to the L<logger|Zonemaster::Engine::Logger> for this module.
See L<Zonemaster::Engine::Logger::Entry/add($tag, $argref, $module, $testcase)> for more details.

Takes a string (message tag) and a reference to a hash (arguments).

Returns a L<Zonemaster::Engine::Logger::Entry> object.

=back

=cut

sub _emit_log { my ( $tag, $argref ) = @_; return Zonemaster::Engine->logger->add( $tag, $argref, 'Zone' ); }

=over

=item _ip_disabled_message()

my $bool = _ip_disabled_message( $logentry_array_ref, $ns, @query_type_string );
Expand Down
Loading