|
| 1 | +if RT_USING_LWIP |
| 2 | + menu "LwIP Network Unit Testcase" |
| 3 | + |
| 4 | + config RT_UTEST_TC_USING_LWIP |
| 5 | + bool "lwIP API test" |
| 6 | + help |
| 7 | + Enable lwIP network stack unit tests including DNS resolution, |
| 8 | + TCP/UDP socket operations, and network interface tests |
| 9 | + |
| 10 | + if RT_UTEST_TC_USING_LWIP |
| 11 | + |
| 12 | + config RT_UTEST_LWIP_DNS_TEST |
| 13 | + bool "DNS resolution test" |
| 14 | + default y |
| 15 | + help |
| 16 | + Enable DNS resolution unit tests including gethostbyname() |
| 17 | + and gethostbyname_r() functions for hostname to IP resolution, |
| 18 | + as well as getaddrinfo() and freeaddrinfo() for address info |
| 19 | + retrieval and release. Tests verify successful resolution |
| 20 | + without hardcoded IP comparisons. |
| 21 | + |
| 22 | + config RT_UTEST_LWIP_TCP_TEST |
| 23 | + bool "TCP socket test" |
| 24 | + default y |
| 25 | + help |
| 26 | + Enable TCP socket unit tests including client-server communication |
| 27 | + with echo functionality, socket creation, binding, listening, |
| 28 | + accepting connections, data transmission with varying buffer sizes, |
| 29 | + socket options (TCP_NODELAY, SO_REUSEADDR, SO_REUSEPORT), |
| 30 | + and connection management (shutdown, close). |
| 31 | + |
| 32 | + config RT_UTEST_LWIP_UDP_TEST |
| 33 | + bool "UDP socket test" |
| 34 | + default y |
| 35 | + help |
| 36 | + Enable UDP socket unit tests including datagram transmission |
| 37 | + and reception, client-server echo communication, socket binding |
| 38 | + to any port, select() operations with timeout, recvfrom/sendto |
| 39 | + functions, and timeout handling for receive operations. |
| 40 | + |
| 41 | + config RT_UTEST_LWIP_ICMP_TEST |
| 42 | + bool "ICMP ping test" |
| 43 | + default y |
| 44 | + help |
| 45 | + Enable ICMP ping unit tests using raw sockets to send |
| 46 | + ICMP echo requests and receive echo replies. Tests verify |
| 47 | + basic ICMP functionality with loopback address (127.0.0.1). |
| 48 | + |
| 49 | + config RT_UTEST_LWIP_SOCKET_OPT_TEST |
| 50 | + bool "Socket options test" |
| 51 | + default y |
| 52 | + help |
| 53 | + Enable socket options unit tests including setsockopt() |
| 54 | + and getsockopt() functions. Tests verify setting and |
| 55 | + retrieving socket options such as SO_REUSEADDR. |
| 56 | + |
| 57 | + config RT_UTEST_LWIP_ADDR_CONV_TEST |
| 58 | + bool "Address conversion test" |
| 59 | + default y |
| 60 | + help |
| 61 | + Enable address conversion unit tests including inet_addr() |
| 62 | + for converting string IP addresses to binary format and |
| 63 | + inet_ntoa() for converting binary addresses back to strings. |
| 64 | + Tests verify proper conversion functionality. |
| 65 | + |
| 66 | + config RT_UTEST_LWIP_NETIF_TEST |
| 67 | + bool "Network interface management test" |
| 68 | + default y |
| 69 | + help |
| 70 | + Enable network interface management unit tests including |
| 71 | + netif_set_up(), netif_set_down(), and netif_set_default() |
| 72 | + functions. Tests verify interface state changes and |
| 73 | + default interface configuration. |
| 74 | + |
| 75 | + config RT_UTEST_LWIP_TCP_PORT |
| 76 | + int "TCP test port" |
| 77 | + default 1234 |
| 78 | + range 1024 65535 |
| 79 | + help |
| 80 | + Configure the TCP port number for unit test communication. |
| 81 | + Must be in the range 1024-65535 to avoid system ports |
| 82 | + |
| 83 | + config RT_UTEST_LWIP_UDP_PORT |
| 84 | + int "UDP test port" |
| 85 | + default 1235 |
| 86 | + range 1024 65535 |
| 87 | + help |
| 88 | + Configure the UDP port number for unit test communication. |
| 89 | + Must be in the range 1024-65535 to avoid system ports |
| 90 | + |
| 91 | + config RT_UTEST_LWIP_TEST_URL |
| 92 | + string "Test domain name" |
| 93 | + default "www.rt-thread.org" |
| 94 | + help |
| 95 | + Configure the domain name for DNS resolution tests. |
| 96 | + This domain will be resolved to verify DNS functionality |
| 97 | + |
| 98 | + config RT_UTEST_LWIP_TEST_ADDR |
| 99 | + string "Expected IP address" |
| 100 | + default "180.163.146.111" |
| 101 | + help |
| 102 | + Configure the expected IP address for DNS resolution verification. |
| 103 | + This should match the actual IP of the test domain |
| 104 | + |
| 105 | + endif |
| 106 | + endmenu |
| 107 | +endif |
0 commit comments