-
Notifications
You must be signed in to change notification settings - Fork 51
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
test: Add an integration test for DNS requests #307
Conversation
&& (a.data == "A(Record(127.0.0.1))" | ||
|| a.data == "AAAA(Record(::1))") |
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 record here is hardcoded, the test only works for localhost
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.
Well, I added the "example.io -> localhost" (both v4 and v6 representation of localhost) entry to the mock DNS and I'm asserting that exact event only. So I don't really see the problem.
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.
But I can add more domains and addresses if that's what you mean.
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.
what I mean is that run_dns
creates a mock with the argument records
but instead the check is hardcoded. if you pass something different than localhost (ipv4 or ipv6) it fails. it's more like "run_dns_localhost" because of the implicit check
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.
Gotcha. Should be resolved now.
Add test cases for DNS requests which use dns-mock-server[0], look for the related network events and try to parse them. Move `parse_dns` function out of `mod pulsar`, so it can be used in tests.
Don't hard code the record addresses.
3532f04
to
d7c7d3e
Compare
Add test cases for DNS requests which use dns-mock-server[0], look for the related network events and try to parse them.
Move
parse_dns
function out ofmod pulsar
, so it can be used in tests.