-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fixing errors display when using options '--ns' or '--ds' #382
Conversation
This PR is based on develop branch before the last release. I suggest that it is rebased on latest master or develop branch. |
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.
The changes are fine. When the other review comments are handled I can approve.
@MichaelTimbert, can you please handle the conflicts? |
I have extracted CLI argument verification from 'add_fake_delegation' and 'add_fake_ds' to 'check_fake_ds' and 'check_fake_delegation'. check_* functions are called before displaying the header and only displays CLI argument errors. add_* functions are called after the header and throw errors from the Engine.
Code formatting Co-authored-by: tgreenx <[email protected]> Co-authored-by: Marc van der Wal <[email protected]>
Remove unused variables Co-authored-by: tgreenx <[email protected]>
Improve code Co-authored-by: tgreenx <[email protected]>
Move --ns & --ds validation earlier in the code Co-authored-by: tgreenx <[email protected]>
Improve code and regex validation Co-authored-by: Marc van der Wal <[email protected]>
Reuse code from Zonemaster::Engine for IP validation Co-authored-by: Mats Dufberg <[email protected]>
Better hint for --ds option Co-authored-by: Mats Dufberg <[email protected]>
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.
# zonemaster-cli --show-testcase --no-ipv6 --test Basic zonemaster.net --ns ns1.zonemaster.net --level info
1.11 ERROR Unspecified The fake delegation of domain zonemaster.net includes an in-zone name server ns1.zonemaster.net without mandatory glue (without IP address).
\
Seconds Level Testcase Message
======= ======== ============== =======
0.00 INFO Unspecified Using version v6.0.0 of the Zonemaster engine.
0.00 INFO Basic01 The zone "zonemaster.net" is found.
0.00 INFO Basic01 This is a test of an undelegated domain so finding the parent zone is disregarded.
0.16 CRITICAL Basic02 There is no working name server for "zonemaster.net" so it is unreachable.
0.16 ERROR Basic02 Name server "ns1.zonemaster.net" cannot be resolved into an IP address.
Why is the first message before the header?
I mistakenly moved the |
Release testing for 2024.2: When trying the first command, the output doesn’t report any errors, although it should:
All other command lines listed in the testing procedures show an error, without showing the “seconds, level, testcase, message” header at all, so I assume this works as expected. I’ve created issue #402 to track this problem. |
Purpose
This separate CLI errors from Engine errors.
Errors on CLI argument are catch before displaying the header.
Context
Fixes #358
Changes
I have split CLI argument verification from Engine settings.
I have also add regex validation for '--ds' arguments
How to test this PR
Stress test zonemaster-cli with various '--ns' and '--ds' arguments.
Errors from command line input validation must be display before any header.
Errors from the Engine must be formatted correctly after the header.
here some example to cmd to run: