Skip to content

Commit

Permalink
Re-implementation of Basic01
Browse files Browse the repository at this point in the history
Based on:
	- Updated test case specification from zonemaster/zonemaster#1257
	- New test zones specification from zonemaster/zonemaster#1255
  • Loading branch information
tgreenx committed Jun 4, 2024
1 parent ce01bb3 commit b933017
Show file tree
Hide file tree
Showing 6 changed files with 775 additions and 678 deletions.
437 changes: 223 additions & 214 deletions lib/Zonemaster/Engine/Test/Basic.pm

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion share/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
"B01_INCONSISTENT_DELEGATION" : "ERROR",
"B01_NO_CHILD" : "ERROR",
"B01_PARENT_FOUND" : "INFO",
"B01_PARENT_NOT_FOUND" : "WARNING",
"B01_PARENT_UNDETERMINED" : "WARNING",
"B01_UNEXPECTED_NS_RESPONSE" : "WARNING",
"B01_SERVER_ZONE_ERROR" : "DEBUG",
"B02_AUTH_RESPONSE_SOA" : "INFO",
"B02_NO_DELEGATION" : "CRITICAL",
"B02_NO_WORKING_NS" : "CRITICAL",
Expand Down
24 changes: 18 additions & 6 deletions share/profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,33 @@ test_levels:
TEST_CASE_START: DEBUG
BASIC:
A_QUERY_NO_RESPONSES: INFO
B01_CHILD_IS_ALIAS : NOTICE
B01_CHILD_FOUND : INFO
B01_CHILD_NOT_EXIST : INFO
B01_INCONSISTENT_ALIAS : ERROR
B01_INCONSISTENT_DELEGATION : ERROR
B01_NO_CHILD : ERROR
B01_PARENT_FOUND : INFO
B01_PARENT_NOT_FOUND : WARNING
B01_PARENT_UNDETERMINED : WARNING
B01_SERVER_ZONE_ERROR : DEBUG
B02_AUTH_RESPONSE_SOA : INFO
B02_NO_DELEGATION : CRITICAL
B02_NO_WORKING_NS : CRITICAL
B02_NS_BROKEN : ERROR
B02_NS_NOT_AUTH : ERROR
B02_NS_NO_IP_ADDR : ERROR
B02_NS_NO_RESPONSE : WARNING
B02_UNEXPECTED_RCODE : ERROR
DOMAIN_NAME_LABEL_TOO_LONG: CRITICAL
DOMAIN_NAME_TOO_LONG: CRITICAL
DOMAIN_NAME_ZERO_LENGTH_LABEL: CRITICAL
HAS_A_RECORDS: ERROR
HAS_NAMESERVERS: INFO
HAS_NAMESERVER_NO_WWW_A_TEST: INFO
HAS_PARENT: INFO
IPV4_DISABLED: DEBUG
IPV4_ENABLED: DEBUG
IPV6_DISABLED: DEBUG
IPV6_ENABLED: DEBUG
NO_GLUE_PREVENTS_NAMESERVER_TESTS: CRITICAL
NO_PARENT: CRITICAL
NS_FAILED: ERROR
NS_NO_RESPONSE: DEBUG
TEST_CASE_END: DEBUG
TEST_CASE_START: DEBUG
CONNECTIVITY:
Expand Down
19 changes: 1 addition & 18 deletions t/Test-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,6 @@ ok( $res{HAS_NAMESERVER_NO_WWW_A_TEST}, q{HAS_NAMESERVER_NO_WWW_A_TEST} );
%res = map { $_->tag => 1 } Zonemaster::Engine->test_module( q{basic}, q{birgerjarlhotel.se} );
ok( $res{A_QUERY_NO_RESPONSES}, q{A_QUERY_NO_RESPONSES} );

###########
# basic01
###########
$zone = Zonemaster::Engine->zone( 'exampledomain.fake' );
zone_gives('basic01', $zone, [qw{B01_PARENT_FOUND B01_NO_CHILD}] );
zone_gives_not( 'basic01', $zone, [qw{B01_CHILD_IS_ALIAS B01_CHILD_FOUND B01_CHILD_NOT_EXIST B01_INCONSISTENT_ALIAS B01_INCONSISTENT_DELEGATION B01_PARENT_UNDETERMINED B01_UNEXPECTED_NS_RESPONSE}] );

$zone = Zonemaster::Engine->zone( 'afnic.fr' );
zone_gives('basic01', $zone, [qw{B01_PARENT_FOUND B01_CHILD_FOUND}] );
zone_gives_not( 'basic01', $zone, [qw{B01_CHILD_IS_ALIAS B01_CHILD_NOT_EXIST B01_INCONSISTENT_ALIAS B01_INCONSISTENT_DELEGATION B01_NO_CHILD B01_PARENT_UNDETERMINED B01_UNEXPECTED_NS_RESPONSE}] );

###########
# basic02
###########
Expand Down Expand Up @@ -137,13 +126,7 @@ Zonemaster::Engine::Profile->effective->set( q{no_network}, 1 );
TODO: {
local $TODO = "Need to find/create zones with that error";

# basic01
ok( $tag{B01_CHILD_IS_ALIAS}, q{B01_CHILD_IS_ALIAS} );
ok( $tag{B01_CHILD_NOT_EXIST}, q{B01_CHILD_NOT_EXIST} );
ok( $tag{B01_INCONSISTENT_ALIAS}, q{B01_INCONSISTENT_ALIAS} );
ok( $tag{B01_INCONSISTENT_DELEGATION}, q{B01_INCONSISTENT_DELEGATION} );
ok( $tag{B01_PARENT_UNDETERMINED}, q{B01_PARENT_UNDETERMINED} );
ok( $tag{B01_UNEXPECTED_NS_RESPONSE}, q{B01_UNEXPECTED_NS_RESPONSE} );
# None
}

done_testing;
456 changes: 274 additions & 182 deletions t/Test-basic01.data

Large diffs are not rendered by default.

Loading

0 comments on commit b933017

Please sign in to comment.