Skip to content

Commit

Permalink
Merge pull request #1395 from matsduf/new-unittests-delegation01
Browse files Browse the repository at this point in the history
New unit tests for Delegation01, -02 and -03, and legacy tests are removed
  • Loading branch information
matsduf authored Nov 27, 2024
2 parents 67ec9b1 + 513eb0d commit 67959ea
Show file tree
Hide file tree
Showing 48 changed files with 627 additions and 2,582 deletions.
46 changes: 6 additions & 40 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -171,46 +171,12 @@ t/Test-consistency06.data
t/Test-consistency06.t
t/Test-delegation.data
t/Test-delegation.t
t/Test-delegation01-A.data
t/Test-delegation01-A.t
t/Test-delegation01-B.data
t/Test-delegation01-B.t
t/Test-delegation01-C.data
t/Test-delegation01-C.t
t/Test-delegation01-D.data
t/Test-delegation01-D.t
t/Test-delegation01-E.data
t/Test-delegation01-E.t
t/Test-delegation01-F.data
t/Test-delegation01-F.t
t/Test-delegation01-G.data
t/Test-delegation01-G.t
t/Test-delegation01-H.data
t/Test-delegation01-H.t
t/Test-delegation01-I.data
t/Test-delegation01-I.t
t/Test-delegation01-J.data
t/Test-delegation01-J.t
t/Test-delegation01-K.data
t/Test-delegation01-K.t
t/Test-delegation01-L.data
t/Test-delegation01-L.t
t/Test-delegation01-M.data
t/Test-delegation01-M.t
t/Test-delegation02-A.data
t/Test-delegation02-A.t
t/Test-delegation02-B.data
t/Test-delegation02-B.t
t/Test-delegation02-C.data
t/Test-delegation02-C.t
t/Test-delegation02-D.data
t/Test-delegation02-D.t
t/Test-delegation03-A.data
t/Test-delegation03-A.t
t/Test-delegation03-B.data
t/Test-delegation03-B.t
t/Test-delegation03-C.data
t/Test-delegation03-C.t
t/Test-delegation01.data
t/Test-delegation01.t
t/Test-delegation02.data
t/Test-delegation02.t
t/Test-delegation03.data
t/Test-delegation03.t
t/Test-dnssec-more.data
t/Test-dnssec-more.t
t/Test-dnssec.data
Expand Down
40 changes: 0 additions & 40 deletions t/Test-delegation.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,16 @@ my %res;

my $iis = Zonemaster::Engine->zone( q{iis.se} );
%res = map { $_->tag => $_ } Zonemaster::Engine::Test::Delegation->all( $iis );
ok( $res{ENOUGH_NS_CHILD}, q{ENOUGH_NS_CHILD} );
ok( $res{ENOUGH_NS_DEL}, q{ENOUGH_NS_DEL} );
ok( $res{NAMES_MATCH}, q{NAMES_MATCH} );
ok( $res{REFERRAL_SIZE_OK}, q{REFERRAL_SIZE_OK} );

%res = map { $_->tag => 1 } Zonemaster::Engine->test_module( q{delegation}, q{crystone.se} );
ok( $res{SAME_IP_ADDRESS}, q{SAME_IP_ADDRESS} );
ok( $res{EXTRA_NAME_PARENT}, q{EXTRA_NAME_PARENT} );
ok( $res{EXTRA_NAME_CHILD}, q{EXTRA_NAME_CHILD} );
ok( $res{TOTAL_NAME_MISMATCH}, q{TOTAL_NAME_MISMATCH} );
ok( !$res{DISTINCT_IP_ADDRESS}, q{No DISTINCT_IP_ADDRESS} );
ok( $res{NO_NS_CNAME}, q{NO_NS_CNAME} );
ok( $res{SOA_EXISTS}, q{SOA_EXISTS} );
ok( $res{ARE_AUTHORITATIVE}, q{ARE_AUTHORITATIVE} );

%res = map { $_->tag => 1 } Zonemaster::Engine->test_module( q{delegation}, q{delegation02.zut-root.rd.nic.fr} );
ok( $res{NOT_ENOUGH_NS_CHILD}, q{NOT_ENOUGH_NS_CHILD} );
ok( $res{NOT_ENOUGH_NS_DEL}, q{NOT_ENOUGH_NS_DEL} );

%res = map { $_->tag => 1 } Zonemaster::Engine->test_module( q{delegation}, q{woli.se} );
ok( $res{SOA_NOT_EXISTS}, q{SOA_NOT_EXISTS} );

Expand All @@ -56,7 +47,6 @@ TODO: {

ok( $res{NS_IS_CNAME}, q{NS_IS_CNAME} );

ok( $res{REFERRAL_SIZE_LARGE}, q{REFERRAL_SIZE_LARGE} );
}

if ( $ENV{ZONEMASTER_RECORD} ) {
Expand All @@ -75,36 +65,6 @@ ok( ( any { $_->tag eq 'NO_NETWORK' } @res ), 'IPv6 and IPv4 disabled' );
ok( ( none { $_->tag eq 'IPV6_DISABLED' } @res ), 'No network' );
ok( ( none { $_->tag eq 'IPV4_DISABLED' } @res ), 'No network' );

#Zonemaster::Engine::Profile->effective->set( q{net.ipv4}, 1 );
#Zonemaster::Engine::Profile->effective->set( q{net.ipv6}, 0 );
#@res = Zonemaster::Engine->test_method( 'Delegation', 'delegation04', Zonemaster::Engine->zone( q{iis.se} ) );
#ok( ( any { $_->tag eq 'IPV6_DISABLED' } @res ), 'IPv6 disabled' );
#ok( ( none { $_->tag eq 'IPV4_DISABLED' } @res ), 'IPv4 not disabled' );
#@res = Zonemaster::Engine->test_method( 'Delegation', 'delegation06', Zonemaster::Engine->zone( q{iis.se} ) );
#ok( ( any { $_->tag eq 'IPV6_DISABLED' } @res ), 'IPv6 disabled' );
#ok( ( none { $_->tag eq 'IPV4_DISABLED' } @res ), 'IPv4 not disabled' );
#
#if ( Zonemaster::Engine::Util::supports_ipv6() ) {
#
# Zonemaster::Engine::Profile->effective->set( q{net.ipv6}, 1 );
# Zonemaster::Engine::Profile->effective->set( q{net.ipv4}, 0 );
# @res = Zonemaster::Engine->test_method( 'Delegation', 'delegation04', Zonemaster::Engine->zone( q{iis.se} ) );
# ok( ( none { $_->tag eq 'IPV6_DISABLED' } @res ), 'IPv6 not disabled' );
# ok( ( any { $_->tag eq 'IPV4_DISABLED' } @res ), 'IPv4 disabled' );
# @res = Zonemaster::Engine->test_method( 'Delegation', 'delegation06', Zonemaster::Engine->zone( q{iis.se} ) );
# ok( ( none { $_->tag eq 'IPV6_DISABLED' } @res ), 'IPv6 not disabled' );
# ok( ( any { $_->tag eq 'IPV4_DISABLED' } @res ), 'IPv4 disabled' );
#
# Zonemaster::Engine::Profile->effective->set( q{net.ipv4}, 1 );
# Zonemaster::Engine::Profile->effective->set( q{net.ipv6}, 1 );
# @res = Zonemaster::Engine->test_method( 'Delegation', 'delegation04', Zonemaster::Engine->zone( q{iis.se} ) );
# ok( ( none { $_->tag eq 'IPV6_DISABLED' } @res ), 'IPv6 not disabled' );
# ok( ( none { $_->tag eq 'IPV4_DISABLED' } @res ), 'IPv4 not disabled' );
# @res = Zonemaster::Engine->test_method( 'Delegation', 'delegation06', Zonemaster::Engine->zone( q{iis.se} ) );
# ok( ( none { $_->tag eq 'IPV6_DISABLED' } @res ), 'IPv6 not disabled' );
# ok( ( none { $_->tag eq 'IPV4_DISABLED' } @res ), 'IPv4 not disabled' );
#
#}

Zonemaster::Engine::Profile->effective->set( q{no_network}, 1 );

Expand Down
Loading

0 comments on commit 67959ea

Please sign in to comment.