Why use net_if_get_first_by_type(...) instead of net_if_get_default in dhcp4 test case from v.2.6.0. #net #test


In my opinion, is using net_if_get_default more appropriate than using net_if_get_first_by_type(&NET_L2_GET_NAME(DUMMY)) in tests/net/dhcpv4/src/main.c:434?

If using the net_if_get_first_by_type(&NET_L2_GET_NAME(DUMMY)), the test program can only be tested through a fake network interface(GUMMY), it means that it won't test the communicate between device and DHCP server on the real network.
But if using net_if_get_default, users can use Kconfig to select the default network interface, and if the developer has ported the driver for physical network interface, users can test the communication between the device and DHCP server.

Maybe it’s because I don’t know enough about the program architecture
Please forgive me if the concept is not correct.


Join {devel@lists.zephyrproject.org to automatically receive all group messages.