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

sys/net/application_layer/sock_dns_mock: add module for mocking sock_dns #17871

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

HendrikVE
Copy link
Contributor

@HendrikVE HendrikVE commented Mar 26, 2022

Contribution description

Makes tests/netutils/mock_dns.c available globally as new module. It is useful for #17680 and #16853

Testing procedure

Run tests/netutils/main.c

@github-actions github-actions bot removed the Area: build system Area: Build system label Mar 27, 2022
@HendrikVE HendrikVE changed the title sys/net/application_layer/sock_dns: add pseudomodule for mocking sys/net/application_layer/sock_dns_mock: add module for mocking sock_dns Mar 27, 2022
@HendrikVE HendrikVE force-pushed the pr/sock_dns_mock branch 2 times, most recently from 7eec67f to 56a1510 Compare March 29, 2022 15:10
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 31, 2022
Comment on lines 40 to 47
#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"
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and adapted documentation

@OlegHahm OlegHahm merged commit 755ea30 into RIOT-OS:master Apr 8, 2022
@HendrikVE HendrikVE deleted the pr/sock_dns_mock branch April 9, 2022 12:35
@HendrikVE
Copy link
Contributor Author

@benpicco Thank you very much for your review!

@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants