Skip to content
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

Unit tests send DNS queries when "no_network" is true #888

Closed
matsduf opened this issue Mar 15, 2021 · 3 comments
Closed

Unit tests send DNS queries when "no_network" is true #888

matsduf opened this issue Mar 15, 2021 · 3 comments
Assignees
Labels
T-Bug Type: Bug in software or error in test case description
Milestone

Comments

@matsduf
Copy link
Contributor

matsduf commented Mar 15, 2021

The following test is based on v4.1.1 of Zonemaster::Engine. When the unit tests are run (t/*.t) then the following tests will emit DNS queries even though no_network is set to true, which means that all DNS queries should be responded to from cache which has been populated by the data file of prerecorded DNS responses.

Test-consistency06-B.t:

16:49:36.782858 IP 10.0.3.15.15010 > 172.17.36.11.53: 28831+ AAAA? drop.ip.se. (28)
16:49:36.792967 IP 172.17.36.11.53 > 10.0.3.15.15010: 28831 1/4/0 AAAA 2001:db8::2 (132)
16:49:36.793113 IP 10.0.3.15.11114 > 172.17.36.11.53: 7937+ A? drop.ip.se. (28)
16:49:36.797188 IP 172.17.36.11.53 > 10.0.3.15.11114: 7937 1/4/0 A 192.0.2.2 (120)
16:49:36.797638 IP 10.0.3.15.28959 > 172.17.36.11.53: 54070+ AAAA? drip.ip.se. (28)
16:49:36.801683 IP 172.17.36.11.53 > 10.0.3.15.28959: 54070 1/4/0 AAAA 2001:db8::1 (132)
16:49:36.801791 IP 10.0.3.15.45298 > 172.17.36.11.53: 57646+ A? drip.ip.se. (28)
16:49:36.806389 IP 172.17.36.11.53 > 10.0.3.15.45298: 57646 1/4/0 A 192.0.2.1 (120)

Test-delegation03-C.t:

16:50:19.058162 IP 172.17.36.11.53 > 10.0.3.15.44339: 32967 NXDomain 0/1/0 (114)
16:50:19.673087 IP 10.0.3.15.58447 > 172.17.36.11.53: 38168+ AAAA? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns2.exempelvis.se. (143)
16:50:19.690723 IP 172.17.36.11.53 > 10.0.3.15.58447: 38168 0/1/0 (199)
16:50:19.690853 IP 10.0.3.15.14187 > 172.17.36.11.53: 25104+ A? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns2.exempelvis.se. (143)
16:50:19.698331 IP 172.17.36.11.53 > 10.0.3.15.14187: 25104 1/5/2 A 194.18.226.122 (288)
16:50:19.699184 IP 10.0.3.15.61748 > 172.17.36.11.53: 56886+ AAAA? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns3.exempelvis.se. (143)
16:50:19.706058 IP 172.17.36.11.53 > 10.0.3.15.61748: 56886 1/5/2 AAAA 2a02:750:12:77::97 (300)
16:50:19.706201 IP 10.0.3.15.24730 > 172.17.36.11.53: 58785+ A? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns3.exempelvis.se. (143)
16:50:19.713907 IP 172.17.36.11.53 > 10.0.3.15.24730: 58785 0/1/0 (199)
16:50:19.714283 IP 10.0.3.15.24312 > 172.17.36.11.53: 63577+ AAAA? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns1.exempelvis.se. (143)
16:50:19.722446 IP 172.17.36.11.53 > 10.0.3.15.24312: 63577 0/1/0 (199)
16:50:19.722577 IP 10.0.3.15.21221 > 172.17.36.11.53: 53765+ A? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns1.exempelvis.se. (143)
16:50:19.730128 IP 172.17.36.11.53 > 10.0.3.15.21221: 53765 1/5/2 A 46.21.97.97 (288)
16:50:19.730815 IP 10.0.3.15.26240 > 172.17.36.11.53: 18850+ AAAA? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns4.exempelvis.se. (143)
16:50:19.738180 IP 172.17.36.11.53 > 10.0.3.15.26240: 18850 1/5/2 AAAA 2001:2040:2b:1c13::53 (300)
16:50:19.738533 IP 10.0.3.15.23929 > 172.17.36.11.53: 2887+ A? abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.ns4.exempelvis.se. (143)
16:50:19.746193 IP 172.17.36.11.53 > 10.0.3.15.23929: 2887 0/1/0 (199)

Test-dnssec05-A.t:

16:51:41.441679 IP 172.17.36.11.53 > 10.0.3.15.60590: 65216 NXDomain 0/1/0 (110)
16:51:42.070219 IP 10.0.3.15.26708 > 172.17.36.11.53: 22468+ AAAA? drop.ip.se. (28)
16:51:42.074317 IP 172.17.36.11.53 > 10.0.3.15.26708: 22468 1/4/0 AAAA 2001:db8::2 (132)
16:51:42.074434 IP 10.0.3.15.16044 > 172.17.36.11.53: 5341+ A? drop.ip.se. (28)
16:51:42.077948 IP 172.17.36.11.53 > 10.0.3.15.16044: 5341 1/4/0 A 192.0.2.2 (120)
16:51:42.078291 IP 10.0.3.15.46461 > 172.17.36.11.53: 4043+ AAAA? drip.ip.se. (28)
16:51:42.082083 IP 172.17.36.11.53 > 10.0.3.15.46461: 4043 1/4/0 AAAA 2001:db8::1 (132)
16:51:42.082196 IP 10.0.3.15.36811 > 172.17.36.11.53: 3934+ A? drip.ip.se. (28)
16:51:42.086098 IP 172.17.36.11.53 > 10.0.3.15.36811: 3934 1/4/0 A 192.0.2.1 (120)

Test-syntax06-B.t:

16:52:22.405594 IP 172.17.36.11.53 > 10.0.3.15.63169: 14428 NXDomain 0/1/0 (110)
16:52:22.983700 IP 10.0.3.15.56726 > 172.17.36.11.53: 32121+ AAAA? drip.ip.se. (28)
16:52:22.987747 IP 172.17.36.11.53 > 10.0.3.15.56726: 32121 1/4/0 AAAA 2001:db8::1 (132)
16:52:22.987860 IP 10.0.3.15.41377 > 172.17.36.11.53: 43454+ A? drip.ip.se. (28)
16:52:22.991670 IP 172.17.36.11.53 > 10.0.3.15.41377: 43454 1/4/0 A 192.0.2.1 (120)
16:52:22.992063 IP 10.0.3.15.39849 > 172.17.36.11.53: 57420+ AAAA? drop.ip.se. (28)
16:52:23.002180 IP 172.17.36.11.53 > 10.0.3.15.39849: 57420 1/4/0 AAAA 2001:db8::2 (132)
16:52:23.002293 IP 10.0.3.15.35118 > 172.17.36.11.53: 64155+ A? drop.ip.se. (28)
16:52:23.006242 IP 172.17.36.11.53 > 10.0.3.15.35118: 64155 1/4/0 A 192.0.2.2 (120)
@matsduf matsduf added T-Bug Type: Bug in software or error in test case description A-UnitTests labels Mar 15, 2021
@matsduf matsduf added this to the v2021.1 milestone Mar 15, 2021
@mattias-p mattias-p changed the title Unit tests send DNS quries when "no_network" is true Unit tests send DNS queries when "no_network" is true Mar 15, 2021
@mattias-p
Copy link
Member

The listed test cases are exactly the ones that contain fake delegation with names but no IP addresses.

@mattias-p mattias-p self-assigned this Mar 29, 2021
@mattias-p
Copy link
Member

If Zonemaster::Engine->add_fake_delegation() is called with an OOB nameserver with no addresses, it calls Zonemaster::LDNS->new->name2addr() to look up the addresses for the nameserver.

The code was introduced in #285 in response to a bug report in #278.

I have a feeling the bug was fixed in the wrong place. The lookup seems to me like a convenience feature that belong in CLI and possibly backend.

@tgreenx
Copy link
Contributor

tgreenx commented Jun 14, 2023

Solved by #1045

@tgreenx tgreenx closed this as completed Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Bug Type: Bug in software or error in test case description
Projects
None yet
Development

No branches or pull requests

3 participants