-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delegation02 delegation checks #400
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ if ( not $ENV{ZONEMASTER_RECORD} ) { | |
} | ||
|
||
Zonemaster::Engine->add_fake_delegation( | ||
'a.delegation02.exempelvis.se.' => { | ||
'a.delegation02.exempelvis.se' => { | ||
'ns1.a.delegation02.exempelvis.se' => [ '46.21.97.97', '2a02:750:12:77::97' ], | ||
'ns2.a.delegation02.exempelvis.se' => [ '37.123.169.91', '2001:9b0:1:1c13::53' ], | ||
}, | ||
|
@@ -25,7 +25,9 @@ my $zone = Zonemaster::Engine->zone( q{a.delegation02.exempelvis.se} ); | |
|
||
my %res = map { $_->tag => $_ } Zonemaster::Engine::Test::Delegation->delegation02( $zone ); | ||
|
||
ok( !$res{DEL_NS_SAME_IP}, q{should not emit DEL_NS_SAME_IP} ); | ||
ok( !$res{CHILD_NS_SAME_IP}, q{should not emit CHILD_NS_SAME_IP} ); | ||
ok( $res{DEL_DISTINCT_NS_IP}, q{should emit DEL_DISTINCE_NS_IP} ); | ||
ok( $res{CHILD_DISTINCT_NS_IP}, q{should emit CHILD_DISTINCE_NS_IP} ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "should emit CHILD_DISTINCE_NS_IP" => "should emit CHILD_DISTINCT_NS_IP" |
||
|
||
if ( $ENV{ZONEMASTER_RECORD} ) { | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use Test::More; | ||
|
||
BEGIN { | ||
use_ok( q{Zonemaster::Engine} ); | ||
use_ok( q{Zonemaster::Engine::Test::Delegation} ); | ||
use_ok( q{Zonemaster::Engine::Util} ); | ||
} | ||
|
||
my $datafile = q{t/Test-delegation02-B.data}; | ||
|
||
if ( not $ENV{ZONEMASTER_RECORD} ) { | ||
die q{Stored data file missing} if not -r $datafile; | ||
Zonemaster::Engine::Nameserver->restore( $datafile ); | ||
Zonemaster::Engine->config->no_network( 1 ); | ||
} | ||
|
||
Zonemaster::Engine->add_fake_delegation( | ||
'b.delegation02.exempelvis.se' => { | ||
'ns1.b.delegation02.exempelvis.se' => [ '46.21.97.97', '2a02:750:12:77::97' ], | ||
'ns2.b.delegation02.exempelvis.se' => [ '46.21.97.97', '2a02:750:12:77::97' ], | ||
}, | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add that as undelegated instead of letting Zonemaster pick live data up? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mostly because it reflects our use case. I guess it's not necessary. However, doing that is what unveiled the trailing dots problem. |
||
|
||
my $zone = Zonemaster::Engine->zone( q{b.delegation02.exempelvis.se} ); | ||
|
||
my %res = map { $_->tag => $_ } Zonemaster::Engine::Test::Delegation->delegation02( $zone ); | ||
|
||
ok( $res{DEL_NS_SAME_IP}, q{should emit DEL_NS_SAME_IP} ); | ||
ok( !$res{CHILD_NS_SAME_IP}, q{should not emit CHILD_NS_SAME_IP} ); | ||
ok( !$res{DEL_DISTINCT_NS_IP}, q{should not emit DEL_DISTINCE_NS_IP} ); | ||
ok( $res{CHILD_DISTINCT_NS_IP}, q{should emit CHILD_DISTINCE_NS_IP} ); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "should emit CHILD_DISTINCE_NS_IP" => "should emit CHILD_DISTINCT_NS_IP" |
||
if ( $ENV{ZONEMASTER_RECORD} ) { | ||
Zonemaster::Engine::Nameserver->save( $datafile ); | ||
} | ||
|
||
done_testing; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ if ( not $ENV{ZONEMASTER_RECORD} ) { | |
} | ||
|
||
Zonemaster::Engine->add_fake_delegation( | ||
'c.delegation02.exempelvis.se.' => { | ||
'c.delegation02.exempelvis.se' => { | ||
'ns1.c.delegation02.exempelvis.se' => [ '46.21.97.97', '2a02:750:12:77::97' ], | ||
'ns2.c.delegation02.exempelvis.se' => [ '37.123.169.91', '2001:9b0:1:1c13::53' ], | ||
}, | ||
|
@@ -26,7 +26,9 @@ my $zone = Zonemaster::Engine->zone( q{c.delegation02.exempelvis.se} ); | |
|
||
my %res = map { $_->tag => $_ } Zonemaster::Engine::Test::Delegation->delegation02( $zone ); | ||
|
||
ok( !$res{DEL_NS_SAME_IP}, q{should not emit DEL_NS_SAME_IP} ); | ||
ok( $res{CHILD_NS_SAME_IP}, q{should emit CHILD_NS_SAME_IP} ); | ||
ok( $res{DEL_DISTINCT_NS_IP}, q{should emit DEL_DISTINCE_NS_IP} ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "should emit CHILD_DISTINCE_NS_IP" => "should emit CHILD_DISTINCT_NS_IP" |
||
ok( !$res{CHILD_DISTINCT_NS_IP}, q{should not emit CHILD_DISTINCE_NS_IP} ); | ||
|
||
if ( $ENV{ZONEMASTER_RECORD} ) { | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use strict; | ||
use Test::More; | ||
|
||
BEGIN { | ||
use_ok( q{Zonemaster::Engine} ); | ||
use_ok( q{Zonemaster::Engine::Test::Delegation} ); | ||
use_ok( q{Zonemaster::Engine::Util} ); | ||
} | ||
|
||
my $datafile = q{t/Test-delegation02-D.data}; | ||
|
||
if ( not $ENV{ZONEMASTER_RECORD} ) { | ||
die q{Stored data file missing} if not -r $datafile; | ||
Zonemaster::Engine::Nameserver->restore( $datafile ); | ||
Zonemaster::Engine->config->no_network( 1 ); | ||
} | ||
|
||
Zonemaster::Engine->add_fake_delegation( | ||
'd.delegation02.exempelvis.se' => { | ||
'ns1.d.delegation02.exempelvis.se' => [ '46.21.97.97', '2a02:750:12:77::97' ], | ||
'ns2.d.delegation02.exempelvis.se' => [ '46.21.97.97', '2a02:750:12:77::97' ], | ||
}, | ||
); | ||
|
||
my $zone = Zonemaster::Engine->zone( q{d.delegation02.exempelvis.se} ); | ||
|
||
my %res = map { $_->tag => $_ } Zonemaster::Engine::Test::Delegation->delegation02( $zone ); | ||
|
||
ok( $res{DEL_NS_SAME_IP}, q{should emit DEL_NS_SAME_IP} ); | ||
ok( $res{CHILD_NS_SAME_IP}, q{should emit CHILD_NS_SAME_IP} ); | ||
ok( !$res{DEL_DISTINCT_NS_IP}, q{should not emit DEL_DISTINCE_NS_IP} ); | ||
ok( !$res{CHILD_DISTINCT_NS_IP}, q{should not emit CHILD_DISTINCE_NS_IP} ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "should not emit DEL_DISTINCE_NS_IP" => "should not emit DEL_DISTINCT_NS_IP" "should emit CHILD_DISTINCE_NS_IP" => "should emit CHILD_DISTINCT_NS_IP" |
||
|
||
if ( $ENV{ZONEMASTER_RECORD} ) { | ||
Zonemaster::Engine::Nameserver->save( $datafile ); | ||
} | ||
|
||
done_testing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"should emit DEL_DISTINCE_NS_IP" => "should emit DEL_DISTINCT_NS_IP"