Skip to content

Implement testcase rewrite: Connectivity01 and Connectivity02 + remove Basic04#1143

Merged
6 commits merged into
developfrom
unknown repository
Nov 10, 2022
Merged

Implement testcase rewrite: Connectivity01 and Connectivity02 + remove Basic04#1143
6 commits merged into
developfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Oct 17, 2022

Copy link
Copy Markdown

Purpose

Implementation of updated testcase specification for Connectivity01 (zonemaster/zonemaster#1097) and Connectivity02 (zonemaster/zonemaster#1098)
Remove Basic04 (zonemaster/zonemaster#1099).

Context

Addresses #1136 and #1137 and #905

Changes

  • Test/Connectivity.pm
  • t/Test-connectivity.t
  • Remove Basic04

How to test this PR

Should match specification and tests should pass (btw it would be nice to have more unit test with broken name servers).

@ghost ghost added the A-TestCase Area: Test case specification or implementation of test case label Oct 17, 2022
@ghost ghost added this to the v2022.2 milestone Oct 17, 2022

@marc-vanderwal marc-vanderwal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are some minor issues.

That being said, I’ve compared both connectivity01 and connectivity02 functions in their new states and the only difference I see is the transport protocol (TCP vs. UDP) in use. Maybe there is an opportunity to be seized for deduplicating the code?

Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread share/profile.json Outdated
Comment thread t/Test-connectivity.t Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
@marc-vanderwal

Copy link
Copy Markdown
Contributor

By the way, your comment about missing test cases reminds me of #905.

Comment thread share/profile.json Outdated
@matsduf

matsduf commented Oct 18, 2022

Copy link
Copy Markdown
Contributor

Can implementation of zonemaster/zonemaster#1099 be included in this PR too? It is only to remove Basic04. If so, I will merge it.

Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread share/profile.json Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm
@matsduf

matsduf commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

@PNAX, can implementation of zonemaster/zonemaster#1099 be included in this PR too? It is only to remove Basic04. If so, I will merge it.

@ghost

ghost commented Nov 3, 2022

Copy link
Copy Markdown
Author

can implementation of zonemaster/zonemaster#1099 be included in this PR too? It is only to remove Basic04.

Yes, see 5860ffa

Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
@matsduf

matsduf commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

can implementation of zonemaster/zonemaster#1099 be included in this PR too? It is only to remove Basic04.

Yes, see 5860ffa

I have now merged zonemaster/zonemaster#1099. Can you update the description of this PR with a reference to zonemaster/zonemaster#1099 too?

@ghost ghost changed the title Implement testcase rewrite: Connectivity01 and Connectivity02 Implement testcase rewrite: Connectivity01 and Connectivity02 + remove Basic04 Nov 3, 2022
@matsduf

matsduf commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

Inconsistent behavior between IPv4/v6.

# zonemaster-cli iis.se --test connectivity/connectivity01 --level debug --show-testcase --raw --no-ipv4 | grep IPV4
   0.18 DEBUG     CONNECTIVITY01 SKIP_IPV4_DISABLED   ns=a.root-servers.net/198.41.0.4; rrtype=NS
   0.27 DEBUG     CONNECTIVITY01 SKIP_IPV4_DISABLED   ns=a.ns.se/192.36.144.107; rrtype=NS
   0.50 NOTICE    CONNECTIVITY01 CN01_IPV4_DISABLED   ns_list=nsa.dnsnode.net/194.58.192.46;nsp.dnsnode.net/194.58.198.32;nsu.dnsnode.net/185.42.137.98
# zonemaster-cli iis.se --test connectivity/connectivity01 --level debug --show-testcase --raw --no-ipv6 | grep IPV6
   0.69 NOTICE    CONNECTIVITY01 CN01_IPV6_DISABLED   ns_list=nsa.dnsnode.net/2a01:3f1:46::53;nsp.dnsnode.net/2a01:3f1:3032::53;nsu.dnsnode.net/2a01:3f0:400::32
# zonemaster-cli iis.se --test connectivity/connectivity02 --level debug --show-testcase --raw --no-ipv4 | grep IPV4
   0.18 DEBUG     CONNECTIVITY02 SKIP_IPV4_DISABLED   ns=a.root-servers.net/198.41.0.4; rrtype=NS
   0.27 DEBUG     CONNECTIVITY02 SKIP_IPV4_DISABLED   ns=a.ns.se/192.36.144.107; rrtype=NS
   0.50 DEBUG     CONNECTIVITY02 IPV4_DISABLED   ns=nsa.dnsnode.net/194.58.192.46; rrtype=SOA
   0.50 DEBUG     CONNECTIVITY02 IPV4_DISABLED   ns=nsa.dnsnode.net/194.58.192.46; rrtype=NS
   0.51 DEBUG     CONNECTIVITY02 IPV4_DISABLED   ns=nsp.dnsnode.net/194.58.198.32; rrtype=SOA
   0.51 DEBUG     CONNECTIVITY02 IPV4_DISABLED   ns=nsp.dnsnode.net/194.58.198.32; rrtype=NS
   0.52 DEBUG     CONNECTIVITY02 IPV4_DISABLED   ns=nsu.dnsnode.net/185.42.137.98; rrtype=SOA
   0.52 DEBUG     CONNECTIVITY02 IPV4_DISABLED   ns=nsu.dnsnode.net/185.42.137.98; rrtype=NS
# zonemaster-cli iis.se --test connectivity/connectivity02 --level debug --show-testcase --raw --no-ipv6 | grep IPV6
   0.70 DEBUG     CONNECTIVITY02 IPV6_DISABLED   ns=nsa.dnsnode.net/2a01:3f1:46::53; rrtype=SOA
   0.70 DEBUG     CONNECTIVITY02 IPV6_DISABLED   ns=nsa.dnsnode.net/2a01:3f1:46::53; rrtype=NS
   0.72 DEBUG     CONNECTIVITY02 IPV6_DISABLED   ns=nsp.dnsnode.net/2a01:3f1:3032::53; rrtype=SOA
   0.72 DEBUG     CONNECTIVITY02 IPV6_DISABLED   ns=nsp.dnsnode.net/2a01:3f1:3032::53; rrtype=NS
   0.74 DEBUG     CONNECTIVITY02 IPV6_DISABLED   ns=nsu.dnsnode.net/2a01:3f0:400::32; rrtype=SOA
   0.74 DEBUG     CONNECTIVITY02 IPV6_DISABLED   ns=nsu.dnsnode.net/2a01:3f0:400::32; rrtype=NS

@ghost

ghost commented Nov 3, 2022

Copy link
Copy Markdown
Author

Inconsistent behavior between IPv4/v6.

This inconsistency lies within the resolution and is the result of querying A and then AAAA records (and looping in the same order). This is not related to this PR.
Consequently I don't understand the change request. Please elaborate on it.

Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
@matsduf

matsduf commented Nov 4, 2022

Copy link
Copy Markdown
Contributor

This inconsistency lies within the resolution and is the result of querying A and then AAAA records (and looping in the same order). This is not related to this PR. Consequently I don't understand the change request. Please elaborate on it.

The tested domain, iis.se, has both IPv4 and IPv6 name server. When running Connectivity01 from this PR, why does Zonemaster output SKIP_IPV4_DISABLED when IPv4 is disabled but not SKIP_IPV6_DISABLED when IPv6 is disabled? And the same thing for Connectivity02.

@ghost

ghost commented Nov 7, 2022

Copy link
Copy Markdown
Author

why does Zonemaster output SKIP_IPV4_DISABLED when IPv4 is disabled but not SKIP_IPV6_DISABLED when IPv6 is disabled?

This is related to how Zonemaster proceeds with the resolution: A records have precedence over AAAA records. Such messages are displayed during DNS tree traversal only and not while testing the zone configuration, (see Zone.pm (develop/4ca9539b)).

This behavior is present in develop (grepping with some context):

$ git checkout develop
$ zonemaster-cli iis.se --test connectivity/connectivity01 --level debug --show-testcase --raw --no-ipv4 | grep -C 1 IPV4
   0.22 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN"}; ip=2620:10a:80ab::150; name=se; type=SOA
   0.23 DEBUG     CONNECTIVITY01 SKIP_IPV4_DISABLED   ns=a.root-servers.net/198.41.0.4; rrtype=NS
   0.23 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN"}; ip=2001:503:ba3e::2:30; name=se; type=NS
--
   0.31 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN"}; ip=2a01:3f0:0:301::53; name=se; type=NS
   0.36 DEBUG     CONNECTIVITY01 SKIP_IPV4_DISABLED   ns=a.ns.se/192.36.144.107; rrtype=NS
   0.36 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN"}; ip=2a01:3f0:0:301::53; name=iis.se; type=NS
--
   0.69 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN"}; ip=2a01:3f1:46::53; name=iis.se; type=NS
   0.84 DEBUG     CONNECTIVITY01 IPV4_DISABLED   ns=nsa.dnsnode.net/194.58.192.46; rrtype=SOA
   0.84 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN","usevc":0}; ip=2a01:3f1:46::53; name=iis.se; type=SOA
   0.85 DEBUG     CONNECTIVITY01 NAMESERVER_HAS_UDP_53   ns=nsa.dnsnode.net/2a01:3f1:46::53
   0.85 DEBUG     CONNECTIVITY01 IPV4_DISABLED   ns=nsp.dnsnode.net/194.58.198.32; rrtype=SOA
   0.85 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN","usevc":0}; ip=2a01:3f1:3032::53; name=iis.se; type=SOA
   0.86 DEBUG     CONNECTIVITY01 NAMESERVER_HAS_UDP_53   ns=nsp.dnsnode.net/2a01:3f1:3032::53
   0.86 DEBUG     CONNECTIVITY01 IPV4_DISABLED   ns=nsu.dnsnode.net/185.42.137.98; rrtype=SOA
   0.86 DEBUG     CONNECTIVITY01 NAMESERVER_HAS_UDP_53   ns=nsu.dnsnode.net/2a01:3f0:400::32
   0.86 DEBUG     CONNECTIVITY01 IPV4_DISABLED   ns=nsa.dnsnode.net/194.58.192.46; rrtype=SOA
   0.86 DEBUG     CONNECTIVITY01 IPV4_DISABLED   ns=nsp.dnsnode.net/194.58.198.32; rrtype=SOA
   0.86 DEBUG     CONNECTIVITY01 IPV4_DISABLED   ns=nsu.dnsnode.net/185.42.137.98; rrtype=SOA
   0.87 DEBUG     CONNECTIVITY01 TEST_CASE_END   testcase=connectivity01
$ git checkout develop
$ zonemaster-cli iis.se --test connectivity/connectivity01 --level debug --show-testcase --raw --no-ipv6 | grep -C 1 IPV6
   0.77 DEBUG     CONNECTIVITY01 NAMESERVER_HAS_UDP_53   ns=nsa.dnsnode.net/194.58.192.46
   0.77 DEBUG     CONNECTIVITY01 IPV6_DISABLED   ns=nsa.dnsnode.net/2a01:3f1:46::53; rrtype=SOA
   0.77 DEBUG     CONNECTIVITY01 EXTERNAL_QUERY   flags={"class":"IN","usevc":0}; ip=194.58.198.32; name=iis.se; type=SOA
   0.78 DEBUG     CONNECTIVITY01 NAMESERVER_HAS_UDP_53   ns=nsp.dnsnode.net/194.58.198.32
   0.78 DEBUG     CONNECTIVITY01 IPV6_DISABLED   ns=nsp.dnsnode.net/2a01:3f1:3032::53; rrtype=SOA
   0.78 DEBUG     CONNECTIVITY01 NAMESERVER_HAS_UDP_53   ns=nsu.dnsnode.net/185.42.137.98
   0.78 DEBUG     CONNECTIVITY01 IPV6_DISABLED   ns=nsu.dnsnode.net/2a01:3f0:400::32; rrtype=SOA
   0.78 DEBUG     CONNECTIVITY01 IPV6_DISABLED   ns=nsa.dnsnode.net/2a01:3f1:46::53; rrtype=SOA
   0.79 DEBUG     CONNECTIVITY01 IPV6_DISABLED   ns=nsp.dnsnode.net/2a01:3f1:3032::53; rrtype=SOA
   0.79 DEBUG     CONNECTIVITY01 IPV6_DISABLED   ns=nsu.dnsnode.net/2a01:3f0:400::32; rrtype=SOA
   0.79 DEBUG     CONNECTIVITY01 TEST_CASE_END   testcase=connectivity01

@ghost

ghost commented Nov 8, 2022

Copy link
Copy Markdown
Author

Maybe there is an opportunity to be seized for deduplicating the code?

Very true. I've refactored the code in that way.

To all reviewers, hopefully I've addressed everything.

@tgreenx tgreenx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Few comments other than that LGTM

Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
Comment thread lib/Zonemaster/Engine/Test/Connectivity.pm Outdated
my ( $class, $zone ) = @_;
push my @results, info( TEST_CASE_START => { testcase => (split /::/, (caller(0))[3])[-1] } );
my $query_type = q{SOA};
sub _connectivity_loop {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add an entry for that method in the documentation part of this file

@matsduf matsduf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@marc-vanderwal marc-vanderwal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@matsduf

matsduf commented Nov 10, 2022

Copy link
Copy Markdown
Contributor

@tgreenx, could you re-review this?

@matsduf matsduf added the V-Minor Versioning: The change gives an update of minor in version. label Nov 10, 2022
@matsduf

matsduf commented Nov 10, 2022

Copy link
Copy Markdown
Contributor

@PNAX, please merge.

@ghost ghost merged commit 67b1d18 into zonemaster:develop Nov 10, 2022
@marc-vanderwal

Copy link
Copy Markdown
Contributor

Unit tests pass. Additionally, I was able to elicit some of the more elusive messages (such as CN01_SOA_RECORD_NOT_AA_UDP) using IBDNS.

@marc-vanderwal marc-vanderwal added the S-ReleaseTested Status: The PR has been successfully tested in release testing label Dec 6, 2022
@tgreenx tgreenx mentioned this pull request May 16, 2023
@tgreenx tgreenx linked an issue May 16, 2023 that may be closed by this pull request
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-TestCase Area: Test case specification or implementation of test case S-ReleaseTested Status: The PR has been successfully tested in release testing V-Minor Versioning: The change gives an update of minor in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement updated Connectivity02 Implement updated Connectivity01 Unit test for BASIC04

3 participants