Update MethodsV2 get_parent_ns_ips() to match new Basic01 algorithm#1373
Conversation
|
This implementation contains slight deviations from the specification, see zonemaster/zonemaster#1287 (review). |
7350c4b to
6d6a3b4
Compare
I think we should test the implementations that currently fail, see #1351. |
5ca62cc to
f53a7fa
Compare
|
Updated my environment to run with this update. There are four failing scenarios. One is CHLD-FOUND-INCONSIST-6 The parent is expected to be 127.40.1.41 + IPv6, and that is found by the unit test. Querying the parent for the delegation gives: Six ns/ip are expected from the unit test, but it only provides two: |
|
Another example, IB-NOT-IN-ZONE-1. The address records are not defined in the zone, but the NS records are there and the delegation works. Lookup with the resolver: The unit test does not report any name servers for the zone: |
|
The NO-CHILD-2 has the same problem as NO-CHILD-1. |
It can, but you need to pass an undefined value and not an arrayref of an undefined value, i.e.: |
Ah you just did. From what I can see in your latest commit you mistakenly defined empty sets everywhere instead of undefined values, as the specification states. See my review in zonemaster/zonemaster#1254. These are the currently specified return values of MethodV2 "Get parent NS IP addresses": |
|
It does not seem to work to specify |
Indeed, I suggested a fix. See: #1351 (review) With that fix it seems to work properly now, and (enabled) unit tests pass: |
|
Scenarios DELEG-OOB-W-ERROR-1 -- 4 fail and output E.g. Also see #1351 which is complete now. |
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
f53a7fa to
f5c66b4
Compare
- Add missing CNAME support in several TestMethodsV2 methods - Add support for resolution from given name server list to Recursor->recurse() - Add support of section to Packet->has_rrs_of_type_for_name() - Change usage of Recursor->_recurse() to Recursor->recurse() in TestMethodsV2.pm - Refactoring - Update documentation
…odules - Fix conditionals in TestMethodsV2->_get_delegation() - Change IP address list to a set in Recursor->add_fake_addresses(), in order to avoid duplicates - Refactoring
|
@matsduf I added a few commits in #1351. Now, together with the latest changes in this PR, all unit tests pass. @matsduf @mattias-p @marc-vanderwal @MichaelTimbert please review. |
(Initial comment: zonemaster/zonemaster#1287 (comment)) This relates to this part of the specification: https://github.com/zonemaster/zonemaster/blob/7b85ac86264a51bb8754ee86b7dcad33215cd670/docs/public/specifications/tests/MethodsV2.md?plain=1#L181-L237 Currently one of such loop protection mechanism already existed in Engine, located in the recursive function and with a max value set at 20: I re-ran the numbers using all test zones defined in So it seems reasonable to lower the number from 1000 to 20, to match the existing value found in |
There is a risk of aborting too early in some corner cases that probably sound convoluted, but are legal. IPv6 reverse zones have domain names with many labels: domain names in Unless there is a best practice somewhere stating that the number of delegation points be limited to some reasonable number? Or is that number similar to what other “big” resolvers (e.g. BIND, Unbound, etc.) do? |
|
There is a risk both in too low and too high value. I suggest that we set the value to less than 100, maybe as low as 20, and then adjust the other value to be the same. If I read the code a message will be outputted if the level is reached. It is not expected to happen, so I suggest the message to be on DEBUG level. It could even be motivated to have it on WARNING level since it might severely affect the test result. |
|
|
@tgreenx, adding optional arguments is not breaking, is it? It should be |
|
Review for release testing for v2024.2: no issues. |
Purpose
This PR updates MethodsV2
get_parent_ns_ips()to match new Basic01 algorithm. Other related/convenient changes are made in other modules (e.g.Zonemaster::Engine::Recursor).It also adds a loop protection mechanism (and message tag at the
DEBUG2level) forwhile()loops in case of any unforeseen issue with the methods using this new algorithm.For easier reviewing you should discard commit b83a7a7 (which only converts indentation from tabulation to space).
Context
Specification: zonemaster/zonemaster#1287
This implementation contains slight deviations from the specification, see zonemaster/zonemaster#1287 (review).
Changes
Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips()codeZonemaster::Engine::TestMethodsV2methodsLOOP_PROTECTION(used in three places) at theDEBUG2level$nsinZonemaster::Engine::Recursor->recurse()@sectioninZonemaster::Engine::Packet->has_rrs_of_type_for_name()Zonemaster::Engine::Recursor->add_fake_addresses()(to avoid duplicates)How to test this PR
Unit tests should pass.
Also, for manual testing you can run the method of your choice with the following, e.g. for
get_parent_ns_ips():