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

Add mocking to test network/cache behavior #450

Open
phillip-stephens opened this issue Sep 19, 2024 · 0 comments
Open

Add mocking to test network/cache behavior #450

phillip-stephens opened this issue Sep 19, 2024 · 0 comments
Assignees

Comments

@phillip-stephens
Copy link
Contributor

Our current mocking for unit tests is at the highest level of abstraction (DoSingleDstServerLookup) which avoids testing a lot of inner logic. After seeing #449, I think we need a way to ensure that some guarantees about how ZDNS is supposed to operate hold true.

For example:

  • TCP/TLS/HTTPS sessions should be re-used
    • ./zdns A google.com yahoo.com microsoft.com apple.com eBay.com zdns-testing.com Cloudflare.com--threads=2 --tcp-only should result in only 2 TCP handshakes taking place
  • GTLD servers should only be queried once from the roots per-gTLD
    • google.com and yahoo.com both have the same gTLD. In ./zdns A google.com yahoo.com --threads=1 --iterative, ZDNS should only make 1 query to the set of root IP addresses
    • This can be extended to include 2 sub-domains of google.com, and we should only query the .com name servers once for google.com's nameservers

Talked with @zakird and thinking the best approach is to introduce some sort of mocking for reliable tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant