-
Notifications
You must be signed in to change notification settings - Fork 34
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
Update implementation Zone09 #1109
Conversation
my $p2 = $ns->query( $zone->name, q{MX}, { fallback => 0, usevc => 0 } ); | ||
|
||
if ( $p2 and $p2->tc ){ | ||
$p2 = $ns->query( $zone->name, q{MX}, { fallback => 0, usevc => 1 } ); | ||
} |
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.
This should be the default querying when the specification sends a default DNS query. Would it make sense to implement the default query as a method? (I do not mean necessarily in this PR.)
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.
I am not sure yet. I need more clarification about the behavior of LDNS, because now I see that there is a 3rd flag that can influence TCP behavior. It is unclear to me how it behaves when all of those flags are set/unset simultaneously.
=head2 resolver.defaults.igntc
A boolean. If false, UDP queries that get responses with the C<TC>
flag set will be automatically resent over TCP. Default false.
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.
@mattias-p maybe you have some info on this?
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.
Yes, it really looks like we want "resolver.defaults.igntc" to be set false by default, and then we should not need to worry. A test what would happen if the server responds with TC set over UDP and then not at all over TCP would be interesting.
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.
I agree with you @matsduf that we ought to have a method that encapsulates the default way we make DNS requests. And I'd like to expand on this idea too. For each behavior in the specifications that deviate from the default, the caller should be able to easily override that in the method parameters. (I guess possibly it could be a DNS request API that consists of more than one method.)
I agree with you @tgreenx too that this is a bit of a mess. I've tried to make sense of these flags before, but I'm afraid I've lost those notes. Though we should really deprecated and remove all properties from the Profile that correspond to LDNS flags that the DNS request method wants to set/clear.
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.
I created #1122 for to continue this discussion.
I have created a test zone xa with real MX on one name server and no MX on the other. I do not expect any Z09_TLD_EMAIL_DOMAIN, but I get four (it is a TLD):
|
A new test zone, xb. The two servers have different data in MX. I expecte two (not four) Z09_MX_DATA with "ns_ip_list" (not with "ns").
|
New test zone, xc. One server has two normal MX and the the other has one normal and one Null-MX. I think the specification says that only the inconsistencies between the servers should be reported. If we should follow the implementation then the specification has to be updated. Z09_NULL_MX_WITH_OTHER_MX is outputted twice, I only expected once.
|
Test zone xd. Both servers have the same MX, one correct Null-MX and one with preference 5. Too many messages.
|
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.
I have tested as reported in the comments. The test zones are available.
[ ... ] The specification says:
So, this zone is a TLD, and If I understand correctly, there are indeed 2 non-null MX records ( |
In the specification there is first
which loops around the name servers and saves information into the sets. Then there is
and that is not meant to say that the message should be outputted once per name server. Should I clarify the specification? There is no meaning of outputting that message more than once. Secondly, as I read the specification, if the MX data are not equal in all servers then you come to When it comes to the second bullet one could have different opinions if the Z09_TLD_EMAIL_DOMAIN message should be outputted or not. If it should, then the specification should be updated, it not it should maybe be clarified?
No, that was not my expectation, and definitely not more than once. |
I agree on the fact that having it outputted more than once was a mistake. It has been corrected in the latest commit (same goes for other message tags for other zones you mentioned earlier). However I think that the specification do require an update then, because in our case, regarding zone
|
I agree with your reading. There will be some extra messages, but only in case there is an inconsistency, so I think it is fine. |
Now it looks fine for zone xa:
|
I expected two Z09_MX_DATA, one per set, but I only get one (zone xb):
|
Also here I expect two Z09_MX_DATA, one per set, but I only get one (zone xc):
|
Now it looks fine (xd):
|
I have also created the following test zones on the same server and report as expected:
|
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.
- profile_example.json is not updated, see Keep profile.json and profile_example.json alined or make profile_example.json minimal #1118
- You can use my test zones, and I'll document that they must be kept
- Besides the lack of separation between MX RRsets in Z09_MX_DATA I see no other issues.
All these should be solved now. I chose to add unitary tests for zones |
I created a PR #1120 that removes all message tags etc from profile_example.json, and if the PR is excepted, then the file should not be included here. |
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.
It looks fine. Maybe there should be more scenarios in the unit tests to cover all messages, e.g. having root zones with normal MX, with Null MX and with no MX, respectively.
t/Test-zone09-A.data | ||
t/Test-zone09-A.t | ||
t/Test-zone09-B.data | ||
t/Test-zone09-B.t | ||
t/Test-zone09-C.data | ||
t/Test-zone09-C.t | ||
t/Test-zone09-D.data | ||
t/Test-zone09-D.t | ||
t/Test-zone09-E.data | ||
t/Test-zone09-E.t |
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.
It's really nice that you continue the use of an established naming convention! However, the set of messages checked in those files is also the set of messages we need to keep stable because other people are relying on them. If we add new tests with this naming convention (and do nothing else), we might believe those messages are also covered by the stability guarantee, and that's an unnecessary maintenance burden.
I guess it would be a good idea to create a list in zonemaster/zonemaster that lists all the messages that we need to keep stable. But that's not enough. It should be visible somehow in the test files which messages are stable and which aren't. Otherwise it's really easy to forget that some messages are stable when making and reviewing updates. Maybe we could just rename the old Test-XXXX-X.t to Stable-XXXX-X.t? Maybe there are better ideas?
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.
I created #1123 so we don't need to stall this PR because of this discussion.
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.
This looks good to me! Though I've opened up a couple of discussions in the comments that I don't think we should forget about. I guess I'll just create separate issues for those.
@tgreenx, I think this can be merged. |
Purpose
This PR proposes a new implementation for test case Zone09, as the specification was recently updated.
Context
Fixes #1103
Changes
(per commit)
How to test this PR
Checks should pass.