summaryrefslogtreecommitdiff
path: root/components/net/utest/Kconfig
blob: 76d8240517fc4580f849d8b1c935c0542595ad47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
menu "Network"

    config RT_UTEST_TC_USING_SAL
        select RT_USING_SAL
        bool "SAL Unit Testcase"
        default n

    menuconfig RT_UTEST_TC_USING_NETDEV
        select RT_USING_NETDEV
        bool "Netdev API Test"
        help
            Enable netdev network device framework unit tests.
            
            Test coverage includes:
            * Network connectivity (ping operations)
            * DHCP functionality (enable/disable/restore)
            * DNS configuration and hostname resolution
            * Interface configuration (IP/gateway/netmask)
            * IP address conversion functions
            * Device retrieval and management
            * Status control and callback mechanisms

        if RT_UTEST_TC_USING_NETDEV

            config RT_UTEST_DEFAULT_NETDEV_NAME
                string "Default Netdev Name"
                default "e0"
                help
                    Network interface name for tests. Common values:
                    "e0" (Ethernet), "w0" (Wireless).
                    Ensure the device exists in your environment.
        endif

    menuconfig RT_UTEST_TC_USING_LWIP
        select RT_USING_LWIP
        select RT_LWIP_NETIF_LOOPBACK
        bool "lwIP Unit Testcase"
        default n
        help
            Enable lwIP network stack unit tests including DNS resolution,
            TCP/UDP socket operations, and network interface tests

        if RT_UTEST_TC_USING_LWIP

            config RT_UTEST_LWIP_DNS_TEST
                bool "DNS Resolution Test"
                default y
                help
                    Enable DNS resolution unit tests including gethostbyname()
                    and gethostbyname_r() functions for hostname to IP resolution,
                    as well as getaddrinfo() and freeaddrinfo() for address info
                    retrieval and release. Tests verify successful resolution
                    without hardcoded IP comparisons.

            config RT_UTEST_LWIP_TCP_TEST
                bool "TCP Socket Test"
                default y
                help
                    Enable TCP socket unit tests including client-server communication
                    with echo functionality, socket creation, binding, listening,
                    accepting connections, data transmission with varying buffer sizes,
                    socket options (TCP_NODELAY, SO_REUSEADDR, SO_REUSEPORT),
                    and connection management (shutdown, close).

            config RT_UTEST_LWIP_UDP_TEST
                bool "UDP Socket Test"
                default y
                help
                    Enable UDP socket unit tests including datagram transmission
                    and reception, client-server echo communication, socket binding
                    to any port, select() operations with timeout, recvfrom/sendto
                    functions, and timeout handling for receive operations.

            config RT_UTEST_LWIP_ICMP_TEST
                bool "ICMP Ping Test"
                default y
                help
                    Enable ICMP ping unit tests using raw sockets to send
                    ICMP echo requests and receive echo replies. Tests verify
                    basic ICMP functionality with loopback address (127.0.0.1).

            config RT_UTEST_LWIP_SOCKET_OPT_TEST
                bool "Socket Options Test"
                default y
                help
                    Enable socket options unit tests including setsockopt()
                    and getsockopt() functions. Tests verify setting and
                    retrieving socket options such as SO_REUSEADDR.

            config RT_UTEST_LWIP_ADDR_CONV_TEST
                bool "Address Conversion Test"
                default y
                help
                    Enable address conversion unit tests including inet_addr()
                    for converting string IP addresses to binary format and
                    inet_ntoa() for converting binary addresses back to strings.
                    Tests verify proper conversion functionality.

            config RT_UTEST_LWIP_NETIF_TEST
                bool "Network Interface Management Test"
                default y
                help
                    Enable network interface management unit tests including
                    netif_set_up(), netif_set_down(), and netif_set_default()
                    functions. Tests verify interface state changes and
                    default interface configuration.

            config RT_UTEST_LWIP_TCP_PORT
                int "TCP Test Port"
                default 1234
                range 1024 65535
                help
                    Configure the TCP port number for unit test communication.
                    Must be in the range 1024-65535 to avoid system ports

            config RT_UTEST_LWIP_UDP_PORT
                int "UDP Test Port"
                default 1235
                range 1024 65535
                help
                    Configure the UDP port number for unit test communication.
                    Must be in the range 1024-65535 to avoid system ports

            config RT_UTEST_LWIP_TEST_URL
                string "Test Domain Name"
                default "www.rt-thread.org"
                help
                    Configure the domain name for DNS resolution tests.
                    This domain will be resolved to verify DNS functionality

            config RT_UTEST_LWIP_TEST_ADDR
                string "Expected IP Address"
                default "180.163.146.111"
                help
                    Configure the expected IP address for DNS resolution verification.
                    This should match the actual IP of the test domain

        endif

endmenu