-
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
Fix code in Basic01 #1249
Fix code in Basic01 #1249
Conversation
I will draft this PR for now as I will add more changes, unrelated to the mentioned issue. |
9df575a
to
bd7d10e
Compare
This PR is now ready for review. |
@matsduf Github checks are not running it seems, I'm not sure on how to trigger them manually. I think I need to repush something in the PR for that to happen. Maybe you know of another way. |
CI checks will only start if the branch name matches the following as far as I can see:
|
Now the release branch has been renamed, and CI will run. Push an empty commit to the branch to trigger CI to run. |
These changes are to align the code with the specification. - Update and add missing code (step 7.3 of the specification - relates to issue zonemaster#1248) - Add missing conditional checks for the start of the Basic module and test cases ("scope" section of the specification") - Refactoring - Update unitary tests
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.
Looks good to me.
Commit f1354e1 (zonemaster#1249) introduced a bug (regression) when comparing domain names. It was using the function 'index()' to make such a comparison, on names that were no longer in their FQDN form. Thus, any domain name beginning with the characters of its TLD (e.g. 'norid.no') would wrongly be discarded. But even if that bug was reverted, it could still be problematic for multi-level zones, e.g. 'no.norid.no'. So, instead of relying on a pure Perl function that does string comparison, in this commit we make use of the Zonemaster::Engine::DNSName class, specifically its function 'common()', to count the common labels between domain names.
Commit f1354e1 (zonemaster#1249) introduced a bug (regression) when comparing domain names. It was using the function 'index()' to make such a comparison, on names that were no longer in their FQDN form. Thus, any domain name beginning with the characters of its TLD (e.g. 'norid.no') would wrongly be discarded. But even if that bug was reverted, it could still be problematic for multi-level zones, e.g. 'no.norid.no'. So, instead of relying on a pure Perl function that does string comparison, in this commit we make use of the Zonemaster::Engine::DNSName class, specifically its function 'common()', to count the common labels between domain names.
Commit f1354e1 (zonemaster#1249) introduced a bug (regression) when comparing domain names. It was using the function 'index()' to make such a comparison, on names that were no longer in their FQDN form. Thus, any domain name beginning with the characters of its TLD (e.g. 'norid.no') would wrongly be discarded. But even if that bug was reverted, it could still be problematic for multi-level zones, e.g. 'no.norid.no'. So, instead of relying on a pure Perl function that does string comparison, in this commit we make use of the Zonemaster::Engine::DNSName class, specifically its functions 'common()' and 'is_in_bailiwick', to count and compare the labels composing domain names.
Purpose
This PR fixes the implementation of Basic01 by adding missing code due to an oversight during the initial implementation update (#1212).
It also adds conditional checks to the start of the Basic module and Test Cases (see "Scope" section of Basic01) that were also missed.
Context
Fixes #1248
Changes
How to test this PR
Check that this zone (from #1248) works correctly. Note that we do not have an unitary test for that kind of zone configuration yet.
Check that a non existing zone, normal test makes Zonemaster:
Check that a non existing zone, undelegated test makes Zonemaster: