-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/net/application_layer/sock_dns_mock: add module for mocking sock_dns #17871
Conversation
5d63635
to
5cc3cd6
Compare
5cc3cd6
to
3357d1b
Compare
7eec67f
to
56a1510
Compare
sys/include/net/dns_mock.h
Outdated
#define SOCK_DNS_MOCK_EXAMPLE_COM_IPV4_STRING "93.184.216.34" | ||
|
||
/** | ||
* @brief IPv6 string related to the hostname when using sock_dns_mock | ||
* | ||
* @see @ref SOCK_DNS_MOCK_EXAMPLE_COM_HOSTNAME | ||
*/ | ||
#define SOCK_DNS_MOCK_EXAMPLE_COM_IPV6_STRING "2606:2800:220:1:248:1893:25c8:1946" |
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 are those used for?
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.
At one point I thought about parsing the ipv4_addr_t
into a string and compare it on a string basis, but I decided that this is an unnecessary step and that comparing it by ipv4_addr_equal
is sufficient already. I kept them because in my opinion a define does not hurt and may be used later, but we can also remove these and simply mention the IP address in the doc of sock_dns_mock_example_com_addr_ipv4
and sock_dns_mock_example_com_addr_ipv6
.
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.
Let’s remove it - I can easily see this getting out of sync with the actual address in the future.
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.
Removed and adapted documentation
56a1510
to
a9fb338
Compare
@benpicco Thank you very much for your review! |
Contribution description
Makes
tests/netutils/mock_dns.c
available globally as new module. It is useful for #17680 and #16853Testing procedure
Run
tests/netutils/main.c