Test zones for the CNAME function in Recursor.pm in Engine#1220
Conversation
marc-vanderwal
left a comment
There was a problem hiding this comment.
Looks fine. I just saw a few typos and I have one comment about a problem case.
Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
There was a problem hiding this comment.
@marc-vanderwal, also see the dig output in test-zone-data/Engine/Recursor-PM/README.md in this PR.
| @@ -20,6 +20,446 @@ See [CNAME.md] for specification of the scenarios. | |||
|
|
|||
| ## zonemaster-cli commands and their output for each test scenario | |||
There was a problem hiding this comment.
But these are outputs from dig, not zonemaster-cli. And I suppose that they were obtained with CoreDNS.
There was a problem hiding this comment.
The outputs are with dig against the CoreDNS configuration. They are there to show what Zonemaster would get if the unit tests query for those names with query type A.
I am waiting for zonemaster/zonemaster-engine#1288 to be done.
This is different since there is no test case to run, is there? I do not see how I could run zonemaster-cli for these scenarios.
There was a problem hiding this comment.
zonemaster/zonemaster-engine#1288 has been updated to include the changes discussed in the work group. Note that two unit tests are failing due to an issue with CoreDNS, see my other comments.
You should now be able to test this PR properly.
|
@marc-vanderwal and @tgreenx: Please re-review. |
|
I want to hear from @tgreenx before merging. It should match zonemaster/zonemaster-engine#1288. |
| ;; ANSWER SECTION: | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-1.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-1.cname.recursor.engine.xa. |
There was a problem hiding this comment.
Why are there so many of the same CNAME record here? This is also what I get when running locally. Is it a bug in CoreDNS? There should be just one for this test scenario; otherwise Engine will output CNAME_MULTIPLE_FOR_NAME instead of CNAME_LOOP_INNER.
There was a problem hiding this comment.
I guess it is a bug in CoreDNS, but on the other hand, the CNAME records are identical and I feel they should be considered to be one. I will check.
There was a problem hiding this comment.
I have reported the bug to CoreDNS (coredns/coredns#6421). At least I think it is a bug. I suspect that CoreDNS "thinks" that it should follow CNAME from the response. Some sort of internal resolver.
I failed to find a work-around.
| ;; ANSWER SECTION: | ||
| looped-cname-in-zone-2.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-a.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-b.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-b.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-a.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-b.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-b.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-a.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-b.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-b.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-a.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-b.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-b.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa. | ||
| looped-cname-in-zone-2-a.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-b.cname.recursor.engine.xa. |
There was a problem hiding this comment.
Same comment here. CNAME records are unexpectedly repeated.
There was a problem hiding this comment.
Same answer as above.
There was a problem hiding this comment.
I have also reported this, but here I found a work-around wht with dig gives the following result:
; <<>> DiG 9.18.18-0ubuntu0.22.04.1-Ubuntu <<>> @127.30.1.31 looped-cname-in-zone-2.cname.recursor.engine.xa
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13110
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 7a7a75c08fe99560 (echoed)
;; QUESTION SECTION:
;looped-cname-in-zone-2.cname.recursor.engine.xa. IN A
;; ANSWER SECTION:
looped-cname-in-zone-2.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa.
looped-cname-in-zone-2-a.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-b.cname.recursor.engine.xa.
looped-cname-in-zone-2-b.cname.recursor.engine.xa. 3600 IN CNAME looped-cname-in-zone-2-a.cname.recursor.engine.xa.
;; AUTHORITY SECTION:
cname.recursor.engine.xa. 3600 IN NS ns1.cname.recursor.engine.xa.
;; Query time: 0 msec
;; SERVER: 127.30.1.31#53(127.30.1.31) (UDP)
;; WHEN: Wed Nov 29 13:07:05 UTC 2023
;; MSG SIZE rcvd: 488
I will update.
| @@ -20,6 +20,446 @@ See [CNAME.md] for specification of the scenarios. | |||
|
|
|||
| ## zonemaster-cli commands and their output for each test scenario | |||
There was a problem hiding this comment.
zonemaster/zonemaster-engine#1288 has been updated to include the changes discussed in the work group. Note that two unit tests are failing due to an issue with CoreDNS, see my other comments.
You should now be able to test this PR properly.
|
@marc-vanderwal and @tgreenx: Please re-review. |
…AME and EXTRA-CNAME-IN-ANSWER
|
@marc-vanderwal and @tgreenx: Please re-review. |
tgreenx
left a comment
There was a problem hiding this comment.
Commit zonemaster/zonemaster-engine@32244e9 adds a message tag CNAME_START whenever the CNAME lookup functionality is used. This could be added to the list of expected message tags for each scenario.
What is the expected output where I have put "??"? Could you check the table? |
Co-authored-by: tgreenx <96772376+tgreenx@users.noreply.github.com>
From review comment. Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
Purpose
Test zone for unit tests for zonemaster/zonemaster-engine#1288
How to test this PR
Create unit tests based on these test zones when the PR in engine has been completed.